/**
 * (C) Copyright IBM Corp. 2023, 2024, 2025.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package vpcv1_test

import (
	"bytes"
	"context"
	"encoding/base64"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"net/http/httptest"
	"os"
	"time"

	"github.com/IBM/go-sdk-core/v5/core"
	"github.com/IBM/vpc-go-sdk/vpcv1"
	"github.com/go-openapi/strfmt"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe(`VpcV1`, func() {
	var testServer *httptest.Server
	Describe(`Service constructor tests`, func() {
		version := "2024-06-23"
		It(`Instantiate service client`, func() {
			vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
				Authenticator: &core.NoAuthAuthenticator{},
				Version:       core.StringPtr(version),
			})
			Expect(vpcService).ToNot(BeNil())
			Expect(serviceErr).To(BeNil())
		})
		It(`Instantiate service client with error: Invalid URL`, func() {
			vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
				URL:     "{BAD_URL_STRING",
				Version: core.StringPtr(version),
			})
			Expect(vpcService).To(BeNil())
			Expect(serviceErr).ToNot(BeNil())
		})
		It(`Instantiate service client with error: Invalid Auth`, func() {
			vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
				URL:     "https://vpcv1/api",
				Version: core.StringPtr(version),
				Authenticator: &core.BasicAuthenticator{
					Username: "",
					Password: "",
				},
			})
			Expect(vpcService).To(BeNil())
			Expect(serviceErr).ToNot(BeNil())
		})
		It(`Instantiate service client with error: Validation Error`, func() {
			vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{})
			Expect(vpcService).To(BeNil())
			Expect(serviceErr).ToNot(BeNil())
		})
	})
	Describe(`Service constructor tests using external config`, func() {
		version := "2024-06-23"
		Context(`Using external config, construct service client instances`, func() {
			// Map containing environment variables used in testing.
			var testEnvironment = map[string]string{
				"VPC_URL":       "https://vpcv1/api",
				"VPC_AUTH_TYPE": "noauth",
			}

			It(`Create service client using external config successfully`, func() {
				SetTestEnvironment(testEnvironment)
				vpcService, serviceErr := vpcv1.NewVpcV1UsingExternalConfig(&vpcv1.VpcV1Options{
					Version: core.StringPtr(version),
				})
				Expect(vpcService).ToNot(BeNil())
				Expect(serviceErr).To(BeNil())
				ClearTestEnvironment(testEnvironment)

				clone := vpcService.Clone()
				Expect(clone).ToNot(BeNil())
				Expect(clone.Service != vpcService.Service).To(BeTrue())
				Expect(clone.GetServiceURL()).To(Equal(vpcService.GetServiceURL()))
				Expect(clone.Service.Options.Authenticator).To(Equal(vpcService.Service.Options.Authenticator))
			})
			It(`Create service client using external config and set url from constructor successfully`, func() {
				SetTestEnvironment(testEnvironment)
				vpcService, serviceErr := vpcv1.NewVpcV1UsingExternalConfig(&vpcv1.VpcV1Options{
					URL:     "https://testService/api",
					Version: core.StringPtr(version),
				})
				Expect(vpcService).ToNot(BeNil())
				Expect(serviceErr).To(BeNil())
				Expect(vpcService.Service.GetServiceURL()).To(Equal("https://testService/api"))
				ClearTestEnvironment(testEnvironment)

				clone := vpcService.Clone()
				Expect(clone).ToNot(BeNil())
				Expect(clone.Service != vpcService.Service).To(BeTrue())
				Expect(clone.GetServiceURL()).To(Equal(vpcService.GetServiceURL()))
				Expect(clone.Service.Options.Authenticator).To(Equal(vpcService.Service.Options.Authenticator))
			})
			It(`Create service client using external config and set url programatically successfully`, func() {
				SetTestEnvironment(testEnvironment)
				vpcService, serviceErr := vpcv1.NewVpcV1UsingExternalConfig(&vpcv1.VpcV1Options{
					Version: core.StringPtr(version),
				})
				err := vpcService.SetServiceURL("https://testService/api")
				Expect(err).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				Expect(serviceErr).To(BeNil())
				Expect(vpcService.Service.GetServiceURL()).To(Equal("https://testService/api"))
				ClearTestEnvironment(testEnvironment)

				clone := vpcService.Clone()
				Expect(clone).ToNot(BeNil())
				Expect(clone.Service != vpcService.Service).To(BeTrue())
				Expect(clone.GetServiceURL()).To(Equal(vpcService.GetServiceURL()))
				Expect(clone.Service.Options.Authenticator).To(Equal(vpcService.Service.Options.Authenticator))
			})
		})
		Context(`Using external config, construct service client instances with error: Invalid Auth`, func() {
			// Map containing environment variables used in testing.
			var testEnvironment = map[string]string{
				"VPC_URL":       "https://vpcv1/api",
				"VPC_AUTH_TYPE": "someOtherAuth",
			}

			SetTestEnvironment(testEnvironment)
			vpcService, serviceErr := vpcv1.NewVpcV1UsingExternalConfig(&vpcv1.VpcV1Options{
				Version: core.StringPtr(version),
			})

			It(`Instantiate service client with error`, func() {
				Expect(vpcService).To(BeNil())
				Expect(serviceErr).ToNot(BeNil())
				ClearTestEnvironment(testEnvironment)
			})
		})
		Context(`Using external config, construct service client instances with error: Invalid URL`, func() {
			// Map containing environment variables used in testing.
			var testEnvironment = map[string]string{
				"VPC_AUTH_TYPE": "NOAuth",
			}

			SetTestEnvironment(testEnvironment)
			vpcService, serviceErr := vpcv1.NewVpcV1UsingExternalConfig(&vpcv1.VpcV1Options{
				URL:     "{BAD_URL_STRING",
				Version: core.StringPtr(version),
			})

			It(`Instantiate service client with error`, func() {
				Expect(vpcService).To(BeNil())
				Expect(serviceErr).ToNot(BeNil())
				ClearTestEnvironment(testEnvironment)
			})
		})
	})
	Describe(`Regional endpoint tests`, func() {
		It(`GetServiceURLForRegion(region string)`, func() {
			var url string
			var err error
			url, err = vpcv1.GetServiceURLForRegion("au-syd")
			Expect(url).To(Equal("https://au-syd.iaas.cloud.ibm.com/v1"))
			Expect(err).To(BeNil())

			url, err = vpcv1.GetServiceURLForRegion("br-sao")
			Expect(url).To(Equal("https://br-sao.iaas.cloud.ibm.com/v1"))
			Expect(err).To(BeNil())

			url, err = vpcv1.GetServiceURLForRegion("ca-mon")
			Expect(url).To(Equal("https://ca-mon.iaas.cloud.ibm.com/v1"))
			Expect(err).To(BeNil())

			url, err = vpcv1.GetServiceURLForRegion("ca-tor")
			Expect(url).To(Equal("https://ca-tor.iaas.cloud.ibm.com/v1"))
			Expect(err).To(BeNil())

			url, err = vpcv1.GetServiceURLForRegion("eu-de")
			Expect(url).To(Equal("https://eu-de.iaas.cloud.ibm.com/v1"))
			Expect(err).To(BeNil())

			url, err = vpcv1.GetServiceURLForRegion("eu-es")
			Expect(url).To(Equal("https://eu-es.iaas.cloud.ibm.com/v1"))
			Expect(err).To(BeNil())

			url, err = vpcv1.GetServiceURLForRegion("eu-gb")
			Expect(url).To(Equal("https://eu-gb.iaas.cloud.ibm.com/v1"))
			Expect(err).To(BeNil())

			url, err = vpcv1.GetServiceURLForRegion("in-che")
			Expect(url).To(Equal("https://in-che.iaas.cloud.ibm.com/v1"))
			Expect(err).To(BeNil())

			url, err = vpcv1.GetServiceURLForRegion("jp-osa")
			Expect(url).To(Equal("https://jp-osa.iaas.cloud.ibm.com/v1"))
			Expect(err).To(BeNil())

			url, err = vpcv1.GetServiceURLForRegion("jp-tok")
			Expect(url).To(Equal("https://jp-tok.iaas.cloud.ibm.com/v1"))
			Expect(err).To(BeNil())

			url, err = vpcv1.GetServiceURLForRegion("us-east")
			Expect(url).To(Equal("https://us-east.iaas.cloud.ibm.com/v1"))
			Expect(err).To(BeNil())

			url, err = vpcv1.GetServiceURLForRegion("us-south")
			Expect(url).To(Equal("https://us-south.iaas.cloud.ibm.com/v1"))
			Expect(err).To(BeNil())

			url, err = vpcv1.GetServiceURLForRegion("INVALID_REGION")
			Expect(url).To(BeEmpty())
			Expect(err).ToNot(BeNil())
			fmt.Fprintf(GinkgoWriter, "Expected error: %s\n", err.Error())
		})
	})
	Describe(`ListBackupPolicies(listBackupPoliciesOptions *ListBackupPoliciesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listBackupPoliciesPath := "/backup_policies"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBackupPoliciesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["tag"]).To(Equal([]string{"testString"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListBackupPolicies with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBackupPoliciesOptions model
				listBackupPoliciesOptionsModel := new(vpcv1.ListBackupPoliciesOptions)
				listBackupPoliciesOptionsModel.Start = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBackupPoliciesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Name = core.StringPtr("my-name")
				listBackupPoliciesOptionsModel.Tag = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListBackupPolicies(listBackupPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListBackupPolicies(listBackupPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBackupPolicies(listBackupPoliciesOptions *ListBackupPoliciesOptions)`, func() {
		version := "2024-06-23"
		listBackupPoliciesPath := "/backup_policies"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBackupPoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["tag"]).To(Equal([]string{"testString"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"backup_policies": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["MatchUserTags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListBackupPolicies successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListBackupPoliciesOptions model
				listBackupPoliciesOptionsModel := new(vpcv1.ListBackupPoliciesOptions)
				listBackupPoliciesOptionsModel.Start = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBackupPoliciesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Name = core.StringPtr("my-name")
				listBackupPoliciesOptionsModel.Tag = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListBackupPoliciesWithContext(ctx, listBackupPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListBackupPolicies(listBackupPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListBackupPoliciesWithContext(ctx, listBackupPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBackupPoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["tag"]).To(Equal([]string{"testString"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"backup_policies": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["MatchUserTags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListBackupPolicies successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListBackupPolicies(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListBackupPoliciesOptions model
				listBackupPoliciesOptionsModel := new(vpcv1.ListBackupPoliciesOptions)
				listBackupPoliciesOptionsModel.Start = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBackupPoliciesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Name = core.StringPtr("my-name")
				listBackupPoliciesOptionsModel.Tag = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListBackupPolicies(listBackupPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListBackupPolicies with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBackupPoliciesOptions model
				listBackupPoliciesOptionsModel := new(vpcv1.ListBackupPoliciesOptions)
				listBackupPoliciesOptionsModel.Start = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBackupPoliciesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Name = core.StringPtr("my-name")
				listBackupPoliciesOptionsModel.Tag = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListBackupPolicies(listBackupPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListBackupPolicies successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBackupPoliciesOptions model
				listBackupPoliciesOptionsModel := new(vpcv1.ListBackupPoliciesOptions)
				listBackupPoliciesOptionsModel.Start = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBackupPoliciesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Name = core.StringPtr("my-name")
				listBackupPoliciesOptionsModel.Tag = core.StringPtr("testString")
				listBackupPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListBackupPolicies(listBackupPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.BackupPolicyCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.BackupPolicyCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.BackupPolicyCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBackupPoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r006-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_user_tags":["MatchUserTags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"ebc2b430240943458b9e91e1432cfcce","resource_type":"enterprise"},"included_content":["data_volumes"],"match_resource_type":"instance"}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r006-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_user_tags":["MatchUserTags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"ebc2b430240943458b9e91e1432cfcce","resource_type":"enterprise"},"included_content":["data_volumes"],"match_resource_type":"instance"}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use BackupPoliciesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listBackupPoliciesOptionsModel := &vpcv1.ListBackupPoliciesOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					Name:            core.StringPtr("my-name"),
					Tag:             core.StringPtr("testString"),
				}

				pager, err := vpcService.NewBackupPoliciesPager(listBackupPoliciesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.BackupPolicyIntf
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use BackupPoliciesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listBackupPoliciesOptionsModel := &vpcv1.ListBackupPoliciesOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					Name:            core.StringPtr("my-name"),
					Tag:             core.StringPtr("testString"),
				}

				pager, err := vpcService.NewBackupPoliciesPager(listBackupPoliciesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateBackupPolicy(createBackupPolicyOptions *CreateBackupPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createBackupPolicyPath := "/backup_policies"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBackupPolicyPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateBackupPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPrototype model
				backupPolicyPlanClonePolicyPrototypeModel := new(vpcv1.BackupPolicyPlanClonePolicyPrototype)
				backupPolicyPlanClonePolicyPrototypeModel.MaxSnapshots = core.Int64Ptr(int64(5))
				backupPolicyPlanClonePolicyPrototypeModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model
				backupPolicyPlanDeletionTriggerPrototypeModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPrototype)
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(20))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the BackupPolicyPlanPrototype model
				backupPolicyPlanPrototypeModel := new(vpcv1.BackupPolicyPlanPrototype)
				backupPolicyPlanPrototypeModel.Active = core.BoolPtr(true)
				backupPolicyPlanPrototypeModel.AttachUserTags = []string{"my-daily-backup-plan"}
				backupPolicyPlanPrototypeModel.ClonePolicy = backupPolicyPlanClonePolicyPrototypeModel
				backupPolicyPlanPrototypeModel.CopyUserTags = core.BoolPtr(true)
				backupPolicyPlanPrototypeModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				backupPolicyPlanPrototypeModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPrototypeModel
				backupPolicyPlanPrototypeModel.Name = core.StringPtr("my-policy-plan")
				backupPolicyPlanPrototypeModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN model
				backupPolicyScopePrototypeModel := new(vpcv1.BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN)
				backupPolicyScopePrototypeModel.CRN = core.StringPtr("crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce")

				// Construct an instance of the BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype model
				backupPolicyPrototypeModel := new(vpcv1.BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype)
				backupPolicyPrototypeModel.MatchUserTags = []string{"my-daily-backup-policy"}
				backupPolicyPrototypeModel.Name = core.StringPtr("my-backup-policy")
				backupPolicyPrototypeModel.Plans = []vpcv1.BackupPolicyPlanPrototype{*backupPolicyPlanPrototypeModel}
				backupPolicyPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				backupPolicyPrototypeModel.Scope = backupPolicyScopePrototypeModel
				backupPolicyPrototypeModel.MatchResourceType = core.StringPtr("volume")

				// Construct an instance of the CreateBackupPolicyOptions model
				createBackupPolicyOptionsModel := new(vpcv1.CreateBackupPolicyOptions)
				createBackupPolicyOptionsModel.BackupPolicyPrototype = backupPolicyPrototypeModel
				createBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateBackupPolicy(createBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateBackupPolicy(createBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateBackupPolicy(createBackupPolicyOptions *CreateBackupPolicyOptions)`, func() {
		version := "2024-06-23"
		createBackupPolicyPath := "/backup_policies"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBackupPolicyPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["MatchUserTags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}`)
				}))
			})
			It(`Invoke CreateBackupPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPrototype model
				backupPolicyPlanClonePolicyPrototypeModel := new(vpcv1.BackupPolicyPlanClonePolicyPrototype)
				backupPolicyPlanClonePolicyPrototypeModel.MaxSnapshots = core.Int64Ptr(int64(5))
				backupPolicyPlanClonePolicyPrototypeModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model
				backupPolicyPlanDeletionTriggerPrototypeModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPrototype)
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(20))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the BackupPolicyPlanPrototype model
				backupPolicyPlanPrototypeModel := new(vpcv1.BackupPolicyPlanPrototype)
				backupPolicyPlanPrototypeModel.Active = core.BoolPtr(true)
				backupPolicyPlanPrototypeModel.AttachUserTags = []string{"my-daily-backup-plan"}
				backupPolicyPlanPrototypeModel.ClonePolicy = backupPolicyPlanClonePolicyPrototypeModel
				backupPolicyPlanPrototypeModel.CopyUserTags = core.BoolPtr(true)
				backupPolicyPlanPrototypeModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				backupPolicyPlanPrototypeModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPrototypeModel
				backupPolicyPlanPrototypeModel.Name = core.StringPtr("my-policy-plan")
				backupPolicyPlanPrototypeModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN model
				backupPolicyScopePrototypeModel := new(vpcv1.BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN)
				backupPolicyScopePrototypeModel.CRN = core.StringPtr("crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce")

				// Construct an instance of the BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype model
				backupPolicyPrototypeModel := new(vpcv1.BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype)
				backupPolicyPrototypeModel.MatchUserTags = []string{"my-daily-backup-policy"}
				backupPolicyPrototypeModel.Name = core.StringPtr("my-backup-policy")
				backupPolicyPrototypeModel.Plans = []vpcv1.BackupPolicyPlanPrototype{*backupPolicyPlanPrototypeModel}
				backupPolicyPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				backupPolicyPrototypeModel.Scope = backupPolicyScopePrototypeModel
				backupPolicyPrototypeModel.MatchResourceType = core.StringPtr("volume")

				// Construct an instance of the CreateBackupPolicyOptions model
				createBackupPolicyOptionsModel := new(vpcv1.CreateBackupPolicyOptions)
				createBackupPolicyOptionsModel.BackupPolicyPrototype = backupPolicyPrototypeModel
				createBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateBackupPolicyWithContext(ctx, createBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateBackupPolicy(createBackupPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateBackupPolicyWithContext(ctx, createBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBackupPolicyPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["MatchUserTags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}`)
				}))
			})
			It(`Invoke CreateBackupPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateBackupPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPrototype model
				backupPolicyPlanClonePolicyPrototypeModel := new(vpcv1.BackupPolicyPlanClonePolicyPrototype)
				backupPolicyPlanClonePolicyPrototypeModel.MaxSnapshots = core.Int64Ptr(int64(5))
				backupPolicyPlanClonePolicyPrototypeModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model
				backupPolicyPlanDeletionTriggerPrototypeModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPrototype)
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(20))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the BackupPolicyPlanPrototype model
				backupPolicyPlanPrototypeModel := new(vpcv1.BackupPolicyPlanPrototype)
				backupPolicyPlanPrototypeModel.Active = core.BoolPtr(true)
				backupPolicyPlanPrototypeModel.AttachUserTags = []string{"my-daily-backup-plan"}
				backupPolicyPlanPrototypeModel.ClonePolicy = backupPolicyPlanClonePolicyPrototypeModel
				backupPolicyPlanPrototypeModel.CopyUserTags = core.BoolPtr(true)
				backupPolicyPlanPrototypeModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				backupPolicyPlanPrototypeModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPrototypeModel
				backupPolicyPlanPrototypeModel.Name = core.StringPtr("my-policy-plan")
				backupPolicyPlanPrototypeModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN model
				backupPolicyScopePrototypeModel := new(vpcv1.BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN)
				backupPolicyScopePrototypeModel.CRN = core.StringPtr("crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce")

				// Construct an instance of the BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype model
				backupPolicyPrototypeModel := new(vpcv1.BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype)
				backupPolicyPrototypeModel.MatchUserTags = []string{"my-daily-backup-policy"}
				backupPolicyPrototypeModel.Name = core.StringPtr("my-backup-policy")
				backupPolicyPrototypeModel.Plans = []vpcv1.BackupPolicyPlanPrototype{*backupPolicyPlanPrototypeModel}
				backupPolicyPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				backupPolicyPrototypeModel.Scope = backupPolicyScopePrototypeModel
				backupPolicyPrototypeModel.MatchResourceType = core.StringPtr("volume")

				// Construct an instance of the CreateBackupPolicyOptions model
				createBackupPolicyOptionsModel := new(vpcv1.CreateBackupPolicyOptions)
				createBackupPolicyOptionsModel.BackupPolicyPrototype = backupPolicyPrototypeModel
				createBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateBackupPolicy(createBackupPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateBackupPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPrototype model
				backupPolicyPlanClonePolicyPrototypeModel := new(vpcv1.BackupPolicyPlanClonePolicyPrototype)
				backupPolicyPlanClonePolicyPrototypeModel.MaxSnapshots = core.Int64Ptr(int64(5))
				backupPolicyPlanClonePolicyPrototypeModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model
				backupPolicyPlanDeletionTriggerPrototypeModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPrototype)
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(20))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the BackupPolicyPlanPrototype model
				backupPolicyPlanPrototypeModel := new(vpcv1.BackupPolicyPlanPrototype)
				backupPolicyPlanPrototypeModel.Active = core.BoolPtr(true)
				backupPolicyPlanPrototypeModel.AttachUserTags = []string{"my-daily-backup-plan"}
				backupPolicyPlanPrototypeModel.ClonePolicy = backupPolicyPlanClonePolicyPrototypeModel
				backupPolicyPlanPrototypeModel.CopyUserTags = core.BoolPtr(true)
				backupPolicyPlanPrototypeModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				backupPolicyPlanPrototypeModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPrototypeModel
				backupPolicyPlanPrototypeModel.Name = core.StringPtr("my-policy-plan")
				backupPolicyPlanPrototypeModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN model
				backupPolicyScopePrototypeModel := new(vpcv1.BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN)
				backupPolicyScopePrototypeModel.CRN = core.StringPtr("crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce")

				// Construct an instance of the BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype model
				backupPolicyPrototypeModel := new(vpcv1.BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype)
				backupPolicyPrototypeModel.MatchUserTags = []string{"my-daily-backup-policy"}
				backupPolicyPrototypeModel.Name = core.StringPtr("my-backup-policy")
				backupPolicyPrototypeModel.Plans = []vpcv1.BackupPolicyPlanPrototype{*backupPolicyPlanPrototypeModel}
				backupPolicyPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				backupPolicyPrototypeModel.Scope = backupPolicyScopePrototypeModel
				backupPolicyPrototypeModel.MatchResourceType = core.StringPtr("volume")

				// Construct an instance of the CreateBackupPolicyOptions model
				createBackupPolicyOptionsModel := new(vpcv1.CreateBackupPolicyOptions)
				createBackupPolicyOptionsModel.BackupPolicyPrototype = backupPolicyPrototypeModel
				createBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateBackupPolicy(createBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateBackupPolicyOptions model with no property values
				createBackupPolicyOptionsModelNew := new(vpcv1.CreateBackupPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateBackupPolicy(createBackupPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateBackupPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPrototype model
				backupPolicyPlanClonePolicyPrototypeModel := new(vpcv1.BackupPolicyPlanClonePolicyPrototype)
				backupPolicyPlanClonePolicyPrototypeModel.MaxSnapshots = core.Int64Ptr(int64(5))
				backupPolicyPlanClonePolicyPrototypeModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model
				backupPolicyPlanDeletionTriggerPrototypeModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPrototype)
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(20))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the BackupPolicyPlanPrototype model
				backupPolicyPlanPrototypeModel := new(vpcv1.BackupPolicyPlanPrototype)
				backupPolicyPlanPrototypeModel.Active = core.BoolPtr(true)
				backupPolicyPlanPrototypeModel.AttachUserTags = []string{"my-daily-backup-plan"}
				backupPolicyPlanPrototypeModel.ClonePolicy = backupPolicyPlanClonePolicyPrototypeModel
				backupPolicyPlanPrototypeModel.CopyUserTags = core.BoolPtr(true)
				backupPolicyPlanPrototypeModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				backupPolicyPlanPrototypeModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPrototypeModel
				backupPolicyPlanPrototypeModel.Name = core.StringPtr("my-policy-plan")
				backupPolicyPlanPrototypeModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN model
				backupPolicyScopePrototypeModel := new(vpcv1.BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN)
				backupPolicyScopePrototypeModel.CRN = core.StringPtr("crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce")

				// Construct an instance of the BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype model
				backupPolicyPrototypeModel := new(vpcv1.BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype)
				backupPolicyPrototypeModel.MatchUserTags = []string{"my-daily-backup-policy"}
				backupPolicyPrototypeModel.Name = core.StringPtr("my-backup-policy")
				backupPolicyPrototypeModel.Plans = []vpcv1.BackupPolicyPlanPrototype{*backupPolicyPlanPrototypeModel}
				backupPolicyPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				backupPolicyPrototypeModel.Scope = backupPolicyScopePrototypeModel
				backupPolicyPrototypeModel.MatchResourceType = core.StringPtr("volume")

				// Construct an instance of the CreateBackupPolicyOptions model
				createBackupPolicyOptionsModel := new(vpcv1.CreateBackupPolicyOptions)
				createBackupPolicyOptionsModel.BackupPolicyPrototype = backupPolicyPrototypeModel
				createBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateBackupPolicy(createBackupPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBackupPolicyJobs(listBackupPolicyJobsOptions *ListBackupPolicyJobsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listBackupPolicyJobsPath := "/backup_policies/testString/jobs"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBackupPolicyJobsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["status"]).To(Equal([]string{"failed"}))
					Expect(req.URL.Query()["backup_policy_plan.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["source.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target_snapshots[].id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target_snapshots[].crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListBackupPolicyJobs with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBackupPolicyJobsOptions model
				listBackupPolicyJobsOptionsModel := new(vpcv1.ListBackupPolicyJobsOptions)
				listBackupPolicyJobsOptionsModel.BackupPolicyID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Status = core.StringPtr("failed")
				listBackupPolicyJobsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Start = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBackupPolicyJobsOptionsModel.Sort = core.StringPtr("name")
				listBackupPolicyJobsOptionsModel.SourceID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.TargetSnapshotsID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.TargetSnapshotsCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")
				listBackupPolicyJobsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListBackupPolicyJobs(listBackupPolicyJobsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListBackupPolicyJobs(listBackupPolicyJobsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBackupPolicyJobs(listBackupPolicyJobsOptions *ListBackupPolicyJobsOptions)`, func() {
		version := "2024-06-23"
		listBackupPolicyJobsPath := "/backup_policies/testString/jobs"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBackupPolicyJobsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["status"]).To(Equal([]string{"failed"}))
					Expect(req.URL.Query()["backup_policy_plan.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["source.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target_snapshots[].id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target_snapshots[].crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90", "id": "r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "Message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListBackupPolicyJobs successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListBackupPolicyJobsOptions model
				listBackupPolicyJobsOptionsModel := new(vpcv1.ListBackupPolicyJobsOptions)
				listBackupPolicyJobsOptionsModel.BackupPolicyID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Status = core.StringPtr("failed")
				listBackupPolicyJobsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Start = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBackupPolicyJobsOptionsModel.Sort = core.StringPtr("name")
				listBackupPolicyJobsOptionsModel.SourceID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.TargetSnapshotsID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.TargetSnapshotsCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")
				listBackupPolicyJobsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListBackupPolicyJobsWithContext(ctx, listBackupPolicyJobsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListBackupPolicyJobs(listBackupPolicyJobsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListBackupPolicyJobsWithContext(ctx, listBackupPolicyJobsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBackupPolicyJobsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["status"]).To(Equal([]string{"failed"}))
					Expect(req.URL.Query()["backup_policy_plan.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["source.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target_snapshots[].id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target_snapshots[].crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90", "id": "r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "Message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListBackupPolicyJobs successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListBackupPolicyJobs(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListBackupPolicyJobsOptions model
				listBackupPolicyJobsOptionsModel := new(vpcv1.ListBackupPolicyJobsOptions)
				listBackupPolicyJobsOptionsModel.BackupPolicyID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Status = core.StringPtr("failed")
				listBackupPolicyJobsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Start = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBackupPolicyJobsOptionsModel.Sort = core.StringPtr("name")
				listBackupPolicyJobsOptionsModel.SourceID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.TargetSnapshotsID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.TargetSnapshotsCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")
				listBackupPolicyJobsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListBackupPolicyJobs(listBackupPolicyJobsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListBackupPolicyJobs with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBackupPolicyJobsOptions model
				listBackupPolicyJobsOptionsModel := new(vpcv1.ListBackupPolicyJobsOptions)
				listBackupPolicyJobsOptionsModel.BackupPolicyID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Status = core.StringPtr("failed")
				listBackupPolicyJobsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Start = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBackupPolicyJobsOptionsModel.Sort = core.StringPtr("name")
				listBackupPolicyJobsOptionsModel.SourceID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.TargetSnapshotsID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.TargetSnapshotsCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")
				listBackupPolicyJobsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListBackupPolicyJobs(listBackupPolicyJobsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListBackupPolicyJobsOptions model with no property values
				listBackupPolicyJobsOptionsModelNew := new(vpcv1.ListBackupPolicyJobsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListBackupPolicyJobs(listBackupPolicyJobsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListBackupPolicyJobs successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBackupPolicyJobsOptions model
				listBackupPolicyJobsOptionsModel := new(vpcv1.ListBackupPolicyJobsOptions)
				listBackupPolicyJobsOptionsModel.BackupPolicyID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Status = core.StringPtr("failed")
				listBackupPolicyJobsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Start = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBackupPolicyJobsOptionsModel.Sort = core.StringPtr("name")
				listBackupPolicyJobsOptionsModel.SourceID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.TargetSnapshotsID = core.StringPtr("testString")
				listBackupPolicyJobsOptionsModel.TargetSnapshotsCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")
				listBackupPolicyJobsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListBackupPolicyJobs(listBackupPolicyJobsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.BackupPolicyJobCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.BackupPolicyJobCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.BackupPolicyJobCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBackupPolicyJobsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"jobs":[{"auto_delete":true,"auto_delete_after":90,"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"completed_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90","id":"r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90","job_type":"creation","resource_type":"backup_policy_job","source":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"failed","status_reasons":[{"code":"source_volume_busy","message":"Message","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot"}],"target_snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r006-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"jobs":[{"auto_delete":true,"auto_delete_after":90,"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"completed_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90","id":"r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90","job_type":"creation","resource_type":"backup_policy_job","source":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"failed","status_reasons":[{"code":"source_volume_busy","message":"Message","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot"}],"target_snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r006-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use BackupPolicyJobsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listBackupPolicyJobsOptionsModel := &vpcv1.ListBackupPolicyJobsOptions{
					BackupPolicyID:     core.StringPtr("testString"),
					Status:             core.StringPtr("failed"),
					BackupPolicyPlanID: core.StringPtr("testString"),
					Limit:              core.Int64Ptr(int64(10)),
					Sort:               core.StringPtr("name"),
					SourceID:           core.StringPtr("testString"),
					TargetSnapshotsID:  core.StringPtr("testString"),
					TargetSnapshotsCRN: core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"),
				}

				pager, err := vpcService.NewBackupPolicyJobsPager(listBackupPolicyJobsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.BackupPolicyJob
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use BackupPolicyJobsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listBackupPolicyJobsOptionsModel := &vpcv1.ListBackupPolicyJobsOptions{
					BackupPolicyID:     core.StringPtr("testString"),
					Status:             core.StringPtr("failed"),
					BackupPolicyPlanID: core.StringPtr("testString"),
					Limit:              core.Int64Ptr(int64(10)),
					Sort:               core.StringPtr("name"),
					SourceID:           core.StringPtr("testString"),
					TargetSnapshotsID:  core.StringPtr("testString"),
					TargetSnapshotsCRN: core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"),
				}

				pager, err := vpcService.NewBackupPolicyJobsPager(listBackupPolicyJobsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`GetBackupPolicyJob(getBackupPolicyJobOptions *GetBackupPolicyJobOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getBackupPolicyJobPath := "/backup_policies/testString/jobs/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBackupPolicyJobPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetBackupPolicyJob with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBackupPolicyJobOptions model
				getBackupPolicyJobOptionsModel := new(vpcv1.GetBackupPolicyJobOptions)
				getBackupPolicyJobOptionsModel.BackupPolicyID = core.StringPtr("testString")
				getBackupPolicyJobOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetBackupPolicyJob(getBackupPolicyJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetBackupPolicyJob(getBackupPolicyJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBackupPolicyJob(getBackupPolicyJobOptions *GetBackupPolicyJobOptions)`, func() {
		version := "2024-06-23"
		getBackupPolicyJobPath := "/backup_policies/testString/jobs/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBackupPolicyJobPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90", "id": "r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "Message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}`)
				}))
			})
			It(`Invoke GetBackupPolicyJob successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetBackupPolicyJobOptions model
				getBackupPolicyJobOptionsModel := new(vpcv1.GetBackupPolicyJobOptions)
				getBackupPolicyJobOptionsModel.BackupPolicyID = core.StringPtr("testString")
				getBackupPolicyJobOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetBackupPolicyJobWithContext(ctx, getBackupPolicyJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetBackupPolicyJob(getBackupPolicyJobOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetBackupPolicyJobWithContext(ctx, getBackupPolicyJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBackupPolicyJobPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90", "id": "r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "Message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}`)
				}))
			})
			It(`Invoke GetBackupPolicyJob successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetBackupPolicyJob(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetBackupPolicyJobOptions model
				getBackupPolicyJobOptionsModel := new(vpcv1.GetBackupPolicyJobOptions)
				getBackupPolicyJobOptionsModel.BackupPolicyID = core.StringPtr("testString")
				getBackupPolicyJobOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetBackupPolicyJob(getBackupPolicyJobOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetBackupPolicyJob with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBackupPolicyJobOptions model
				getBackupPolicyJobOptionsModel := new(vpcv1.GetBackupPolicyJobOptions)
				getBackupPolicyJobOptionsModel.BackupPolicyID = core.StringPtr("testString")
				getBackupPolicyJobOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetBackupPolicyJob(getBackupPolicyJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetBackupPolicyJobOptions model with no property values
				getBackupPolicyJobOptionsModelNew := new(vpcv1.GetBackupPolicyJobOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetBackupPolicyJob(getBackupPolicyJobOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetBackupPolicyJob successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBackupPolicyJobOptions model
				getBackupPolicyJobOptionsModel := new(vpcv1.GetBackupPolicyJobOptions)
				getBackupPolicyJobOptionsModel.BackupPolicyID = core.StringPtr("testString")
				getBackupPolicyJobOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetBackupPolicyJob(getBackupPolicyJobOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBackupPolicyPlans(listBackupPolicyPlansOptions *ListBackupPolicyPlansOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listBackupPolicyPlansPath := "/backup_policies/testString/plans"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBackupPolicyPlansPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListBackupPolicyPlans with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBackupPolicyPlansOptions model
				listBackupPolicyPlansOptionsModel := new(vpcv1.ListBackupPolicyPlansOptions)
				listBackupPolicyPlansOptionsModel.BackupPolicyID = core.StringPtr("testString")
				listBackupPolicyPlansOptionsModel.Name = core.StringPtr("my-name")
				listBackupPolicyPlansOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListBackupPolicyPlans(listBackupPolicyPlansOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListBackupPolicyPlans(listBackupPolicyPlansOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBackupPolicyPlans(listBackupPolicyPlansOptions *ListBackupPolicyPlansOptions)`, func() {
		version := "2024-06-23"
		listBackupPolicyPlansPath := "/backup_policies/testString/plans"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBackupPolicyPlansPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "plans": [{"active": true, "attach_user_tags": ["AttachUserTags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListBackupPolicyPlans successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListBackupPolicyPlansOptions model
				listBackupPolicyPlansOptionsModel := new(vpcv1.ListBackupPolicyPlansOptions)
				listBackupPolicyPlansOptionsModel.BackupPolicyID = core.StringPtr("testString")
				listBackupPolicyPlansOptionsModel.Name = core.StringPtr("my-name")
				listBackupPolicyPlansOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListBackupPolicyPlansWithContext(ctx, listBackupPolicyPlansOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListBackupPolicyPlans(listBackupPolicyPlansOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListBackupPolicyPlansWithContext(ctx, listBackupPolicyPlansOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBackupPolicyPlansPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "plans": [{"active": true, "attach_user_tags": ["AttachUserTags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListBackupPolicyPlans successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListBackupPolicyPlans(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListBackupPolicyPlansOptions model
				listBackupPolicyPlansOptionsModel := new(vpcv1.ListBackupPolicyPlansOptions)
				listBackupPolicyPlansOptionsModel.BackupPolicyID = core.StringPtr("testString")
				listBackupPolicyPlansOptionsModel.Name = core.StringPtr("my-name")
				listBackupPolicyPlansOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListBackupPolicyPlans(listBackupPolicyPlansOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListBackupPolicyPlans with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBackupPolicyPlansOptions model
				listBackupPolicyPlansOptionsModel := new(vpcv1.ListBackupPolicyPlansOptions)
				listBackupPolicyPlansOptionsModel.BackupPolicyID = core.StringPtr("testString")
				listBackupPolicyPlansOptionsModel.Name = core.StringPtr("my-name")
				listBackupPolicyPlansOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListBackupPolicyPlans(listBackupPolicyPlansOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListBackupPolicyPlansOptions model with no property values
				listBackupPolicyPlansOptionsModelNew := new(vpcv1.ListBackupPolicyPlansOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListBackupPolicyPlans(listBackupPolicyPlansOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListBackupPolicyPlans successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBackupPolicyPlansOptions model
				listBackupPolicyPlansOptionsModel := new(vpcv1.ListBackupPolicyPlansOptions)
				listBackupPolicyPlansOptionsModel.BackupPolicyID = core.StringPtr("testString")
				listBackupPolicyPlansOptionsModel.Name = core.StringPtr("my-name")
				listBackupPolicyPlansOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListBackupPolicyPlans(listBackupPolicyPlansOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateBackupPolicyPlan(createBackupPolicyPlanOptions *CreateBackupPolicyPlanOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createBackupPolicyPlanPath := "/backup_policies/testString/plans"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBackupPolicyPlanPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateBackupPolicyPlan with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPrototype model
				backupPolicyPlanClonePolicyPrototypeModel := new(vpcv1.BackupPolicyPlanClonePolicyPrototype)
				backupPolicyPlanClonePolicyPrototypeModel.MaxSnapshots = core.Int64Ptr(int64(5))
				backupPolicyPlanClonePolicyPrototypeModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model
				backupPolicyPlanDeletionTriggerPrototypeModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPrototype)
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(20))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the CreateBackupPolicyPlanOptions model
				createBackupPolicyPlanOptionsModel := new(vpcv1.CreateBackupPolicyPlanOptions)
				createBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				createBackupPolicyPlanOptionsModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				createBackupPolicyPlanOptionsModel.Active = core.BoolPtr(true)
				createBackupPolicyPlanOptionsModel.AttachUserTags = []string{"my-daily-backup-plan"}
				createBackupPolicyPlanOptionsModel.ClonePolicy = backupPolicyPlanClonePolicyPrototypeModel
				createBackupPolicyPlanOptionsModel.CopyUserTags = core.BoolPtr(true)
				createBackupPolicyPlanOptionsModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPrototypeModel
				createBackupPolicyPlanOptionsModel.Name = core.StringPtr("my-policy-plan")
				createBackupPolicyPlanOptionsModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}
				createBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateBackupPolicyPlan(createBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateBackupPolicyPlan(createBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateBackupPolicyPlan(createBackupPolicyPlanOptions *CreateBackupPolicyPlanOptions)`, func() {
		version := "2024-06-23"
		createBackupPolicyPlanPath := "/backup_policies/testString/plans"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBackupPolicyPlanPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"active": true, "attach_user_tags": ["AttachUserTags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}`)
				}))
			})
			It(`Invoke CreateBackupPolicyPlan successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPrototype model
				backupPolicyPlanClonePolicyPrototypeModel := new(vpcv1.BackupPolicyPlanClonePolicyPrototype)
				backupPolicyPlanClonePolicyPrototypeModel.MaxSnapshots = core.Int64Ptr(int64(5))
				backupPolicyPlanClonePolicyPrototypeModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model
				backupPolicyPlanDeletionTriggerPrototypeModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPrototype)
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(20))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the CreateBackupPolicyPlanOptions model
				createBackupPolicyPlanOptionsModel := new(vpcv1.CreateBackupPolicyPlanOptions)
				createBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				createBackupPolicyPlanOptionsModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				createBackupPolicyPlanOptionsModel.Active = core.BoolPtr(true)
				createBackupPolicyPlanOptionsModel.AttachUserTags = []string{"my-daily-backup-plan"}
				createBackupPolicyPlanOptionsModel.ClonePolicy = backupPolicyPlanClonePolicyPrototypeModel
				createBackupPolicyPlanOptionsModel.CopyUserTags = core.BoolPtr(true)
				createBackupPolicyPlanOptionsModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPrototypeModel
				createBackupPolicyPlanOptionsModel.Name = core.StringPtr("my-policy-plan")
				createBackupPolicyPlanOptionsModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}
				createBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateBackupPolicyPlanWithContext(ctx, createBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateBackupPolicyPlan(createBackupPolicyPlanOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateBackupPolicyPlanWithContext(ctx, createBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBackupPolicyPlanPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"active": true, "attach_user_tags": ["AttachUserTags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}`)
				}))
			})
			It(`Invoke CreateBackupPolicyPlan successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateBackupPolicyPlan(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPrototype model
				backupPolicyPlanClonePolicyPrototypeModel := new(vpcv1.BackupPolicyPlanClonePolicyPrototype)
				backupPolicyPlanClonePolicyPrototypeModel.MaxSnapshots = core.Int64Ptr(int64(5))
				backupPolicyPlanClonePolicyPrototypeModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model
				backupPolicyPlanDeletionTriggerPrototypeModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPrototype)
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(20))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the CreateBackupPolicyPlanOptions model
				createBackupPolicyPlanOptionsModel := new(vpcv1.CreateBackupPolicyPlanOptions)
				createBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				createBackupPolicyPlanOptionsModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				createBackupPolicyPlanOptionsModel.Active = core.BoolPtr(true)
				createBackupPolicyPlanOptionsModel.AttachUserTags = []string{"my-daily-backup-plan"}
				createBackupPolicyPlanOptionsModel.ClonePolicy = backupPolicyPlanClonePolicyPrototypeModel
				createBackupPolicyPlanOptionsModel.CopyUserTags = core.BoolPtr(true)
				createBackupPolicyPlanOptionsModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPrototypeModel
				createBackupPolicyPlanOptionsModel.Name = core.StringPtr("my-policy-plan")
				createBackupPolicyPlanOptionsModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}
				createBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateBackupPolicyPlan(createBackupPolicyPlanOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateBackupPolicyPlan with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPrototype model
				backupPolicyPlanClonePolicyPrototypeModel := new(vpcv1.BackupPolicyPlanClonePolicyPrototype)
				backupPolicyPlanClonePolicyPrototypeModel.MaxSnapshots = core.Int64Ptr(int64(5))
				backupPolicyPlanClonePolicyPrototypeModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model
				backupPolicyPlanDeletionTriggerPrototypeModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPrototype)
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(20))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the CreateBackupPolicyPlanOptions model
				createBackupPolicyPlanOptionsModel := new(vpcv1.CreateBackupPolicyPlanOptions)
				createBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				createBackupPolicyPlanOptionsModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				createBackupPolicyPlanOptionsModel.Active = core.BoolPtr(true)
				createBackupPolicyPlanOptionsModel.AttachUserTags = []string{"my-daily-backup-plan"}
				createBackupPolicyPlanOptionsModel.ClonePolicy = backupPolicyPlanClonePolicyPrototypeModel
				createBackupPolicyPlanOptionsModel.CopyUserTags = core.BoolPtr(true)
				createBackupPolicyPlanOptionsModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPrototypeModel
				createBackupPolicyPlanOptionsModel.Name = core.StringPtr("my-policy-plan")
				createBackupPolicyPlanOptionsModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}
				createBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateBackupPolicyPlan(createBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateBackupPolicyPlanOptions model with no property values
				createBackupPolicyPlanOptionsModelNew := new(vpcv1.CreateBackupPolicyPlanOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateBackupPolicyPlan(createBackupPolicyPlanOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateBackupPolicyPlan successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPrototype model
				backupPolicyPlanClonePolicyPrototypeModel := new(vpcv1.BackupPolicyPlanClonePolicyPrototype)
				backupPolicyPlanClonePolicyPrototypeModel.MaxSnapshots = core.Int64Ptr(int64(5))
				backupPolicyPlanClonePolicyPrototypeModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model
				backupPolicyPlanDeletionTriggerPrototypeModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPrototype)
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(20))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the CreateBackupPolicyPlanOptions model
				createBackupPolicyPlanOptionsModel := new(vpcv1.CreateBackupPolicyPlanOptions)
				createBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				createBackupPolicyPlanOptionsModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				createBackupPolicyPlanOptionsModel.Active = core.BoolPtr(true)
				createBackupPolicyPlanOptionsModel.AttachUserTags = []string{"my-daily-backup-plan"}
				createBackupPolicyPlanOptionsModel.ClonePolicy = backupPolicyPlanClonePolicyPrototypeModel
				createBackupPolicyPlanOptionsModel.CopyUserTags = core.BoolPtr(true)
				createBackupPolicyPlanOptionsModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPrototypeModel
				createBackupPolicyPlanOptionsModel.Name = core.StringPtr("my-policy-plan")
				createBackupPolicyPlanOptionsModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}
				createBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateBackupPolicyPlan(createBackupPolicyPlanOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteBackupPolicyPlan(deleteBackupPolicyPlanOptions *DeleteBackupPolicyPlanOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deleteBackupPolicyPlanPath := "/backup_policies/testString/plans/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteBackupPolicyPlanPath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeleteBackupPolicyPlan with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteBackupPolicyPlanOptions model
				deleteBackupPolicyPlanOptionsModel := new(vpcv1.DeleteBackupPolicyPlanOptions)
				deleteBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				deleteBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				deleteBackupPolicyPlanOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeleteBackupPolicyPlan(deleteBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeleteBackupPolicyPlan(deleteBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteBackupPolicyPlan(deleteBackupPolicyPlanOptions *DeleteBackupPolicyPlanOptions)`, func() {
		version := "2024-06-23"
		deleteBackupPolicyPlanPath := "/backup_policies/testString/plans/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteBackupPolicyPlanPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"active": true, "attach_user_tags": ["AttachUserTags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}`)
				}))
			})
			It(`Invoke DeleteBackupPolicyPlan successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeleteBackupPolicyPlanOptions model
				deleteBackupPolicyPlanOptionsModel := new(vpcv1.DeleteBackupPolicyPlanOptions)
				deleteBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				deleteBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				deleteBackupPolicyPlanOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeleteBackupPolicyPlanWithContext(ctx, deleteBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeleteBackupPolicyPlan(deleteBackupPolicyPlanOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeleteBackupPolicyPlanWithContext(ctx, deleteBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteBackupPolicyPlanPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"active": true, "attach_user_tags": ["AttachUserTags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}`)
				}))
			})
			It(`Invoke DeleteBackupPolicyPlan successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeleteBackupPolicyPlan(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeleteBackupPolicyPlanOptions model
				deleteBackupPolicyPlanOptionsModel := new(vpcv1.DeleteBackupPolicyPlanOptions)
				deleteBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				deleteBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				deleteBackupPolicyPlanOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeleteBackupPolicyPlan(deleteBackupPolicyPlanOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeleteBackupPolicyPlan with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteBackupPolicyPlanOptions model
				deleteBackupPolicyPlanOptionsModel := new(vpcv1.DeleteBackupPolicyPlanOptions)
				deleteBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				deleteBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				deleteBackupPolicyPlanOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeleteBackupPolicyPlan(deleteBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeleteBackupPolicyPlanOptions model with no property values
				deleteBackupPolicyPlanOptionsModelNew := new(vpcv1.DeleteBackupPolicyPlanOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeleteBackupPolicyPlan(deleteBackupPolicyPlanOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteBackupPolicyPlan successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteBackupPolicyPlanOptions model
				deleteBackupPolicyPlanOptionsModel := new(vpcv1.DeleteBackupPolicyPlanOptions)
				deleteBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				deleteBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				deleteBackupPolicyPlanOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeleteBackupPolicyPlan(deleteBackupPolicyPlanOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBackupPolicyPlan(getBackupPolicyPlanOptions *GetBackupPolicyPlanOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getBackupPolicyPlanPath := "/backup_policies/testString/plans/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBackupPolicyPlanPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetBackupPolicyPlan with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBackupPolicyPlanOptions model
				getBackupPolicyPlanOptionsModel := new(vpcv1.GetBackupPolicyPlanOptions)
				getBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				getBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetBackupPolicyPlan(getBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetBackupPolicyPlan(getBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBackupPolicyPlan(getBackupPolicyPlanOptions *GetBackupPolicyPlanOptions)`, func() {
		version := "2024-06-23"
		getBackupPolicyPlanPath := "/backup_policies/testString/plans/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBackupPolicyPlanPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"active": true, "attach_user_tags": ["AttachUserTags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}`)
				}))
			})
			It(`Invoke GetBackupPolicyPlan successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetBackupPolicyPlanOptions model
				getBackupPolicyPlanOptionsModel := new(vpcv1.GetBackupPolicyPlanOptions)
				getBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				getBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetBackupPolicyPlanWithContext(ctx, getBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetBackupPolicyPlan(getBackupPolicyPlanOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetBackupPolicyPlanWithContext(ctx, getBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBackupPolicyPlanPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"active": true, "attach_user_tags": ["AttachUserTags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}`)
				}))
			})
			It(`Invoke GetBackupPolicyPlan successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetBackupPolicyPlan(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetBackupPolicyPlanOptions model
				getBackupPolicyPlanOptionsModel := new(vpcv1.GetBackupPolicyPlanOptions)
				getBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				getBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetBackupPolicyPlan(getBackupPolicyPlanOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetBackupPolicyPlan with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBackupPolicyPlanOptions model
				getBackupPolicyPlanOptionsModel := new(vpcv1.GetBackupPolicyPlanOptions)
				getBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				getBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetBackupPolicyPlan(getBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetBackupPolicyPlanOptions model with no property values
				getBackupPolicyPlanOptionsModelNew := new(vpcv1.GetBackupPolicyPlanOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetBackupPolicyPlan(getBackupPolicyPlanOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetBackupPolicyPlan successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBackupPolicyPlanOptions model
				getBackupPolicyPlanOptionsModel := new(vpcv1.GetBackupPolicyPlanOptions)
				getBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				getBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetBackupPolicyPlan(getBackupPolicyPlanOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateBackupPolicyPlan(updateBackupPolicyPlanOptions *UpdateBackupPolicyPlanOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateBackupPolicyPlanPath := "/backup_policies/testString/plans/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBackupPolicyPlanPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateBackupPolicyPlan with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPatch model
				backupPolicyPlanClonePolicyPatchModel := new(vpcv1.BackupPolicyPlanClonePolicyPatch)
				backupPolicyPlanClonePolicyPatchModel.MaxSnapshots = core.Int64Ptr(int64(1))
				backupPolicyPlanClonePolicyPatchModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPatch model
				backupPolicyPlanDeletionTriggerPatchModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPatch)
				backupPolicyPlanDeletionTriggerPatchModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPatchModel.DeleteOverCount = core.Int64Ptr(int64(1))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the BackupPolicyPlanPatch model
				backupPolicyPlanPatchModel := new(vpcv1.BackupPolicyPlanPatch)
				backupPolicyPlanPatchModel.Active = core.BoolPtr(true)
				backupPolicyPlanPatchModel.AttachUserTags = []string{"my-daily-backup-plan"}
				backupPolicyPlanPatchModel.ClonePolicy = backupPolicyPlanClonePolicyPatchModel
				backupPolicyPlanPatchModel.CopyUserTags = core.BoolPtr(false)
				backupPolicyPlanPatchModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				backupPolicyPlanPatchModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPatchModel
				backupPolicyPlanPatchModel.Name = core.StringPtr("my-policy-plan")
				backupPolicyPlanPatchModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}
				backupPolicyPlanPatchModelAsPatch, asPatchErr := backupPolicyPlanPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBackupPolicyPlanOptions model
				updateBackupPolicyPlanOptionsModel := new(vpcv1.UpdateBackupPolicyPlanOptions)
				updateBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				updateBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				updateBackupPolicyPlanOptionsModel.BackupPolicyPlanPatch = backupPolicyPlanPatchModelAsPatch
				updateBackupPolicyPlanOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateBackupPolicyPlan(updateBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateBackupPolicyPlan(updateBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateBackupPolicyPlan(updateBackupPolicyPlanOptions *UpdateBackupPolicyPlanOptions)`, func() {
		version := "2024-06-23"
		updateBackupPolicyPlanPath := "/backup_policies/testString/plans/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBackupPolicyPlanPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"active": true, "attach_user_tags": ["AttachUserTags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}`)
				}))
			})
			It(`Invoke UpdateBackupPolicyPlan successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPatch model
				backupPolicyPlanClonePolicyPatchModel := new(vpcv1.BackupPolicyPlanClonePolicyPatch)
				backupPolicyPlanClonePolicyPatchModel.MaxSnapshots = core.Int64Ptr(int64(1))
				backupPolicyPlanClonePolicyPatchModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPatch model
				backupPolicyPlanDeletionTriggerPatchModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPatch)
				backupPolicyPlanDeletionTriggerPatchModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPatchModel.DeleteOverCount = core.Int64Ptr(int64(1))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the BackupPolicyPlanPatch model
				backupPolicyPlanPatchModel := new(vpcv1.BackupPolicyPlanPatch)
				backupPolicyPlanPatchModel.Active = core.BoolPtr(true)
				backupPolicyPlanPatchModel.AttachUserTags = []string{"my-daily-backup-plan"}
				backupPolicyPlanPatchModel.ClonePolicy = backupPolicyPlanClonePolicyPatchModel
				backupPolicyPlanPatchModel.CopyUserTags = core.BoolPtr(false)
				backupPolicyPlanPatchModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				backupPolicyPlanPatchModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPatchModel
				backupPolicyPlanPatchModel.Name = core.StringPtr("my-policy-plan")
				backupPolicyPlanPatchModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}
				backupPolicyPlanPatchModelAsPatch, asPatchErr := backupPolicyPlanPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBackupPolicyPlanOptions model
				updateBackupPolicyPlanOptionsModel := new(vpcv1.UpdateBackupPolicyPlanOptions)
				updateBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				updateBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				updateBackupPolicyPlanOptionsModel.BackupPolicyPlanPatch = backupPolicyPlanPatchModelAsPatch
				updateBackupPolicyPlanOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateBackupPolicyPlanWithContext(ctx, updateBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateBackupPolicyPlan(updateBackupPolicyPlanOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateBackupPolicyPlanWithContext(ctx, updateBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBackupPolicyPlanPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"active": true, "attach_user_tags": ["AttachUserTags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}`)
				}))
			})
			It(`Invoke UpdateBackupPolicyPlan successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateBackupPolicyPlan(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPatch model
				backupPolicyPlanClonePolicyPatchModel := new(vpcv1.BackupPolicyPlanClonePolicyPatch)
				backupPolicyPlanClonePolicyPatchModel.MaxSnapshots = core.Int64Ptr(int64(1))
				backupPolicyPlanClonePolicyPatchModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPatch model
				backupPolicyPlanDeletionTriggerPatchModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPatch)
				backupPolicyPlanDeletionTriggerPatchModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPatchModel.DeleteOverCount = core.Int64Ptr(int64(1))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the BackupPolicyPlanPatch model
				backupPolicyPlanPatchModel := new(vpcv1.BackupPolicyPlanPatch)
				backupPolicyPlanPatchModel.Active = core.BoolPtr(true)
				backupPolicyPlanPatchModel.AttachUserTags = []string{"my-daily-backup-plan"}
				backupPolicyPlanPatchModel.ClonePolicy = backupPolicyPlanClonePolicyPatchModel
				backupPolicyPlanPatchModel.CopyUserTags = core.BoolPtr(false)
				backupPolicyPlanPatchModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				backupPolicyPlanPatchModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPatchModel
				backupPolicyPlanPatchModel.Name = core.StringPtr("my-policy-plan")
				backupPolicyPlanPatchModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}
				backupPolicyPlanPatchModelAsPatch, asPatchErr := backupPolicyPlanPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBackupPolicyPlanOptions model
				updateBackupPolicyPlanOptionsModel := new(vpcv1.UpdateBackupPolicyPlanOptions)
				updateBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				updateBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				updateBackupPolicyPlanOptionsModel.BackupPolicyPlanPatch = backupPolicyPlanPatchModelAsPatch
				updateBackupPolicyPlanOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateBackupPolicyPlan(updateBackupPolicyPlanOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateBackupPolicyPlan with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPatch model
				backupPolicyPlanClonePolicyPatchModel := new(vpcv1.BackupPolicyPlanClonePolicyPatch)
				backupPolicyPlanClonePolicyPatchModel.MaxSnapshots = core.Int64Ptr(int64(1))
				backupPolicyPlanClonePolicyPatchModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPatch model
				backupPolicyPlanDeletionTriggerPatchModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPatch)
				backupPolicyPlanDeletionTriggerPatchModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPatchModel.DeleteOverCount = core.Int64Ptr(int64(1))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the BackupPolicyPlanPatch model
				backupPolicyPlanPatchModel := new(vpcv1.BackupPolicyPlanPatch)
				backupPolicyPlanPatchModel.Active = core.BoolPtr(true)
				backupPolicyPlanPatchModel.AttachUserTags = []string{"my-daily-backup-plan"}
				backupPolicyPlanPatchModel.ClonePolicy = backupPolicyPlanClonePolicyPatchModel
				backupPolicyPlanPatchModel.CopyUserTags = core.BoolPtr(false)
				backupPolicyPlanPatchModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				backupPolicyPlanPatchModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPatchModel
				backupPolicyPlanPatchModel.Name = core.StringPtr("my-policy-plan")
				backupPolicyPlanPatchModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}
				backupPolicyPlanPatchModelAsPatch, asPatchErr := backupPolicyPlanPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBackupPolicyPlanOptions model
				updateBackupPolicyPlanOptionsModel := new(vpcv1.UpdateBackupPolicyPlanOptions)
				updateBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				updateBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				updateBackupPolicyPlanOptionsModel.BackupPolicyPlanPatch = backupPolicyPlanPatchModelAsPatch
				updateBackupPolicyPlanOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateBackupPolicyPlan(updateBackupPolicyPlanOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateBackupPolicyPlanOptions model with no property values
				updateBackupPolicyPlanOptionsModelNew := new(vpcv1.UpdateBackupPolicyPlanOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateBackupPolicyPlan(updateBackupPolicyPlanOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateBackupPolicyPlan successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the BackupPolicyPlanClonePolicyPatch model
				backupPolicyPlanClonePolicyPatchModel := new(vpcv1.BackupPolicyPlanClonePolicyPatch)
				backupPolicyPlanClonePolicyPatchModel.MaxSnapshots = core.Int64Ptr(int64(1))
				backupPolicyPlanClonePolicyPatchModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPatch model
				backupPolicyPlanDeletionTriggerPatchModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPatch)
				backupPolicyPlanDeletionTriggerPatchModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPatchModel.DeleteOverCount = core.Int64Ptr(int64(1))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				regionIdentityModel.Name = core.StringPtr("us-south")

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel

				// Construct an instance of the BackupPolicyPlanPatch model
				backupPolicyPlanPatchModel := new(vpcv1.BackupPolicyPlanPatch)
				backupPolicyPlanPatchModel.Active = core.BoolPtr(true)
				backupPolicyPlanPatchModel.AttachUserTags = []string{"my-daily-backup-plan"}
				backupPolicyPlanPatchModel.ClonePolicy = backupPolicyPlanClonePolicyPatchModel
				backupPolicyPlanPatchModel.CopyUserTags = core.BoolPtr(false)
				backupPolicyPlanPatchModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				backupPolicyPlanPatchModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPatchModel
				backupPolicyPlanPatchModel.Name = core.StringPtr("my-policy-plan")
				backupPolicyPlanPatchModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}
				backupPolicyPlanPatchModelAsPatch, asPatchErr := backupPolicyPlanPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBackupPolicyPlanOptions model
				updateBackupPolicyPlanOptionsModel := new(vpcv1.UpdateBackupPolicyPlanOptions)
				updateBackupPolicyPlanOptionsModel.BackupPolicyID = core.StringPtr("testString")
				updateBackupPolicyPlanOptionsModel.ID = core.StringPtr("testString")
				updateBackupPolicyPlanOptionsModel.BackupPolicyPlanPatch = backupPolicyPlanPatchModelAsPatch
				updateBackupPolicyPlanOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateBackupPolicyPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateBackupPolicyPlan(updateBackupPolicyPlanOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteBackupPolicy(deleteBackupPolicyOptions *DeleteBackupPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deleteBackupPolicyPath := "/backup_policies/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteBackupPolicyPath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeleteBackupPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteBackupPolicyOptions model
				deleteBackupPolicyOptionsModel := new(vpcv1.DeleteBackupPolicyOptions)
				deleteBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				deleteBackupPolicyOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeleteBackupPolicy(deleteBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeleteBackupPolicy(deleteBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteBackupPolicy(deleteBackupPolicyOptions *DeleteBackupPolicyOptions)`, func() {
		version := "2024-06-23"
		deleteBackupPolicyPath := "/backup_policies/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteBackupPolicyPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["MatchUserTags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}`)
				}))
			})
			It(`Invoke DeleteBackupPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeleteBackupPolicyOptions model
				deleteBackupPolicyOptionsModel := new(vpcv1.DeleteBackupPolicyOptions)
				deleteBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				deleteBackupPolicyOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeleteBackupPolicyWithContext(ctx, deleteBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeleteBackupPolicy(deleteBackupPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeleteBackupPolicyWithContext(ctx, deleteBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteBackupPolicyPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["MatchUserTags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}`)
				}))
			})
			It(`Invoke DeleteBackupPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeleteBackupPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeleteBackupPolicyOptions model
				deleteBackupPolicyOptionsModel := new(vpcv1.DeleteBackupPolicyOptions)
				deleteBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				deleteBackupPolicyOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeleteBackupPolicy(deleteBackupPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeleteBackupPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteBackupPolicyOptions model
				deleteBackupPolicyOptionsModel := new(vpcv1.DeleteBackupPolicyOptions)
				deleteBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				deleteBackupPolicyOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeleteBackupPolicy(deleteBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeleteBackupPolicyOptions model with no property values
				deleteBackupPolicyOptionsModelNew := new(vpcv1.DeleteBackupPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeleteBackupPolicy(deleteBackupPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteBackupPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteBackupPolicyOptions model
				deleteBackupPolicyOptionsModel := new(vpcv1.DeleteBackupPolicyOptions)
				deleteBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				deleteBackupPolicyOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeleteBackupPolicy(deleteBackupPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBackupPolicy(getBackupPolicyOptions *GetBackupPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getBackupPolicyPath := "/backup_policies/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBackupPolicyPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetBackupPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBackupPolicyOptions model
				getBackupPolicyOptionsModel := new(vpcv1.GetBackupPolicyOptions)
				getBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetBackupPolicy(getBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetBackupPolicy(getBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBackupPolicy(getBackupPolicyOptions *GetBackupPolicyOptions)`, func() {
		version := "2024-06-23"
		getBackupPolicyPath := "/backup_policies/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBackupPolicyPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["MatchUserTags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}`)
				}))
			})
			It(`Invoke GetBackupPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetBackupPolicyOptions model
				getBackupPolicyOptionsModel := new(vpcv1.GetBackupPolicyOptions)
				getBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetBackupPolicyWithContext(ctx, getBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetBackupPolicy(getBackupPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetBackupPolicyWithContext(ctx, getBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBackupPolicyPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["MatchUserTags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}`)
				}))
			})
			It(`Invoke GetBackupPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetBackupPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetBackupPolicyOptions model
				getBackupPolicyOptionsModel := new(vpcv1.GetBackupPolicyOptions)
				getBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetBackupPolicy(getBackupPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetBackupPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBackupPolicyOptions model
				getBackupPolicyOptionsModel := new(vpcv1.GetBackupPolicyOptions)
				getBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetBackupPolicy(getBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetBackupPolicyOptions model with no property values
				getBackupPolicyOptionsModelNew := new(vpcv1.GetBackupPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetBackupPolicy(getBackupPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetBackupPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBackupPolicyOptions model
				getBackupPolicyOptionsModel := new(vpcv1.GetBackupPolicyOptions)
				getBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				getBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetBackupPolicy(getBackupPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateBackupPolicy(updateBackupPolicyOptions *UpdateBackupPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateBackupPolicyPath := "/backup_policies/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBackupPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateBackupPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BackupPolicyPatch model
				backupPolicyPatchModel := new(vpcv1.BackupPolicyPatch)
				backupPolicyPatchModel.IncludedContent = []string{"data_volumes"}
				backupPolicyPatchModel.MatchUserTags = []string{"my-tag-1", "my-tag-2", "my-tag-3"}
				backupPolicyPatchModel.Name = core.StringPtr("my-backup-policy")
				backupPolicyPatchModelAsPatch, asPatchErr := backupPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBackupPolicyOptions model
				updateBackupPolicyOptionsModel := new(vpcv1.UpdateBackupPolicyOptions)
				updateBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				updateBackupPolicyOptionsModel.BackupPolicyPatch = backupPolicyPatchModelAsPatch
				updateBackupPolicyOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateBackupPolicy(updateBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateBackupPolicy(updateBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateBackupPolicy(updateBackupPolicyOptions *UpdateBackupPolicyOptions)`, func() {
		version := "2024-06-23"
		updateBackupPolicyPath := "/backup_policies/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBackupPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["MatchUserTags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}`)
				}))
			})
			It(`Invoke UpdateBackupPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the BackupPolicyPatch model
				backupPolicyPatchModel := new(vpcv1.BackupPolicyPatch)
				backupPolicyPatchModel.IncludedContent = []string{"data_volumes"}
				backupPolicyPatchModel.MatchUserTags = []string{"my-tag-1", "my-tag-2", "my-tag-3"}
				backupPolicyPatchModel.Name = core.StringPtr("my-backup-policy")
				backupPolicyPatchModelAsPatch, asPatchErr := backupPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBackupPolicyOptions model
				updateBackupPolicyOptionsModel := new(vpcv1.UpdateBackupPolicyOptions)
				updateBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				updateBackupPolicyOptionsModel.BackupPolicyPatch = backupPolicyPatchModelAsPatch
				updateBackupPolicyOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateBackupPolicyWithContext(ctx, updateBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateBackupPolicy(updateBackupPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateBackupPolicyWithContext(ctx, updateBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBackupPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r006-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["MatchUserTags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}`)
				}))
			})
			It(`Invoke UpdateBackupPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateBackupPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the BackupPolicyPatch model
				backupPolicyPatchModel := new(vpcv1.BackupPolicyPatch)
				backupPolicyPatchModel.IncludedContent = []string{"data_volumes"}
				backupPolicyPatchModel.MatchUserTags = []string{"my-tag-1", "my-tag-2", "my-tag-3"}
				backupPolicyPatchModel.Name = core.StringPtr("my-backup-policy")
				backupPolicyPatchModelAsPatch, asPatchErr := backupPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBackupPolicyOptions model
				updateBackupPolicyOptionsModel := new(vpcv1.UpdateBackupPolicyOptions)
				updateBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				updateBackupPolicyOptionsModel.BackupPolicyPatch = backupPolicyPatchModelAsPatch
				updateBackupPolicyOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateBackupPolicy(updateBackupPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateBackupPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BackupPolicyPatch model
				backupPolicyPatchModel := new(vpcv1.BackupPolicyPatch)
				backupPolicyPatchModel.IncludedContent = []string{"data_volumes"}
				backupPolicyPatchModel.MatchUserTags = []string{"my-tag-1", "my-tag-2", "my-tag-3"}
				backupPolicyPatchModel.Name = core.StringPtr("my-backup-policy")
				backupPolicyPatchModelAsPatch, asPatchErr := backupPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBackupPolicyOptions model
				updateBackupPolicyOptionsModel := new(vpcv1.UpdateBackupPolicyOptions)
				updateBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				updateBackupPolicyOptionsModel.BackupPolicyPatch = backupPolicyPatchModelAsPatch
				updateBackupPolicyOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateBackupPolicy(updateBackupPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateBackupPolicyOptions model with no property values
				updateBackupPolicyOptionsModelNew := new(vpcv1.UpdateBackupPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateBackupPolicy(updateBackupPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateBackupPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BackupPolicyPatch model
				backupPolicyPatchModel := new(vpcv1.BackupPolicyPatch)
				backupPolicyPatchModel.IncludedContent = []string{"data_volumes"}
				backupPolicyPatchModel.MatchUserTags = []string{"my-tag-1", "my-tag-2", "my-tag-3"}
				backupPolicyPatchModel.Name = core.StringPtr("my-backup-policy")
				backupPolicyPatchModelAsPatch, asPatchErr := backupPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBackupPolicyOptions model
				updateBackupPolicyOptionsModel := new(vpcv1.UpdateBackupPolicyOptions)
				updateBackupPolicyOptionsModel.ID = core.StringPtr("testString")
				updateBackupPolicyOptionsModel.BackupPolicyPatch = backupPolicyPatchModelAsPatch
				updateBackupPolicyOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateBackupPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateBackupPolicy(updateBackupPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBareMetalServerProfiles(listBareMetalServerProfilesOptions *ListBareMetalServerProfilesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listBareMetalServerProfilesPath := "/bare_metal_server/profiles"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerProfilesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListBareMetalServerProfiles with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerProfilesOptions model
				listBareMetalServerProfilesOptionsModel := new(vpcv1.ListBareMetalServerProfilesOptions)
				listBareMetalServerProfilesOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListBareMetalServerProfiles(listBareMetalServerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListBareMetalServerProfiles(listBareMetalServerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBareMetalServerProfiles(listBareMetalServerProfilesOptions *ListBareMetalServerProfilesOptions)`, func() {
		version := "2024-06-23"
		listBareMetalServerProfilesPath := "/bare_metal_server/profiles"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListBareMetalServerProfiles successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListBareMetalServerProfilesOptions model
				listBareMetalServerProfilesOptionsModel := new(vpcv1.ListBareMetalServerProfilesOptions)
				listBareMetalServerProfilesOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListBareMetalServerProfilesWithContext(ctx, listBareMetalServerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListBareMetalServerProfiles(listBareMetalServerProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListBareMetalServerProfilesWithContext(ctx, listBareMetalServerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListBareMetalServerProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListBareMetalServerProfiles(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListBareMetalServerProfilesOptions model
				listBareMetalServerProfilesOptionsModel := new(vpcv1.ListBareMetalServerProfilesOptions)
				listBareMetalServerProfilesOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListBareMetalServerProfiles(listBareMetalServerProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListBareMetalServerProfiles with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerProfilesOptions model
				listBareMetalServerProfilesOptionsModel := new(vpcv1.ListBareMetalServerProfilesOptions)
				listBareMetalServerProfilesOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListBareMetalServerProfiles(listBareMetalServerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListBareMetalServerProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerProfilesOptions model
				listBareMetalServerProfilesOptionsModel := new(vpcv1.ListBareMetalServerProfilesOptions)
				listBareMetalServerProfilesOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListBareMetalServerProfiles(listBareMetalServerProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.BareMetalServerProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.BareMetalServerProfileCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.BareMetalServerProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"bandwidth":{"type":"fixed","value":20000},"console_types":{"type":"enum","values":["serial"]},"cpu_architecture":{"type":"fixed","value":"amd64"},"cpu_core_count":{"type":"fixed","value":80},"cpu_socket_count":{"type":"fixed","value":4},"disks":[{"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":100},"supported_interface_types":{"default":"fcp","type":"enum","values":["fcp"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","memory":{"type":"fixed","value":16},"name":"bx2-metal-192x768","network_attachment_count":{"max":128,"min":1,"type":"range"},"network_interface_count":{"max":128,"min":1,"type":"range"},"os_architecture":{"default":"amd64","type":"enum","values":["amd64"]},"reservation_terms":{"type":"enum","values":["one_year"]},"resource_type":"bare_metal_server_profile","supported_trusted_platform_module_modes":{"default":"disabled","type":"enum","values":["disabled"]},"virtual_network_interfaces_supported":{"type":"fixed","value":false}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"profiles":[{"bandwidth":{"type":"fixed","value":20000},"console_types":{"type":"enum","values":["serial"]},"cpu_architecture":{"type":"fixed","value":"amd64"},"cpu_core_count":{"type":"fixed","value":80},"cpu_socket_count":{"type":"fixed","value":4},"disks":[{"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":100},"supported_interface_types":{"default":"fcp","type":"enum","values":["fcp"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","memory":{"type":"fixed","value":16},"name":"bx2-metal-192x768","network_attachment_count":{"max":128,"min":1,"type":"range"},"network_interface_count":{"max":128,"min":1,"type":"range"},"os_architecture":{"default":"amd64","type":"enum","values":["amd64"]},"reservation_terms":{"type":"enum","values":["one_year"]},"resource_type":"bare_metal_server_profile","supported_trusted_platform_module_modes":{"default":"disabled","type":"enum","values":["disabled"]},"virtual_network_interfaces_supported":{"type":"fixed","value":false}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use BareMetalServerProfilesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listBareMetalServerProfilesOptionsModel := &vpcv1.ListBareMetalServerProfilesOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewBareMetalServerProfilesPager(listBareMetalServerProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.BareMetalServerProfile
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use BareMetalServerProfilesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listBareMetalServerProfilesOptionsModel := &vpcv1.ListBareMetalServerProfilesOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewBareMetalServerProfilesPager(listBareMetalServerProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`GetBareMetalServerProfile(getBareMetalServerProfileOptions *GetBareMetalServerProfileOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getBareMetalServerProfilePath := "/bare_metal_server/profiles/bx2-metal-192x768"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerProfilePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetBareMetalServerProfile with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerProfileOptions model
				getBareMetalServerProfileOptionsModel := new(vpcv1.GetBareMetalServerProfileOptions)
				getBareMetalServerProfileOptionsModel.Name = core.StringPtr("bx2-metal-192x768")
				getBareMetalServerProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetBareMetalServerProfile(getBareMetalServerProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetBareMetalServerProfile(getBareMetalServerProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServerProfile(getBareMetalServerProfileOptions *GetBareMetalServerProfileOptions)`, func() {
		version := "2024-06-23"
		getBareMetalServerProfilePath := "/bare_metal_server/profiles/bx2-metal-192x768"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerProfilePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}`)
				}))
			})
			It(`Invoke GetBareMetalServerProfile successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetBareMetalServerProfileOptions model
				getBareMetalServerProfileOptionsModel := new(vpcv1.GetBareMetalServerProfileOptions)
				getBareMetalServerProfileOptionsModel.Name = core.StringPtr("bx2-metal-192x768")
				getBareMetalServerProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetBareMetalServerProfileWithContext(ctx, getBareMetalServerProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetBareMetalServerProfile(getBareMetalServerProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetBareMetalServerProfileWithContext(ctx, getBareMetalServerProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerProfilePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}`)
				}))
			})
			It(`Invoke GetBareMetalServerProfile successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetBareMetalServerProfile(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetBareMetalServerProfileOptions model
				getBareMetalServerProfileOptionsModel := new(vpcv1.GetBareMetalServerProfileOptions)
				getBareMetalServerProfileOptionsModel.Name = core.StringPtr("bx2-metal-192x768")
				getBareMetalServerProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetBareMetalServerProfile(getBareMetalServerProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetBareMetalServerProfile with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerProfileOptions model
				getBareMetalServerProfileOptionsModel := new(vpcv1.GetBareMetalServerProfileOptions)
				getBareMetalServerProfileOptionsModel.Name = core.StringPtr("bx2-metal-192x768")
				getBareMetalServerProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetBareMetalServerProfile(getBareMetalServerProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetBareMetalServerProfileOptions model with no property values
				getBareMetalServerProfileOptionsModelNew := new(vpcv1.GetBareMetalServerProfileOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetBareMetalServerProfile(getBareMetalServerProfileOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetBareMetalServerProfile successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerProfileOptions model
				getBareMetalServerProfileOptionsModel := new(vpcv1.GetBareMetalServerProfileOptions)
				getBareMetalServerProfileOptionsModel.Name = core.StringPtr("bx2-metal-192x768")
				getBareMetalServerProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetBareMetalServerProfile(getBareMetalServerProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBareMetalServers(listBareMetalServersOptions *ListBareMetalServersOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listBareMetalServersPath := "/bare_metal_servers"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServersPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["reservation.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["reservation.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}))
					Expect(req.URL.Query()["reservation.name"]).To(Equal([]string{"my-reservation"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListBareMetalServers with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServersOptions model
				listBareMetalServersOptionsModel := new(vpcv1.ListBareMetalServersOptions)
				listBareMetalServersOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServersOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.Name = core.StringPtr("my-name")
				listBareMetalServersOptionsModel.ReservationID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.ReservationCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				listBareMetalServersOptionsModel.ReservationName = core.StringPtr("my-reservation")
				listBareMetalServersOptionsModel.VPCID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listBareMetalServersOptionsModel.VPCName = core.StringPtr("my-vpc")
				listBareMetalServersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListBareMetalServers(listBareMetalServersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListBareMetalServers(listBareMetalServersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBareMetalServers(listBareMetalServersOptions *ListBareMetalServersOptions)`, func() {
		version := "2024-06-23"
		listBareMetalServersPath := "/bare_metal_servers"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServersPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["reservation.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["reservation.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}))
					Expect(req.URL.Query()["reservation.name"]).To(Equal([]string{"my-reservation"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "metadata_service": {"enabled": false, "protocol": "http"}, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListBareMetalServers successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListBareMetalServersOptions model
				listBareMetalServersOptionsModel := new(vpcv1.ListBareMetalServersOptions)
				listBareMetalServersOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServersOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.Name = core.StringPtr("my-name")
				listBareMetalServersOptionsModel.ReservationID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.ReservationCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				listBareMetalServersOptionsModel.ReservationName = core.StringPtr("my-reservation")
				listBareMetalServersOptionsModel.VPCID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listBareMetalServersOptionsModel.VPCName = core.StringPtr("my-vpc")
				listBareMetalServersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListBareMetalServersWithContext(ctx, listBareMetalServersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListBareMetalServers(listBareMetalServersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListBareMetalServersWithContext(ctx, listBareMetalServersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServersPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["reservation.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["reservation.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}))
					Expect(req.URL.Query()["reservation.name"]).To(Equal([]string{"my-reservation"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "metadata_service": {"enabled": false, "protocol": "http"}, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListBareMetalServers successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListBareMetalServers(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListBareMetalServersOptions model
				listBareMetalServersOptionsModel := new(vpcv1.ListBareMetalServersOptions)
				listBareMetalServersOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServersOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.Name = core.StringPtr("my-name")
				listBareMetalServersOptionsModel.ReservationID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.ReservationCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				listBareMetalServersOptionsModel.ReservationName = core.StringPtr("my-reservation")
				listBareMetalServersOptionsModel.VPCID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listBareMetalServersOptionsModel.VPCName = core.StringPtr("my-vpc")
				listBareMetalServersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListBareMetalServers(listBareMetalServersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListBareMetalServers with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServersOptions model
				listBareMetalServersOptionsModel := new(vpcv1.ListBareMetalServersOptions)
				listBareMetalServersOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServersOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.Name = core.StringPtr("my-name")
				listBareMetalServersOptionsModel.ReservationID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.ReservationCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				listBareMetalServersOptionsModel.ReservationName = core.StringPtr("my-reservation")
				listBareMetalServersOptionsModel.VPCID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listBareMetalServersOptionsModel.VPCName = core.StringPtr("my-vpc")
				listBareMetalServersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListBareMetalServers(listBareMetalServersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListBareMetalServers successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServersOptions model
				listBareMetalServersOptionsModel := new(vpcv1.ListBareMetalServersOptions)
				listBareMetalServersOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServersOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.Name = core.StringPtr("my-name")
				listBareMetalServersOptionsModel.ReservationID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.ReservationCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				listBareMetalServersOptionsModel.ReservationName = core.StringPtr("my-reservation")
				listBareMetalServersOptionsModel.VPCID = core.StringPtr("testString")
				listBareMetalServersOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listBareMetalServersOptionsModel.VPCName = core.StringPtr("my-vpc")
				listBareMetalServersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListBareMetalServers(listBareMetalServersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.BareMetalServerCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.BareMetalServerCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.BareMetalServerCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServersPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96","id":"0717-3744f199-6ccc-4698-8772-bb3937348c96","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","disks":[{"allowed_use":{"api_version":"2024-06-23","bare_metal_server":"enable_secure_boot == true"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96","id":"0717-3744f199-6ccc-4698-8772-bb3937348c96","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"firmware":{"update":"none"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","id":"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"metadata_service":{"enabled":false,"protocol":"http"},"name":"my-bare-metal-server","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"automatic","pool":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96","id":"0717-3744f199-6ccc-4698-8772-bb3937348c96","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","disks":[{"allowed_use":{"api_version":"2024-06-23","bare_metal_server":"enable_secure_boot == true"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96","id":"0717-3744f199-6ccc-4698-8772-bb3937348c96","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"firmware":{"update":"none"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","id":"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"metadata_service":{"enabled":false,"protocol":"http"},"name":"my-bare-metal-server","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"automatic","pool":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use BareMetalServersPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listBareMetalServersOptionsModel := &vpcv1.ListBareMetalServersOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					Name:            core.StringPtr("my-name"),
					ReservationID:   core.StringPtr("testString"),
					ReservationCRN:  core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"),
					ReservationName: core.StringPtr("my-reservation"),
					VPCID:           core.StringPtr("testString"),
					VPCCRN:          core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:         core.StringPtr("my-vpc"),
				}

				pager, err := vpcService.NewBareMetalServersPager(listBareMetalServersOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.BareMetalServer
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use BareMetalServersPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listBareMetalServersOptionsModel := &vpcv1.ListBareMetalServersOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					Name:            core.StringPtr("my-name"),
					ReservationID:   core.StringPtr("testString"),
					ReservationCRN:  core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"),
					ReservationName: core.StringPtr("my-reservation"),
					VPCID:           core.StringPtr("testString"),
					VPCCRN:          core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:         core.StringPtr("my-vpc"),
				}

				pager, err := vpcService.NewBareMetalServersPager(listBareMetalServersOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateBareMetalServer(createBareMetalServerOptions *CreateBareMetalServerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createBareMetalServerPath := "/bare_metal_servers"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBareMetalServerPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateBareMetalServer with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the BareMetalServerInitializationDefaultTrustedProfilePrototype model
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel := new(vpcv1.BareMetalServerInitializationDefaultTrustedProfilePrototype)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the BareMetalServerInitializationPrototype model
				bareMetalServerInitializationPrototypeModel := new(vpcv1.BareMetalServerInitializationPrototype)
				bareMetalServerInitializationPrototypeModel.DefaultTrustedProfile = bareMetalServerInitializationDefaultTrustedProfilePrototypeModel
				bareMetalServerInitializationPrototypeModel.Image = imageIdentityModel
				bareMetalServerInitializationPrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				bareMetalServerInitializationPrototypeModel.UserData = core.StringPtr("testString")

				// Construct an instance of the BareMetalServerMetadataServicePrototype model
				bareMetalServerMetadataServicePrototypeModel := new(vpcv1.BareMetalServerMetadataServicePrototype)
				bareMetalServerMetadataServicePrototypeModel.Enabled = core.BoolPtr(true)
				bareMetalServerMetadataServicePrototypeModel.Protocol = core.StringPtr("https")

				// Construct an instance of the BareMetalServerProfileIdentityByName model
				bareMetalServerProfileIdentityModel := new(vpcv1.BareMetalServerProfileIdentityByName)
				bareMetalServerProfileIdentityModel.Name = core.StringPtr("bx2-metal-192x768")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the BareMetalServerReservationAffinityPrototype model
				bareMetalServerReservationAffinityPrototypeModel := new(vpcv1.BareMetalServerReservationAffinityPrototype)
				bareMetalServerReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				bareMetalServerReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the BareMetalServerTrustedPlatformModulePrototype model
				bareMetalServerTrustedPlatformModulePrototypeModel := new(vpcv1.BareMetalServerTrustedPlatformModulePrototype)
				bareMetalServerTrustedPlatformModulePrototypeModel.Mode = core.StringPtr("disabled")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype model
				bareMetalServerNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype)
				bareMetalServerNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype model
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype)
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the BareMetalServerPrototypeBareMetalServerByNetworkAttachment model
				bareMetalServerPrototypeModel := new(vpcv1.BareMetalServerPrototypeBareMetalServerByNetworkAttachment)
				bareMetalServerPrototypeModel.Bandwidth = core.Int64Ptr(int64(20000))
				bareMetalServerPrototypeModel.EnableSecureBoot = core.BoolPtr(false)
				bareMetalServerPrototypeModel.Initialization = bareMetalServerInitializationPrototypeModel
				bareMetalServerPrototypeModel.MetadataService = bareMetalServerMetadataServicePrototypeModel
				bareMetalServerPrototypeModel.Name = core.StringPtr("my-bare-metal-server")
				bareMetalServerPrototypeModel.Profile = bareMetalServerProfileIdentityModel
				bareMetalServerPrototypeModel.ReservationAffinity = bareMetalServerReservationAffinityPrototypeModel
				bareMetalServerPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerPrototypeModel.TrustedPlatformModule = bareMetalServerTrustedPlatformModulePrototypeModel
				bareMetalServerPrototypeModel.VPC = vpcIdentityModel
				bareMetalServerPrototypeModel.Zone = zoneIdentityModel
				bareMetalServerPrototypeModel.NetworkAttachments = []vpcv1.BareMetalServerNetworkAttachmentPrototypeIntf{bareMetalServerNetworkAttachmentPrototypeModel}
				bareMetalServerPrototypeModel.PrimaryNetworkAttachment = bareMetalServerPrimaryNetworkAttachmentPrototypeModel

				// Construct an instance of the CreateBareMetalServerOptions model
				createBareMetalServerOptionsModel := new(vpcv1.CreateBareMetalServerOptions)
				createBareMetalServerOptionsModel.BareMetalServerPrototype = bareMetalServerPrototypeModel
				createBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateBareMetalServer(createBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateBareMetalServer(createBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateBareMetalServer(createBareMetalServerOptions *CreateBareMetalServerOptions)`, func() {
		version := "2024-06-23"
		createBareMetalServerPath := "/bare_metal_servers"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBareMetalServerPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "metadata_service": {"enabled": false, "protocol": "http"}, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateBareMetalServer successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the BareMetalServerInitializationDefaultTrustedProfilePrototype model
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel := new(vpcv1.BareMetalServerInitializationDefaultTrustedProfilePrototype)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the BareMetalServerInitializationPrototype model
				bareMetalServerInitializationPrototypeModel := new(vpcv1.BareMetalServerInitializationPrototype)
				bareMetalServerInitializationPrototypeModel.DefaultTrustedProfile = bareMetalServerInitializationDefaultTrustedProfilePrototypeModel
				bareMetalServerInitializationPrototypeModel.Image = imageIdentityModel
				bareMetalServerInitializationPrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				bareMetalServerInitializationPrototypeModel.UserData = core.StringPtr("testString")

				// Construct an instance of the BareMetalServerMetadataServicePrototype model
				bareMetalServerMetadataServicePrototypeModel := new(vpcv1.BareMetalServerMetadataServicePrototype)
				bareMetalServerMetadataServicePrototypeModel.Enabled = core.BoolPtr(true)
				bareMetalServerMetadataServicePrototypeModel.Protocol = core.StringPtr("https")

				// Construct an instance of the BareMetalServerProfileIdentityByName model
				bareMetalServerProfileIdentityModel := new(vpcv1.BareMetalServerProfileIdentityByName)
				bareMetalServerProfileIdentityModel.Name = core.StringPtr("bx2-metal-192x768")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the BareMetalServerReservationAffinityPrototype model
				bareMetalServerReservationAffinityPrototypeModel := new(vpcv1.BareMetalServerReservationAffinityPrototype)
				bareMetalServerReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				bareMetalServerReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the BareMetalServerTrustedPlatformModulePrototype model
				bareMetalServerTrustedPlatformModulePrototypeModel := new(vpcv1.BareMetalServerTrustedPlatformModulePrototype)
				bareMetalServerTrustedPlatformModulePrototypeModel.Mode = core.StringPtr("disabled")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype model
				bareMetalServerNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype)
				bareMetalServerNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype model
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype)
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the BareMetalServerPrototypeBareMetalServerByNetworkAttachment model
				bareMetalServerPrototypeModel := new(vpcv1.BareMetalServerPrototypeBareMetalServerByNetworkAttachment)
				bareMetalServerPrototypeModel.Bandwidth = core.Int64Ptr(int64(20000))
				bareMetalServerPrototypeModel.EnableSecureBoot = core.BoolPtr(false)
				bareMetalServerPrototypeModel.Initialization = bareMetalServerInitializationPrototypeModel
				bareMetalServerPrototypeModel.MetadataService = bareMetalServerMetadataServicePrototypeModel
				bareMetalServerPrototypeModel.Name = core.StringPtr("my-bare-metal-server")
				bareMetalServerPrototypeModel.Profile = bareMetalServerProfileIdentityModel
				bareMetalServerPrototypeModel.ReservationAffinity = bareMetalServerReservationAffinityPrototypeModel
				bareMetalServerPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerPrototypeModel.TrustedPlatformModule = bareMetalServerTrustedPlatformModulePrototypeModel
				bareMetalServerPrototypeModel.VPC = vpcIdentityModel
				bareMetalServerPrototypeModel.Zone = zoneIdentityModel
				bareMetalServerPrototypeModel.NetworkAttachments = []vpcv1.BareMetalServerNetworkAttachmentPrototypeIntf{bareMetalServerNetworkAttachmentPrototypeModel}
				bareMetalServerPrototypeModel.PrimaryNetworkAttachment = bareMetalServerPrimaryNetworkAttachmentPrototypeModel

				// Construct an instance of the CreateBareMetalServerOptions model
				createBareMetalServerOptionsModel := new(vpcv1.CreateBareMetalServerOptions)
				createBareMetalServerOptionsModel.BareMetalServerPrototype = bareMetalServerPrototypeModel
				createBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateBareMetalServerWithContext(ctx, createBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateBareMetalServer(createBareMetalServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateBareMetalServerWithContext(ctx, createBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBareMetalServerPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "metadata_service": {"enabled": false, "protocol": "http"}, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateBareMetalServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateBareMetalServer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the BareMetalServerInitializationDefaultTrustedProfilePrototype model
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel := new(vpcv1.BareMetalServerInitializationDefaultTrustedProfilePrototype)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the BareMetalServerInitializationPrototype model
				bareMetalServerInitializationPrototypeModel := new(vpcv1.BareMetalServerInitializationPrototype)
				bareMetalServerInitializationPrototypeModel.DefaultTrustedProfile = bareMetalServerInitializationDefaultTrustedProfilePrototypeModel
				bareMetalServerInitializationPrototypeModel.Image = imageIdentityModel
				bareMetalServerInitializationPrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				bareMetalServerInitializationPrototypeModel.UserData = core.StringPtr("testString")

				// Construct an instance of the BareMetalServerMetadataServicePrototype model
				bareMetalServerMetadataServicePrototypeModel := new(vpcv1.BareMetalServerMetadataServicePrototype)
				bareMetalServerMetadataServicePrototypeModel.Enabled = core.BoolPtr(true)
				bareMetalServerMetadataServicePrototypeModel.Protocol = core.StringPtr("https")

				// Construct an instance of the BareMetalServerProfileIdentityByName model
				bareMetalServerProfileIdentityModel := new(vpcv1.BareMetalServerProfileIdentityByName)
				bareMetalServerProfileIdentityModel.Name = core.StringPtr("bx2-metal-192x768")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the BareMetalServerReservationAffinityPrototype model
				bareMetalServerReservationAffinityPrototypeModel := new(vpcv1.BareMetalServerReservationAffinityPrototype)
				bareMetalServerReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				bareMetalServerReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the BareMetalServerTrustedPlatformModulePrototype model
				bareMetalServerTrustedPlatformModulePrototypeModel := new(vpcv1.BareMetalServerTrustedPlatformModulePrototype)
				bareMetalServerTrustedPlatformModulePrototypeModel.Mode = core.StringPtr("disabled")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype model
				bareMetalServerNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype)
				bareMetalServerNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype model
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype)
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the BareMetalServerPrototypeBareMetalServerByNetworkAttachment model
				bareMetalServerPrototypeModel := new(vpcv1.BareMetalServerPrototypeBareMetalServerByNetworkAttachment)
				bareMetalServerPrototypeModel.Bandwidth = core.Int64Ptr(int64(20000))
				bareMetalServerPrototypeModel.EnableSecureBoot = core.BoolPtr(false)
				bareMetalServerPrototypeModel.Initialization = bareMetalServerInitializationPrototypeModel
				bareMetalServerPrototypeModel.MetadataService = bareMetalServerMetadataServicePrototypeModel
				bareMetalServerPrototypeModel.Name = core.StringPtr("my-bare-metal-server")
				bareMetalServerPrototypeModel.Profile = bareMetalServerProfileIdentityModel
				bareMetalServerPrototypeModel.ReservationAffinity = bareMetalServerReservationAffinityPrototypeModel
				bareMetalServerPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerPrototypeModel.TrustedPlatformModule = bareMetalServerTrustedPlatformModulePrototypeModel
				bareMetalServerPrototypeModel.VPC = vpcIdentityModel
				bareMetalServerPrototypeModel.Zone = zoneIdentityModel
				bareMetalServerPrototypeModel.NetworkAttachments = []vpcv1.BareMetalServerNetworkAttachmentPrototypeIntf{bareMetalServerNetworkAttachmentPrototypeModel}
				bareMetalServerPrototypeModel.PrimaryNetworkAttachment = bareMetalServerPrimaryNetworkAttachmentPrototypeModel

				// Construct an instance of the CreateBareMetalServerOptions model
				createBareMetalServerOptionsModel := new(vpcv1.CreateBareMetalServerOptions)
				createBareMetalServerOptionsModel.BareMetalServerPrototype = bareMetalServerPrototypeModel
				createBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateBareMetalServer(createBareMetalServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateBareMetalServer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the BareMetalServerInitializationDefaultTrustedProfilePrototype model
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel := new(vpcv1.BareMetalServerInitializationDefaultTrustedProfilePrototype)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the BareMetalServerInitializationPrototype model
				bareMetalServerInitializationPrototypeModel := new(vpcv1.BareMetalServerInitializationPrototype)
				bareMetalServerInitializationPrototypeModel.DefaultTrustedProfile = bareMetalServerInitializationDefaultTrustedProfilePrototypeModel
				bareMetalServerInitializationPrototypeModel.Image = imageIdentityModel
				bareMetalServerInitializationPrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				bareMetalServerInitializationPrototypeModel.UserData = core.StringPtr("testString")

				// Construct an instance of the BareMetalServerMetadataServicePrototype model
				bareMetalServerMetadataServicePrototypeModel := new(vpcv1.BareMetalServerMetadataServicePrototype)
				bareMetalServerMetadataServicePrototypeModel.Enabled = core.BoolPtr(true)
				bareMetalServerMetadataServicePrototypeModel.Protocol = core.StringPtr("https")

				// Construct an instance of the BareMetalServerProfileIdentityByName model
				bareMetalServerProfileIdentityModel := new(vpcv1.BareMetalServerProfileIdentityByName)
				bareMetalServerProfileIdentityModel.Name = core.StringPtr("bx2-metal-192x768")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the BareMetalServerReservationAffinityPrototype model
				bareMetalServerReservationAffinityPrototypeModel := new(vpcv1.BareMetalServerReservationAffinityPrototype)
				bareMetalServerReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				bareMetalServerReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the BareMetalServerTrustedPlatformModulePrototype model
				bareMetalServerTrustedPlatformModulePrototypeModel := new(vpcv1.BareMetalServerTrustedPlatformModulePrototype)
				bareMetalServerTrustedPlatformModulePrototypeModel.Mode = core.StringPtr("disabled")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype model
				bareMetalServerNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype)
				bareMetalServerNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype model
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype)
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the BareMetalServerPrototypeBareMetalServerByNetworkAttachment model
				bareMetalServerPrototypeModel := new(vpcv1.BareMetalServerPrototypeBareMetalServerByNetworkAttachment)
				bareMetalServerPrototypeModel.Bandwidth = core.Int64Ptr(int64(20000))
				bareMetalServerPrototypeModel.EnableSecureBoot = core.BoolPtr(false)
				bareMetalServerPrototypeModel.Initialization = bareMetalServerInitializationPrototypeModel
				bareMetalServerPrototypeModel.MetadataService = bareMetalServerMetadataServicePrototypeModel
				bareMetalServerPrototypeModel.Name = core.StringPtr("my-bare-metal-server")
				bareMetalServerPrototypeModel.Profile = bareMetalServerProfileIdentityModel
				bareMetalServerPrototypeModel.ReservationAffinity = bareMetalServerReservationAffinityPrototypeModel
				bareMetalServerPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerPrototypeModel.TrustedPlatformModule = bareMetalServerTrustedPlatformModulePrototypeModel
				bareMetalServerPrototypeModel.VPC = vpcIdentityModel
				bareMetalServerPrototypeModel.Zone = zoneIdentityModel
				bareMetalServerPrototypeModel.NetworkAttachments = []vpcv1.BareMetalServerNetworkAttachmentPrototypeIntf{bareMetalServerNetworkAttachmentPrototypeModel}
				bareMetalServerPrototypeModel.PrimaryNetworkAttachment = bareMetalServerPrimaryNetworkAttachmentPrototypeModel

				// Construct an instance of the CreateBareMetalServerOptions model
				createBareMetalServerOptionsModel := new(vpcv1.CreateBareMetalServerOptions)
				createBareMetalServerOptionsModel.BareMetalServerPrototype = bareMetalServerPrototypeModel
				createBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateBareMetalServer(createBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateBareMetalServerOptions model with no property values
				createBareMetalServerOptionsModelNew := new(vpcv1.CreateBareMetalServerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateBareMetalServer(createBareMetalServerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateBareMetalServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the BareMetalServerInitializationDefaultTrustedProfilePrototype model
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel := new(vpcv1.BareMetalServerInitializationDefaultTrustedProfilePrototype)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the BareMetalServerInitializationPrototype model
				bareMetalServerInitializationPrototypeModel := new(vpcv1.BareMetalServerInitializationPrototype)
				bareMetalServerInitializationPrototypeModel.DefaultTrustedProfile = bareMetalServerInitializationDefaultTrustedProfilePrototypeModel
				bareMetalServerInitializationPrototypeModel.Image = imageIdentityModel
				bareMetalServerInitializationPrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				bareMetalServerInitializationPrototypeModel.UserData = core.StringPtr("testString")

				// Construct an instance of the BareMetalServerMetadataServicePrototype model
				bareMetalServerMetadataServicePrototypeModel := new(vpcv1.BareMetalServerMetadataServicePrototype)
				bareMetalServerMetadataServicePrototypeModel.Enabled = core.BoolPtr(true)
				bareMetalServerMetadataServicePrototypeModel.Protocol = core.StringPtr("https")

				// Construct an instance of the BareMetalServerProfileIdentityByName model
				bareMetalServerProfileIdentityModel := new(vpcv1.BareMetalServerProfileIdentityByName)
				bareMetalServerProfileIdentityModel.Name = core.StringPtr("bx2-metal-192x768")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the BareMetalServerReservationAffinityPrototype model
				bareMetalServerReservationAffinityPrototypeModel := new(vpcv1.BareMetalServerReservationAffinityPrototype)
				bareMetalServerReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				bareMetalServerReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the BareMetalServerTrustedPlatformModulePrototype model
				bareMetalServerTrustedPlatformModulePrototypeModel := new(vpcv1.BareMetalServerTrustedPlatformModulePrototype)
				bareMetalServerTrustedPlatformModulePrototypeModel.Mode = core.StringPtr("disabled")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype model
				bareMetalServerNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype)
				bareMetalServerNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype model
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype)
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the BareMetalServerPrototypeBareMetalServerByNetworkAttachment model
				bareMetalServerPrototypeModel := new(vpcv1.BareMetalServerPrototypeBareMetalServerByNetworkAttachment)
				bareMetalServerPrototypeModel.Bandwidth = core.Int64Ptr(int64(20000))
				bareMetalServerPrototypeModel.EnableSecureBoot = core.BoolPtr(false)
				bareMetalServerPrototypeModel.Initialization = bareMetalServerInitializationPrototypeModel
				bareMetalServerPrototypeModel.MetadataService = bareMetalServerMetadataServicePrototypeModel
				bareMetalServerPrototypeModel.Name = core.StringPtr("my-bare-metal-server")
				bareMetalServerPrototypeModel.Profile = bareMetalServerProfileIdentityModel
				bareMetalServerPrototypeModel.ReservationAffinity = bareMetalServerReservationAffinityPrototypeModel
				bareMetalServerPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerPrototypeModel.TrustedPlatformModule = bareMetalServerTrustedPlatformModulePrototypeModel
				bareMetalServerPrototypeModel.VPC = vpcIdentityModel
				bareMetalServerPrototypeModel.Zone = zoneIdentityModel
				bareMetalServerPrototypeModel.NetworkAttachments = []vpcv1.BareMetalServerNetworkAttachmentPrototypeIntf{bareMetalServerNetworkAttachmentPrototypeModel}
				bareMetalServerPrototypeModel.PrimaryNetworkAttachment = bareMetalServerPrimaryNetworkAttachmentPrototypeModel

				// Construct an instance of the CreateBareMetalServerOptions model
				createBareMetalServerOptionsModel := new(vpcv1.CreateBareMetalServerOptions)
				createBareMetalServerOptionsModel.BareMetalServerPrototype = bareMetalServerPrototypeModel
				createBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateBareMetalServer(createBareMetalServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptions *CreateBareMetalServerConsoleAccessTokenOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createBareMetalServerConsoleAccessTokenPath := "/bare_metal_servers/testString/console_access_token"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBareMetalServerConsoleAccessTokenPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateBareMetalServerConsoleAccessToken with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateBareMetalServerConsoleAccessTokenOptions model
				createBareMetalServerConsoleAccessTokenOptionsModel := new(vpcv1.CreateBareMetalServerConsoleAccessTokenOptions)
				createBareMetalServerConsoleAccessTokenOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerConsoleAccessTokenOptionsModel.ConsoleType = core.StringPtr("serial")
				createBareMetalServerConsoleAccessTokenOptionsModel.Force = core.BoolPtr(false)
				createBareMetalServerConsoleAccessTokenOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptions *CreateBareMetalServerConsoleAccessTokenOptions)`, func() {
		version := "2024-06-23"
		createBareMetalServerConsoleAccessTokenPath := "/bare_metal_servers/testString/console_access_token"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBareMetalServerConsoleAccessTokenPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI"}`)
				}))
			})
			It(`Invoke CreateBareMetalServerConsoleAccessToken successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the CreateBareMetalServerConsoleAccessTokenOptions model
				createBareMetalServerConsoleAccessTokenOptionsModel := new(vpcv1.CreateBareMetalServerConsoleAccessTokenOptions)
				createBareMetalServerConsoleAccessTokenOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerConsoleAccessTokenOptionsModel.ConsoleType = core.StringPtr("serial")
				createBareMetalServerConsoleAccessTokenOptionsModel.Force = core.BoolPtr(false)
				createBareMetalServerConsoleAccessTokenOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateBareMetalServerConsoleAccessTokenWithContext(ctx, createBareMetalServerConsoleAccessTokenOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateBareMetalServerConsoleAccessTokenWithContext(ctx, createBareMetalServerConsoleAccessTokenOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBareMetalServerConsoleAccessTokenPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI"}`)
				}))
			})
			It(`Invoke CreateBareMetalServerConsoleAccessToken successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateBareMetalServerConsoleAccessToken(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the CreateBareMetalServerConsoleAccessTokenOptions model
				createBareMetalServerConsoleAccessTokenOptionsModel := new(vpcv1.CreateBareMetalServerConsoleAccessTokenOptions)
				createBareMetalServerConsoleAccessTokenOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerConsoleAccessTokenOptionsModel.ConsoleType = core.StringPtr("serial")
				createBareMetalServerConsoleAccessTokenOptionsModel.Force = core.BoolPtr(false)
				createBareMetalServerConsoleAccessTokenOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateBareMetalServerConsoleAccessToken with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateBareMetalServerConsoleAccessTokenOptions model
				createBareMetalServerConsoleAccessTokenOptionsModel := new(vpcv1.CreateBareMetalServerConsoleAccessTokenOptions)
				createBareMetalServerConsoleAccessTokenOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerConsoleAccessTokenOptionsModel.ConsoleType = core.StringPtr("serial")
				createBareMetalServerConsoleAccessTokenOptionsModel.Force = core.BoolPtr(false)
				createBareMetalServerConsoleAccessTokenOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateBareMetalServerConsoleAccessTokenOptions model with no property values
				createBareMetalServerConsoleAccessTokenOptionsModelNew := new(vpcv1.CreateBareMetalServerConsoleAccessTokenOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke CreateBareMetalServerConsoleAccessToken successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateBareMetalServerConsoleAccessTokenOptions model
				createBareMetalServerConsoleAccessTokenOptionsModel := new(vpcv1.CreateBareMetalServerConsoleAccessTokenOptions)
				createBareMetalServerConsoleAccessTokenOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerConsoleAccessTokenOptionsModel.ConsoleType = core.StringPtr("serial")
				createBareMetalServerConsoleAccessTokenOptionsModel.Force = core.BoolPtr(false)
				createBareMetalServerConsoleAccessTokenOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBareMetalServerDisks(listBareMetalServerDisksOptions *ListBareMetalServerDisksOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listBareMetalServerDisksPath := "/bare_metal_servers/testString/disks"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerDisksPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListBareMetalServerDisks with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerDisksOptions model
				listBareMetalServerDisksOptionsModel := new(vpcv1.ListBareMetalServerDisksOptions)
				listBareMetalServerDisksOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListBareMetalServerDisks(listBareMetalServerDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListBareMetalServerDisks(listBareMetalServerDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBareMetalServerDisks(listBareMetalServerDisksOptions *ListBareMetalServerDisksOptions)`, func() {
		version := "2024-06-23"
		listBareMetalServerDisksPath := "/bare_metal_servers/testString/disks"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerDisksPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"disks": [{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}`)
				}))
			})
			It(`Invoke ListBareMetalServerDisks successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListBareMetalServerDisksOptions model
				listBareMetalServerDisksOptionsModel := new(vpcv1.ListBareMetalServerDisksOptions)
				listBareMetalServerDisksOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListBareMetalServerDisksWithContext(ctx, listBareMetalServerDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListBareMetalServerDisks(listBareMetalServerDisksOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListBareMetalServerDisksWithContext(ctx, listBareMetalServerDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerDisksPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"disks": [{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}`)
				}))
			})
			It(`Invoke ListBareMetalServerDisks successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListBareMetalServerDisks(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListBareMetalServerDisksOptions model
				listBareMetalServerDisksOptionsModel := new(vpcv1.ListBareMetalServerDisksOptions)
				listBareMetalServerDisksOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListBareMetalServerDisks(listBareMetalServerDisksOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListBareMetalServerDisks with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerDisksOptions model
				listBareMetalServerDisksOptionsModel := new(vpcv1.ListBareMetalServerDisksOptions)
				listBareMetalServerDisksOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListBareMetalServerDisks(listBareMetalServerDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListBareMetalServerDisksOptions model with no property values
				listBareMetalServerDisksOptionsModelNew := new(vpcv1.ListBareMetalServerDisksOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListBareMetalServerDisks(listBareMetalServerDisksOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListBareMetalServerDisks successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerDisksOptions model
				listBareMetalServerDisksOptionsModel := new(vpcv1.ListBareMetalServerDisksOptions)
				listBareMetalServerDisksOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListBareMetalServerDisks(listBareMetalServerDisksOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServerDisk(getBareMetalServerDiskOptions *GetBareMetalServerDiskOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getBareMetalServerDiskPath := "/bare_metal_servers/testString/disks/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerDiskPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetBareMetalServerDisk with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerDiskOptions model
				getBareMetalServerDiskOptionsModel := new(vpcv1.GetBareMetalServerDiskOptions)
				getBareMetalServerDiskOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerDiskOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetBareMetalServerDisk(getBareMetalServerDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetBareMetalServerDisk(getBareMetalServerDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServerDisk(getBareMetalServerDiskOptions *GetBareMetalServerDiskOptions)`, func() {
		version := "2024-06-23"
		getBareMetalServerDiskPath := "/bare_metal_servers/testString/disks/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerDiskPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}`)
				}))
			})
			It(`Invoke GetBareMetalServerDisk successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetBareMetalServerDiskOptions model
				getBareMetalServerDiskOptionsModel := new(vpcv1.GetBareMetalServerDiskOptions)
				getBareMetalServerDiskOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerDiskOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetBareMetalServerDiskWithContext(ctx, getBareMetalServerDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetBareMetalServerDisk(getBareMetalServerDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetBareMetalServerDiskWithContext(ctx, getBareMetalServerDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerDiskPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}`)
				}))
			})
			It(`Invoke GetBareMetalServerDisk successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetBareMetalServerDisk(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetBareMetalServerDiskOptions model
				getBareMetalServerDiskOptionsModel := new(vpcv1.GetBareMetalServerDiskOptions)
				getBareMetalServerDiskOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerDiskOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetBareMetalServerDisk(getBareMetalServerDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetBareMetalServerDisk with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerDiskOptions model
				getBareMetalServerDiskOptionsModel := new(vpcv1.GetBareMetalServerDiskOptions)
				getBareMetalServerDiskOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerDiskOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetBareMetalServerDisk(getBareMetalServerDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetBareMetalServerDiskOptions model with no property values
				getBareMetalServerDiskOptionsModelNew := new(vpcv1.GetBareMetalServerDiskOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetBareMetalServerDisk(getBareMetalServerDiskOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetBareMetalServerDisk successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerDiskOptions model
				getBareMetalServerDiskOptionsModel := new(vpcv1.GetBareMetalServerDiskOptions)
				getBareMetalServerDiskOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerDiskOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetBareMetalServerDisk(getBareMetalServerDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateBareMetalServerDisk(updateBareMetalServerDiskOptions *UpdateBareMetalServerDiskOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateBareMetalServerDiskPath := "/bare_metal_servers/testString/disks/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBareMetalServerDiskPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateBareMetalServerDisk with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BareMetalServerDiskPatch model
				bareMetalServerDiskPatchModel := new(vpcv1.BareMetalServerDiskPatch)
				bareMetalServerDiskPatchModel.Name = core.StringPtr("my-bare-metal-server-disk-updated")
				bareMetalServerDiskPatchModelAsPatch, asPatchErr := bareMetalServerDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerDiskOptions model
				updateBareMetalServerDiskOptionsModel := new(vpcv1.UpdateBareMetalServerDiskOptions)
				updateBareMetalServerDiskOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerDiskOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerDiskOptionsModel.BareMetalServerDiskPatch = bareMetalServerDiskPatchModelAsPatch
				updateBareMetalServerDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateBareMetalServerDisk(updateBareMetalServerDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateBareMetalServerDisk(updateBareMetalServerDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateBareMetalServerDisk(updateBareMetalServerDiskOptions *UpdateBareMetalServerDiskOptions)`, func() {
		version := "2024-06-23"
		updateBareMetalServerDiskPath := "/bare_metal_servers/testString/disks/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBareMetalServerDiskPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}`)
				}))
			})
			It(`Invoke UpdateBareMetalServerDisk successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the BareMetalServerDiskPatch model
				bareMetalServerDiskPatchModel := new(vpcv1.BareMetalServerDiskPatch)
				bareMetalServerDiskPatchModel.Name = core.StringPtr("my-bare-metal-server-disk-updated")
				bareMetalServerDiskPatchModelAsPatch, asPatchErr := bareMetalServerDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerDiskOptions model
				updateBareMetalServerDiskOptionsModel := new(vpcv1.UpdateBareMetalServerDiskOptions)
				updateBareMetalServerDiskOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerDiskOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerDiskOptionsModel.BareMetalServerDiskPatch = bareMetalServerDiskPatchModelAsPatch
				updateBareMetalServerDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateBareMetalServerDiskWithContext(ctx, updateBareMetalServerDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateBareMetalServerDisk(updateBareMetalServerDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateBareMetalServerDiskWithContext(ctx, updateBareMetalServerDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBareMetalServerDiskPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}`)
				}))
			})
			It(`Invoke UpdateBareMetalServerDisk successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateBareMetalServerDisk(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the BareMetalServerDiskPatch model
				bareMetalServerDiskPatchModel := new(vpcv1.BareMetalServerDiskPatch)
				bareMetalServerDiskPatchModel.Name = core.StringPtr("my-bare-metal-server-disk-updated")
				bareMetalServerDiskPatchModelAsPatch, asPatchErr := bareMetalServerDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerDiskOptions model
				updateBareMetalServerDiskOptionsModel := new(vpcv1.UpdateBareMetalServerDiskOptions)
				updateBareMetalServerDiskOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerDiskOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerDiskOptionsModel.BareMetalServerDiskPatch = bareMetalServerDiskPatchModelAsPatch
				updateBareMetalServerDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateBareMetalServerDisk(updateBareMetalServerDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateBareMetalServerDisk with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BareMetalServerDiskPatch model
				bareMetalServerDiskPatchModel := new(vpcv1.BareMetalServerDiskPatch)
				bareMetalServerDiskPatchModel.Name = core.StringPtr("my-bare-metal-server-disk-updated")
				bareMetalServerDiskPatchModelAsPatch, asPatchErr := bareMetalServerDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerDiskOptions model
				updateBareMetalServerDiskOptionsModel := new(vpcv1.UpdateBareMetalServerDiskOptions)
				updateBareMetalServerDiskOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerDiskOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerDiskOptionsModel.BareMetalServerDiskPatch = bareMetalServerDiskPatchModelAsPatch
				updateBareMetalServerDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateBareMetalServerDisk(updateBareMetalServerDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateBareMetalServerDiskOptions model with no property values
				updateBareMetalServerDiskOptionsModelNew := new(vpcv1.UpdateBareMetalServerDiskOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateBareMetalServerDisk(updateBareMetalServerDiskOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateBareMetalServerDisk successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BareMetalServerDiskPatch model
				bareMetalServerDiskPatchModel := new(vpcv1.BareMetalServerDiskPatch)
				bareMetalServerDiskPatchModel.Name = core.StringPtr("my-bare-metal-server-disk-updated")
				bareMetalServerDiskPatchModelAsPatch, asPatchErr := bareMetalServerDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerDiskOptions model
				updateBareMetalServerDiskOptionsModel := new(vpcv1.UpdateBareMetalServerDiskOptions)
				updateBareMetalServerDiskOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerDiskOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerDiskOptionsModel.BareMetalServerDiskPatch = bareMetalServerDiskPatchModelAsPatch
				updateBareMetalServerDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateBareMetalServerDisk(updateBareMetalServerDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptions *ListBareMetalServerNetworkAttachmentsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listBareMetalServerNetworkAttachmentsPath := "/bare_metal_servers/testString/network_attachments"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerNetworkAttachmentsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkAttachments with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkAttachmentsOptions model
				listBareMetalServerNetworkAttachmentsOptionsModel := new(vpcv1.ListBareMetalServerNetworkAttachmentsOptions)
				listBareMetalServerNetworkAttachmentsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkAttachmentsOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerNetworkAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptions *ListBareMetalServerNetworkAttachmentsOptions)`, func() {
		version := "2024-06-23"
		listBareMetalServerNetworkAttachmentsPath := "/bare_metal_servers/testString/network_attachments"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerNetworkAttachmentsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}], "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkAttachments successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListBareMetalServerNetworkAttachmentsOptions model
				listBareMetalServerNetworkAttachmentsOptionsModel := new(vpcv1.ListBareMetalServerNetworkAttachmentsOptions)
				listBareMetalServerNetworkAttachmentsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkAttachmentsOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerNetworkAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListBareMetalServerNetworkAttachmentsWithContext(ctx, listBareMetalServerNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListBareMetalServerNetworkAttachmentsWithContext(ctx, listBareMetalServerNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerNetworkAttachmentsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}], "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkAttachments successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListBareMetalServerNetworkAttachments(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkAttachmentsOptions model
				listBareMetalServerNetworkAttachmentsOptionsModel := new(vpcv1.ListBareMetalServerNetworkAttachmentsOptions)
				listBareMetalServerNetworkAttachmentsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkAttachmentsOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerNetworkAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListBareMetalServerNetworkAttachments with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkAttachmentsOptions model
				listBareMetalServerNetworkAttachmentsOptionsModel := new(vpcv1.ListBareMetalServerNetworkAttachmentsOptions)
				listBareMetalServerNetworkAttachmentsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkAttachmentsOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerNetworkAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListBareMetalServerNetworkAttachmentsOptions model with no property values
				listBareMetalServerNetworkAttachmentsOptionsModelNew := new(vpcv1.ListBareMetalServerNetworkAttachmentsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkAttachments successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkAttachmentsOptions model
				listBareMetalServerNetworkAttachmentsOptionsModel := new(vpcv1.ListBareMetalServerNetworkAttachmentsOptions)
				listBareMetalServerNetworkAttachmentsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkAttachmentsOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerNetworkAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.BareMetalServerNetworkAttachmentCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.BareMetalServerNetworkAttachmentCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.BareMetalServerNetworkAttachmentCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerNetworkAttachmentsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_attachments":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","lifecycle_state":"stable","name":"my-bare-metal-server-network-attachment","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"allowed_vlans":[4],"interface_type":"pci"}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"network_attachments":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","lifecycle_state":"stable","name":"my-bare-metal-server-network-attachment","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"allowed_vlans":[4],"interface_type":"pci"}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use BareMetalServerNetworkAttachmentsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listBareMetalServerNetworkAttachmentsOptionsModel := &vpcv1.ListBareMetalServerNetworkAttachmentsOptions{
					BareMetalServerID: core.StringPtr("testString"),
					Limit:             core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewBareMetalServerNetworkAttachmentsPager(listBareMetalServerNetworkAttachmentsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.BareMetalServerNetworkAttachmentIntf
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use BareMetalServerNetworkAttachmentsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listBareMetalServerNetworkAttachmentsOptionsModel := &vpcv1.ListBareMetalServerNetworkAttachmentsOptions{
					BareMetalServerID: core.StringPtr("testString"),
					Limit:             core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewBareMetalServerNetworkAttachmentsPager(listBareMetalServerNetworkAttachmentsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptions *CreateBareMetalServerNetworkAttachmentOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createBareMetalServerNetworkAttachmentPath := "/bare_metal_servers/testString/network_attachments"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBareMetalServerNetworkAttachmentPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateBareMetalServerNetworkAttachment with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype model
				bareMetalServerNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype)
				bareMetalServerNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the CreateBareMetalServerNetworkAttachmentOptions model
				createBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.CreateBareMetalServerNetworkAttachmentOptions)
				createBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerNetworkAttachmentPrototype = bareMetalServerNetworkAttachmentPrototypeModel
				createBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptions *CreateBareMetalServerNetworkAttachmentOptions)`, func() {
		version := "2024-06-23"
		createBareMetalServerNetworkAttachmentPath := "/bare_metal_servers/testString/network_attachments"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBareMetalServerNetworkAttachmentPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}`)
				}))
			})
			It(`Invoke CreateBareMetalServerNetworkAttachment successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype model
				bareMetalServerNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype)
				bareMetalServerNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the CreateBareMetalServerNetworkAttachmentOptions model
				createBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.CreateBareMetalServerNetworkAttachmentOptions)
				createBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerNetworkAttachmentPrototype = bareMetalServerNetworkAttachmentPrototypeModel
				createBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateBareMetalServerNetworkAttachmentWithContext(ctx, createBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateBareMetalServerNetworkAttachmentWithContext(ctx, createBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBareMetalServerNetworkAttachmentPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}`)
				}))
			})
			It(`Invoke CreateBareMetalServerNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateBareMetalServerNetworkAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype model
				bareMetalServerNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype)
				bareMetalServerNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the CreateBareMetalServerNetworkAttachmentOptions model
				createBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.CreateBareMetalServerNetworkAttachmentOptions)
				createBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerNetworkAttachmentPrototype = bareMetalServerNetworkAttachmentPrototypeModel
				createBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateBareMetalServerNetworkAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype model
				bareMetalServerNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype)
				bareMetalServerNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the CreateBareMetalServerNetworkAttachmentOptions model
				createBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.CreateBareMetalServerNetworkAttachmentOptions)
				createBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerNetworkAttachmentPrototype = bareMetalServerNetworkAttachmentPrototypeModel
				createBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateBareMetalServerNetworkAttachmentOptions model with no property values
				createBareMetalServerNetworkAttachmentOptionsModelNew := new(vpcv1.CreateBareMetalServerNetworkAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateBareMetalServerNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype model
				bareMetalServerNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype)
				bareMetalServerNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")

				// Construct an instance of the CreateBareMetalServerNetworkAttachmentOptions model
				createBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.CreateBareMetalServerNetworkAttachmentOptions)
				createBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerNetworkAttachmentPrototype = bareMetalServerNetworkAttachmentPrototypeModel
				createBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteBareMetalServerNetworkAttachment(deleteBareMetalServerNetworkAttachmentOptions *DeleteBareMetalServerNetworkAttachmentOptions)`, func() {
		version := "2024-06-23"
		deleteBareMetalServerNetworkAttachmentPath := "/bare_metal_servers/testString/network_attachments/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteBareMetalServerNetworkAttachmentPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteBareMetalServerNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteBareMetalServerNetworkAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteBareMetalServerNetworkAttachmentOptions model
				deleteBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.DeleteBareMetalServerNetworkAttachmentOptions)
				deleteBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				deleteBareMetalServerNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				deleteBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteBareMetalServerNetworkAttachment(deleteBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteBareMetalServerNetworkAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteBareMetalServerNetworkAttachmentOptions model
				deleteBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.DeleteBareMetalServerNetworkAttachmentOptions)
				deleteBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				deleteBareMetalServerNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				deleteBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteBareMetalServerNetworkAttachment(deleteBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteBareMetalServerNetworkAttachmentOptions model with no property values
				deleteBareMetalServerNetworkAttachmentOptionsModelNew := new(vpcv1.DeleteBareMetalServerNetworkAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteBareMetalServerNetworkAttachment(deleteBareMetalServerNetworkAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptions *GetBareMetalServerNetworkAttachmentOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getBareMetalServerNetworkAttachmentPath := "/bare_metal_servers/testString/network_attachments/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerNetworkAttachmentPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkAttachment with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkAttachmentOptions model
				getBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.GetBareMetalServerNetworkAttachmentOptions)
				getBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptions *GetBareMetalServerNetworkAttachmentOptions)`, func() {
		version := "2024-06-23"
		getBareMetalServerNetworkAttachmentPath := "/bare_metal_servers/testString/network_attachments/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerNetworkAttachmentPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}`)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkAttachment successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetBareMetalServerNetworkAttachmentOptions model
				getBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.GetBareMetalServerNetworkAttachmentOptions)
				getBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetBareMetalServerNetworkAttachmentWithContext(ctx, getBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetBareMetalServerNetworkAttachmentWithContext(ctx, getBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerNetworkAttachmentPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}`)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetBareMetalServerNetworkAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkAttachmentOptions model
				getBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.GetBareMetalServerNetworkAttachmentOptions)
				getBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetBareMetalServerNetworkAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkAttachmentOptions model
				getBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.GetBareMetalServerNetworkAttachmentOptions)
				getBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetBareMetalServerNetworkAttachmentOptions model with no property values
				getBareMetalServerNetworkAttachmentOptionsModelNew := new(vpcv1.GetBareMetalServerNetworkAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkAttachmentOptions model
				getBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.GetBareMetalServerNetworkAttachmentOptions)
				getBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptions *UpdateBareMetalServerNetworkAttachmentOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateBareMetalServerNetworkAttachmentPath := "/bare_metal_servers/testString/network_attachments/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBareMetalServerNetworkAttachmentPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateBareMetalServerNetworkAttachment with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BareMetalServerNetworkAttachmentPatch model
				bareMetalServerNetworkAttachmentPatchModel := new(vpcv1.BareMetalServerNetworkAttachmentPatch)
				bareMetalServerNetworkAttachmentPatchModel.AllowedVlans = []int64{int64(4)}
				bareMetalServerNetworkAttachmentPatchModel.Name = core.StringPtr("my-bare-metal-server-network-attachment-updated")
				bareMetalServerNetworkAttachmentPatchModelAsPatch, asPatchErr := bareMetalServerNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerNetworkAttachmentOptions model
				updateBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.UpdateBareMetalServerNetworkAttachmentOptions)
				updateBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerNetworkAttachmentPatch = bareMetalServerNetworkAttachmentPatchModelAsPatch
				updateBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptions *UpdateBareMetalServerNetworkAttachmentOptions)`, func() {
		version := "2024-06-23"
		updateBareMetalServerNetworkAttachmentPath := "/bare_metal_servers/testString/network_attachments/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBareMetalServerNetworkAttachmentPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}`)
				}))
			})
			It(`Invoke UpdateBareMetalServerNetworkAttachment successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the BareMetalServerNetworkAttachmentPatch model
				bareMetalServerNetworkAttachmentPatchModel := new(vpcv1.BareMetalServerNetworkAttachmentPatch)
				bareMetalServerNetworkAttachmentPatchModel.AllowedVlans = []int64{int64(4)}
				bareMetalServerNetworkAttachmentPatchModel.Name = core.StringPtr("my-bare-metal-server-network-attachment-updated")
				bareMetalServerNetworkAttachmentPatchModelAsPatch, asPatchErr := bareMetalServerNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerNetworkAttachmentOptions model
				updateBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.UpdateBareMetalServerNetworkAttachmentOptions)
				updateBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerNetworkAttachmentPatch = bareMetalServerNetworkAttachmentPatchModelAsPatch
				updateBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateBareMetalServerNetworkAttachmentWithContext(ctx, updateBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateBareMetalServerNetworkAttachmentWithContext(ctx, updateBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBareMetalServerNetworkAttachmentPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}`)
				}))
			})
			It(`Invoke UpdateBareMetalServerNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateBareMetalServerNetworkAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the BareMetalServerNetworkAttachmentPatch model
				bareMetalServerNetworkAttachmentPatchModel := new(vpcv1.BareMetalServerNetworkAttachmentPatch)
				bareMetalServerNetworkAttachmentPatchModel.AllowedVlans = []int64{int64(4)}
				bareMetalServerNetworkAttachmentPatchModel.Name = core.StringPtr("my-bare-metal-server-network-attachment-updated")
				bareMetalServerNetworkAttachmentPatchModelAsPatch, asPatchErr := bareMetalServerNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerNetworkAttachmentOptions model
				updateBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.UpdateBareMetalServerNetworkAttachmentOptions)
				updateBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerNetworkAttachmentPatch = bareMetalServerNetworkAttachmentPatchModelAsPatch
				updateBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateBareMetalServerNetworkAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BareMetalServerNetworkAttachmentPatch model
				bareMetalServerNetworkAttachmentPatchModel := new(vpcv1.BareMetalServerNetworkAttachmentPatch)
				bareMetalServerNetworkAttachmentPatchModel.AllowedVlans = []int64{int64(4)}
				bareMetalServerNetworkAttachmentPatchModel.Name = core.StringPtr("my-bare-metal-server-network-attachment-updated")
				bareMetalServerNetworkAttachmentPatchModelAsPatch, asPatchErr := bareMetalServerNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerNetworkAttachmentOptions model
				updateBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.UpdateBareMetalServerNetworkAttachmentOptions)
				updateBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerNetworkAttachmentPatch = bareMetalServerNetworkAttachmentPatchModelAsPatch
				updateBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateBareMetalServerNetworkAttachmentOptions model with no property values
				updateBareMetalServerNetworkAttachmentOptionsModelNew := new(vpcv1.UpdateBareMetalServerNetworkAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateBareMetalServerNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BareMetalServerNetworkAttachmentPatch model
				bareMetalServerNetworkAttachmentPatchModel := new(vpcv1.BareMetalServerNetworkAttachmentPatch)
				bareMetalServerNetworkAttachmentPatchModel.AllowedVlans = []int64{int64(4)}
				bareMetalServerNetworkAttachmentPatchModel.Name = core.StringPtr("my-bare-metal-server-network-attachment-updated")
				bareMetalServerNetworkAttachmentPatchModelAsPatch, asPatchErr := bareMetalServerNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerNetworkAttachmentOptions model
				updateBareMetalServerNetworkAttachmentOptionsModel := new(vpcv1.UpdateBareMetalServerNetworkAttachmentOptions)
				updateBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerNetworkAttachmentPatch = bareMetalServerNetworkAttachmentPatchModelAsPatch
				updateBareMetalServerNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptions *ListBareMetalServerNetworkInterfacesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listBareMetalServerNetworkInterfacesPath := "/bare_metal_servers/testString/network_interfaces"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkInterfaces with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkInterfacesOptions model
				listBareMetalServerNetworkInterfacesOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfacesOptions)
				listBareMetalServerNetworkInterfacesOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptions *ListBareMetalServerNetworkInterfacesOptions)`, func() {
		version := "2024-06-23"
		listBareMetalServerNetworkInterfacesPath := "/bare_metal_servers/testString/network_interfaces"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkInterfaces successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListBareMetalServerNetworkInterfacesOptions model
				listBareMetalServerNetworkInterfacesOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfacesOptions)
				listBareMetalServerNetworkInterfacesOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListBareMetalServerNetworkInterfacesWithContext(ctx, listBareMetalServerNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListBareMetalServerNetworkInterfacesWithContext(ctx, listBareMetalServerNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkInterfaces successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaces(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkInterfacesOptions model
				listBareMetalServerNetworkInterfacesOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfacesOptions)
				listBareMetalServerNetworkInterfacesOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListBareMetalServerNetworkInterfaces with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkInterfacesOptions model
				listBareMetalServerNetworkInterfacesOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfacesOptions)
				listBareMetalServerNetworkInterfacesOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListBareMetalServerNetworkInterfacesOptions model with no property values
				listBareMetalServerNetworkInterfacesOptionsModelNew := new(vpcv1.ListBareMetalServerNetworkInterfacesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkInterfaces successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkInterfacesOptions model
				listBareMetalServerNetworkInterfacesOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfacesOptions)
				listBareMetalServerNetworkInterfacesOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listBareMetalServerNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listBareMetalServerNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.BareMetalServerNetworkInterfaceCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.BareMetalServerNetworkInterfaceCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.BareMetalServerNetworkInterfaceCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use BareMetalServerNetworkInterfacesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listBareMetalServerNetworkInterfacesOptionsModel := &vpcv1.ListBareMetalServerNetworkInterfacesOptions{
					BareMetalServerID: core.StringPtr("testString"),
					Limit:             core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewBareMetalServerNetworkInterfacesPager(listBareMetalServerNetworkInterfacesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.BareMetalServerNetworkInterfaceIntf
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use BareMetalServerNetworkInterfacesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listBareMetalServerNetworkInterfacesOptionsModel := &vpcv1.ListBareMetalServerNetworkInterfacesOptions{
					BareMetalServerID: core.StringPtr("testString"),
					Limit:             core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewBareMetalServerNetworkInterfacesPager(listBareMetalServerNetworkInterfacesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptions *CreateBareMetalServerNetworkInterfaceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createBareMetalServerNetworkInterfacePath := "/bare_metal_servers/testString/network_interfaces"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBareMetalServerNetworkInterfacePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateBareMetalServerNetworkInterface with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model
				bareMetalServerNetworkInterfacePrototypeModel := new(vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype)
				bareMetalServerNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-interface")
				bareMetalServerNetworkInterfacePrototypeModel.PrimaryIP = networkInterfaceIPPrototypeModel
				bareMetalServerNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel
				bareMetalServerNetworkInterfacePrototypeModel.InterfaceType = core.StringPtr("hipersocket")

				// Construct an instance of the CreateBareMetalServerNetworkInterfaceOptions model
				createBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.CreateBareMetalServerNetworkInterfaceOptions)
				createBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerNetworkInterfacePrototype = bareMetalServerNetworkInterfacePrototypeModel
				createBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptions *CreateBareMetalServerNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		createBareMetalServerNetworkInterfacePath := "/bare_metal_servers/testString/network_interfaces"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBareMetalServerNetworkInterfacePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}`)
				}))
			})
			It(`Invoke CreateBareMetalServerNetworkInterface successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model
				bareMetalServerNetworkInterfacePrototypeModel := new(vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype)
				bareMetalServerNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-interface")
				bareMetalServerNetworkInterfacePrototypeModel.PrimaryIP = networkInterfaceIPPrototypeModel
				bareMetalServerNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel
				bareMetalServerNetworkInterfacePrototypeModel.InterfaceType = core.StringPtr("hipersocket")

				// Construct an instance of the CreateBareMetalServerNetworkInterfaceOptions model
				createBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.CreateBareMetalServerNetworkInterfaceOptions)
				createBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerNetworkInterfacePrototype = bareMetalServerNetworkInterfacePrototypeModel
				createBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateBareMetalServerNetworkInterfaceWithContext(ctx, createBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateBareMetalServerNetworkInterfaceWithContext(ctx, createBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createBareMetalServerNetworkInterfacePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}`)
				}))
			})
			It(`Invoke CreateBareMetalServerNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateBareMetalServerNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model
				bareMetalServerNetworkInterfacePrototypeModel := new(vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype)
				bareMetalServerNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-interface")
				bareMetalServerNetworkInterfacePrototypeModel.PrimaryIP = networkInterfaceIPPrototypeModel
				bareMetalServerNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel
				bareMetalServerNetworkInterfacePrototypeModel.InterfaceType = core.StringPtr("hipersocket")

				// Construct an instance of the CreateBareMetalServerNetworkInterfaceOptions model
				createBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.CreateBareMetalServerNetworkInterfaceOptions)
				createBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerNetworkInterfacePrototype = bareMetalServerNetworkInterfacePrototypeModel
				createBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateBareMetalServerNetworkInterface with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model
				bareMetalServerNetworkInterfacePrototypeModel := new(vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype)
				bareMetalServerNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-interface")
				bareMetalServerNetworkInterfacePrototypeModel.PrimaryIP = networkInterfaceIPPrototypeModel
				bareMetalServerNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel
				bareMetalServerNetworkInterfacePrototypeModel.InterfaceType = core.StringPtr("hipersocket")

				// Construct an instance of the CreateBareMetalServerNetworkInterfaceOptions model
				createBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.CreateBareMetalServerNetworkInterfaceOptions)
				createBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerNetworkInterfacePrototype = bareMetalServerNetworkInterfacePrototypeModel
				createBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateBareMetalServerNetworkInterfaceOptions model with no property values
				createBareMetalServerNetworkInterfaceOptionsModelNew := new(vpcv1.CreateBareMetalServerNetworkInterfaceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateBareMetalServerNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model
				bareMetalServerNetworkInterfacePrototypeModel := new(vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype)
				bareMetalServerNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-interface")
				bareMetalServerNetworkInterfacePrototypeModel.PrimaryIP = networkInterfaceIPPrototypeModel
				bareMetalServerNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel
				bareMetalServerNetworkInterfacePrototypeModel.InterfaceType = core.StringPtr("hipersocket")

				// Construct an instance of the CreateBareMetalServerNetworkInterfaceOptions model
				createBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.CreateBareMetalServerNetworkInterfaceOptions)
				createBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				createBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerNetworkInterfacePrototype = bareMetalServerNetworkInterfacePrototypeModel
				createBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteBareMetalServerNetworkInterface(deleteBareMetalServerNetworkInterfaceOptions *DeleteBareMetalServerNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		deleteBareMetalServerNetworkInterfacePath := "/bare_metal_servers/testString/network_interfaces/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteBareMetalServerNetworkInterfacePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteBareMetalServerNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteBareMetalServerNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteBareMetalServerNetworkInterfaceOptions model
				deleteBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.DeleteBareMetalServerNetworkInterfaceOptions)
				deleteBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				deleteBareMetalServerNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				deleteBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteBareMetalServerNetworkInterface(deleteBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteBareMetalServerNetworkInterface with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteBareMetalServerNetworkInterfaceOptions model
				deleteBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.DeleteBareMetalServerNetworkInterfaceOptions)
				deleteBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				deleteBareMetalServerNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				deleteBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteBareMetalServerNetworkInterface(deleteBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteBareMetalServerNetworkInterfaceOptions model with no property values
				deleteBareMetalServerNetworkInterfaceOptionsModelNew := new(vpcv1.DeleteBareMetalServerNetworkInterfaceOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteBareMetalServerNetworkInterface(deleteBareMetalServerNetworkInterfaceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptions *GetBareMetalServerNetworkInterfaceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getBareMetalServerNetworkInterfacePath := "/bare_metal_servers/testString/network_interfaces/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerNetworkInterfacePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkInterface with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkInterfaceOptions model
				getBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceOptions)
				getBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptions *GetBareMetalServerNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		getBareMetalServerNetworkInterfacePath := "/bare_metal_servers/testString/network_interfaces/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerNetworkInterfacePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}`)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkInterface successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetBareMetalServerNetworkInterfaceOptions model
				getBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceOptions)
				getBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetBareMetalServerNetworkInterfaceWithContext(ctx, getBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetBareMetalServerNetworkInterfaceWithContext(ctx, getBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerNetworkInterfacePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}`)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkInterfaceOptions model
				getBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceOptions)
				getBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetBareMetalServerNetworkInterface with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkInterfaceOptions model
				getBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceOptions)
				getBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetBareMetalServerNetworkInterfaceOptions model with no property values
				getBareMetalServerNetworkInterfaceOptionsModelNew := new(vpcv1.GetBareMetalServerNetworkInterfaceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkInterfaceOptions model
				getBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceOptions)
				getBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptions *UpdateBareMetalServerNetworkInterfaceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateBareMetalServerNetworkInterfacePath := "/bare_metal_servers/testString/network_interfaces/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBareMetalServerNetworkInterfacePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateBareMetalServerNetworkInterface with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BareMetalServerNetworkInterfacePatch model
				bareMetalServerNetworkInterfacePatchModel := new(vpcv1.BareMetalServerNetworkInterfacePatch)
				bareMetalServerNetworkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePatchModel.AllowedVlans = []int64{int64(4)}
				bareMetalServerNetworkInterfacePatchModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePatchModel.Name = core.StringPtr("my-bare-metal-server-network-interface")
				bareMetalServerNetworkInterfacePatchModelAsPatch, asPatchErr := bareMetalServerNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerNetworkInterfaceOptions model
				updateBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.UpdateBareMetalServerNetworkInterfaceOptions)
				updateBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerNetworkInterfacePatch = bareMetalServerNetworkInterfacePatchModelAsPatch
				updateBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptions *UpdateBareMetalServerNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		updateBareMetalServerNetworkInterfacePath := "/bare_metal_servers/testString/network_interfaces/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBareMetalServerNetworkInterfacePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}`)
				}))
			})
			It(`Invoke UpdateBareMetalServerNetworkInterface successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the BareMetalServerNetworkInterfacePatch model
				bareMetalServerNetworkInterfacePatchModel := new(vpcv1.BareMetalServerNetworkInterfacePatch)
				bareMetalServerNetworkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePatchModel.AllowedVlans = []int64{int64(4)}
				bareMetalServerNetworkInterfacePatchModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePatchModel.Name = core.StringPtr("my-bare-metal-server-network-interface")
				bareMetalServerNetworkInterfacePatchModelAsPatch, asPatchErr := bareMetalServerNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerNetworkInterfaceOptions model
				updateBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.UpdateBareMetalServerNetworkInterfaceOptions)
				updateBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerNetworkInterfacePatch = bareMetalServerNetworkInterfacePatchModelAsPatch
				updateBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateBareMetalServerNetworkInterfaceWithContext(ctx, updateBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateBareMetalServerNetworkInterfaceWithContext(ctx, updateBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBareMetalServerNetworkInterfacePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}`)
				}))
			})
			It(`Invoke UpdateBareMetalServerNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateBareMetalServerNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the BareMetalServerNetworkInterfacePatch model
				bareMetalServerNetworkInterfacePatchModel := new(vpcv1.BareMetalServerNetworkInterfacePatch)
				bareMetalServerNetworkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePatchModel.AllowedVlans = []int64{int64(4)}
				bareMetalServerNetworkInterfacePatchModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePatchModel.Name = core.StringPtr("my-bare-metal-server-network-interface")
				bareMetalServerNetworkInterfacePatchModelAsPatch, asPatchErr := bareMetalServerNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerNetworkInterfaceOptions model
				updateBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.UpdateBareMetalServerNetworkInterfaceOptions)
				updateBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerNetworkInterfacePatch = bareMetalServerNetworkInterfacePatchModelAsPatch
				updateBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateBareMetalServerNetworkInterface with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BareMetalServerNetworkInterfacePatch model
				bareMetalServerNetworkInterfacePatchModel := new(vpcv1.BareMetalServerNetworkInterfacePatch)
				bareMetalServerNetworkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePatchModel.AllowedVlans = []int64{int64(4)}
				bareMetalServerNetworkInterfacePatchModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePatchModel.Name = core.StringPtr("my-bare-metal-server-network-interface")
				bareMetalServerNetworkInterfacePatchModelAsPatch, asPatchErr := bareMetalServerNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerNetworkInterfaceOptions model
				updateBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.UpdateBareMetalServerNetworkInterfaceOptions)
				updateBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerNetworkInterfacePatch = bareMetalServerNetworkInterfacePatchModelAsPatch
				updateBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateBareMetalServerNetworkInterfaceOptions model with no property values
				updateBareMetalServerNetworkInterfaceOptionsModelNew := new(vpcv1.UpdateBareMetalServerNetworkInterfaceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateBareMetalServerNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BareMetalServerNetworkInterfacePatch model
				bareMetalServerNetworkInterfacePatchModel := new(vpcv1.BareMetalServerNetworkInterfacePatch)
				bareMetalServerNetworkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePatchModel.AllowedVlans = []int64{int64(4)}
				bareMetalServerNetworkInterfacePatchModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePatchModel.Name = core.StringPtr("my-bare-metal-server-network-interface")
				bareMetalServerNetworkInterfacePatchModelAsPatch, asPatchErr := bareMetalServerNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerNetworkInterfaceOptions model
				updateBareMetalServerNetworkInterfaceOptionsModel := new(vpcv1.UpdateBareMetalServerNetworkInterfaceOptions)
				updateBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID = core.StringPtr("testString")
				updateBareMetalServerNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerNetworkInterfacePatch = bareMetalServerNetworkInterfacePatchModelAsPatch
				updateBareMetalServerNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptions *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listBareMetalServerNetworkInterfaceFloatingIpsPath := "/bare_metal_servers/testString/network_interfaces/testString/floating_ips"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerNetworkInterfaceFloatingIpsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkInterfaceFloatingIps with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkInterfaceFloatingIpsOptions model
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfaceFloatingIpsOptions)
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptions *ListBareMetalServerNetworkInterfaceFloatingIpsOptions)`, func() {
		version := "2024-06-23"
		listBareMetalServerNetworkInterfaceFloatingIpsPath := "/bare_metal_servers/testString/network_interfaces/testString/floating_ips"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerNetworkInterfaceFloatingIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}`)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkInterfaceFloatingIps successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListBareMetalServerNetworkInterfaceFloatingIpsOptions model
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfaceFloatingIpsOptions)
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListBareMetalServerNetworkInterfaceFloatingIpsWithContext(ctx, listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListBareMetalServerNetworkInterfaceFloatingIpsWithContext(ctx, listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerNetworkInterfaceFloatingIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}`)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkInterfaceFloatingIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaceFloatingIps(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkInterfaceFloatingIpsOptions model
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfaceFloatingIpsOptions)
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListBareMetalServerNetworkInterfaceFloatingIps with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkInterfaceFloatingIpsOptions model
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfaceFloatingIpsOptions)
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListBareMetalServerNetworkInterfaceFloatingIpsOptions model with no property values
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModelNew := new(vpcv1.ListBareMetalServerNetworkInterfaceFloatingIpsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkInterfaceFloatingIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkInterfaceFloatingIpsOptions model
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfaceFloatingIpsOptions)
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`RemoveBareMetalServerNetworkInterfaceFloatingIP(removeBareMetalServerNetworkInterfaceFloatingIPOptions *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions)`, func() {
		version := "2024-06-23"
		removeBareMetalServerNetworkInterfaceFloatingIPPath := "/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(removeBareMetalServerNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke RemoveBareMetalServerNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.RemoveBareMetalServerNetworkInterfaceFloatingIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the RemoveBareMetalServerNetworkInterfaceFloatingIPOptions model
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.RemoveBareMetalServerNetworkInterfaceFloatingIPOptions)
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.RemoveBareMetalServerNetworkInterfaceFloatingIP(removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke RemoveBareMetalServerNetworkInterfaceFloatingIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RemoveBareMetalServerNetworkInterfaceFloatingIPOptions model
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.RemoveBareMetalServerNetworkInterfaceFloatingIPOptions)
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.RemoveBareMetalServerNetworkInterfaceFloatingIP(removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the RemoveBareMetalServerNetworkInterfaceFloatingIPOptions model with no property values
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModelNew := new(vpcv1.RemoveBareMetalServerNetworkInterfaceFloatingIPOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.RemoveBareMetalServerNetworkInterfaceFloatingIP(removeBareMetalServerNetworkInterfaceFloatingIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServerNetworkInterfaceFloatingIP(getBareMetalServerNetworkInterfaceFloatingIPOptions *GetBareMetalServerNetworkInterfaceFloatingIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getBareMetalServerNetworkInterfaceFloatingIPPath := "/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkInterfaceFloatingIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkInterfaceFloatingIPOptions model
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceFloatingIPOptions)
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterfaceFloatingIP(getBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetBareMetalServerNetworkInterfaceFloatingIP(getBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServerNetworkInterfaceFloatingIP(getBareMetalServerNetworkInterfaceFloatingIPOptions *GetBareMetalServerNetworkInterfaceFloatingIPOptions)`, func() {
		version := "2024-06-23"
		getBareMetalServerNetworkInterfaceFloatingIPPath := "/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkInterfaceFloatingIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetBareMetalServerNetworkInterfaceFloatingIPOptions model
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceFloatingIPOptions)
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx, getBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterfaceFloatingIP(getBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx, getBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterfaceFloatingIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkInterfaceFloatingIPOptions model
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceFloatingIPOptions)
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetBareMetalServerNetworkInterfaceFloatingIP(getBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetBareMetalServerNetworkInterfaceFloatingIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkInterfaceFloatingIPOptions model
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceFloatingIPOptions)
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterfaceFloatingIP(getBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetBareMetalServerNetworkInterfaceFloatingIPOptions model with no property values
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModelNew := new(vpcv1.GetBareMetalServerNetworkInterfaceFloatingIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetBareMetalServerNetworkInterfaceFloatingIP(getBareMetalServerNetworkInterfaceFloatingIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkInterfaceFloatingIPOptions model
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceFloatingIPOptions)
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterfaceFloatingIP(getBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`AddBareMetalServerNetworkInterfaceFloatingIP(addBareMetalServerNetworkInterfaceFloatingIPOptions *AddBareMetalServerNetworkInterfaceFloatingIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		addBareMetalServerNetworkInterfaceFloatingIPPath := "/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addBareMetalServerNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("PUT"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke AddBareMetalServerNetworkInterfaceFloatingIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddBareMetalServerNetworkInterfaceFloatingIPOptions model
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddBareMetalServerNetworkInterfaceFloatingIPOptions)
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.AddBareMetalServerNetworkInterfaceFloatingIP(addBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.AddBareMetalServerNetworkInterfaceFloatingIP(addBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`AddBareMetalServerNetworkInterfaceFloatingIP(addBareMetalServerNetworkInterfaceFloatingIPOptions *AddBareMetalServerNetworkInterfaceFloatingIPOptions)`, func() {
		version := "2024-06-23"
		addBareMetalServerNetworkInterfaceFloatingIPPath := "/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addBareMetalServerNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke AddBareMetalServerNetworkInterfaceFloatingIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the AddBareMetalServerNetworkInterfaceFloatingIPOptions model
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddBareMetalServerNetworkInterfaceFloatingIPOptions)
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.AddBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx, addBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.AddBareMetalServerNetworkInterfaceFloatingIP(addBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.AddBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx, addBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addBareMetalServerNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke AddBareMetalServerNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.AddBareMetalServerNetworkInterfaceFloatingIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the AddBareMetalServerNetworkInterfaceFloatingIPOptions model
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddBareMetalServerNetworkInterfaceFloatingIPOptions)
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.AddBareMetalServerNetworkInterfaceFloatingIP(addBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke AddBareMetalServerNetworkInterfaceFloatingIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddBareMetalServerNetworkInterfaceFloatingIPOptions model
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddBareMetalServerNetworkInterfaceFloatingIPOptions)
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.AddBareMetalServerNetworkInterfaceFloatingIP(addBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the AddBareMetalServerNetworkInterfaceFloatingIPOptions model with no property values
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModelNew := new(vpcv1.AddBareMetalServerNetworkInterfaceFloatingIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.AddBareMetalServerNetworkInterfaceFloatingIP(addBareMetalServerNetworkInterfaceFloatingIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke AddBareMetalServerNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddBareMetalServerNetworkInterfaceFloatingIPOptions model
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddBareMetalServerNetworkInterfaceFloatingIPOptions)
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.AddBareMetalServerNetworkInterfaceFloatingIP(addBareMetalServerNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptions *ListBareMetalServerNetworkInterfaceIpsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listBareMetalServerNetworkInterfaceIpsPath := "/bare_metal_servers/testString/network_interfaces/testString/ips"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerNetworkInterfaceIpsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkInterfaceIps with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkInterfaceIpsOptions model
				listBareMetalServerNetworkInterfaceIpsOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfaceIpsOptions)
				listBareMetalServerNetworkInterfaceIpsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptions *ListBareMetalServerNetworkInterfaceIpsOptions)`, func() {
		version := "2024-06-23"
		listBareMetalServerNetworkInterfaceIpsPath := "/bare_metal_servers/testString/network_interfaces/testString/ips"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerNetworkInterfaceIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkInterfaceIps successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListBareMetalServerNetworkInterfaceIpsOptions model
				listBareMetalServerNetworkInterfaceIpsOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfaceIpsOptions)
				listBareMetalServerNetworkInterfaceIpsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListBareMetalServerNetworkInterfaceIpsWithContext(ctx, listBareMetalServerNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListBareMetalServerNetworkInterfaceIpsWithContext(ctx, listBareMetalServerNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listBareMetalServerNetworkInterfaceIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkInterfaceIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaceIps(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkInterfaceIpsOptions model
				listBareMetalServerNetworkInterfaceIpsOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfaceIpsOptions)
				listBareMetalServerNetworkInterfaceIpsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListBareMetalServerNetworkInterfaceIps with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkInterfaceIpsOptions model
				listBareMetalServerNetworkInterfaceIpsOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfaceIpsOptions)
				listBareMetalServerNetworkInterfaceIpsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListBareMetalServerNetworkInterfaceIpsOptions model with no property values
				listBareMetalServerNetworkInterfaceIpsOptionsModelNew := new(vpcv1.ListBareMetalServerNetworkInterfaceIpsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListBareMetalServerNetworkInterfaceIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListBareMetalServerNetworkInterfaceIpsOptions model
				listBareMetalServerNetworkInterfaceIpsOptionsModel := new(vpcv1.ListBareMetalServerNetworkInterfaceIpsOptions)
				listBareMetalServerNetworkInterfaceIpsOptionsModel.BareMetalServerID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listBareMetalServerNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServerNetworkInterfaceIP(getBareMetalServerNetworkInterfaceIPOptions *GetBareMetalServerNetworkInterfaceIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getBareMetalServerNetworkInterfaceIPPath := "/bare_metal_servers/testString/network_interfaces/testString/ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerNetworkInterfaceIPPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkInterfaceIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkInterfaceIPOptions model
				getBareMetalServerNetworkInterfaceIPOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceIPOptions)
				getBareMetalServerNetworkInterfaceIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterfaceIP(getBareMetalServerNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetBareMetalServerNetworkInterfaceIP(getBareMetalServerNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServerNetworkInterfaceIP(getBareMetalServerNetworkInterfaceIPOptions *GetBareMetalServerNetworkInterfaceIPOptions)`, func() {
		version := "2024-06-23"
		getBareMetalServerNetworkInterfaceIPPath := "/bare_metal_servers/testString/network_interfaces/testString/ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerNetworkInterfaceIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}`)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkInterfaceIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetBareMetalServerNetworkInterfaceIPOptions model
				getBareMetalServerNetworkInterfaceIPOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceIPOptions)
				getBareMetalServerNetworkInterfaceIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetBareMetalServerNetworkInterfaceIPWithContext(ctx, getBareMetalServerNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterfaceIP(getBareMetalServerNetworkInterfaceIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetBareMetalServerNetworkInterfaceIPWithContext(ctx, getBareMetalServerNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerNetworkInterfaceIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}`)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkInterfaceIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterfaceIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkInterfaceIPOptions model
				getBareMetalServerNetworkInterfaceIPOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceIPOptions)
				getBareMetalServerNetworkInterfaceIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetBareMetalServerNetworkInterfaceIP(getBareMetalServerNetworkInterfaceIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetBareMetalServerNetworkInterfaceIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkInterfaceIPOptions model
				getBareMetalServerNetworkInterfaceIPOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceIPOptions)
				getBareMetalServerNetworkInterfaceIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterfaceIP(getBareMetalServerNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetBareMetalServerNetworkInterfaceIPOptions model with no property values
				getBareMetalServerNetworkInterfaceIPOptionsModelNew := new(vpcv1.GetBareMetalServerNetworkInterfaceIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetBareMetalServerNetworkInterfaceIP(getBareMetalServerNetworkInterfaceIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetBareMetalServerNetworkInterfaceIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerNetworkInterfaceIPOptions model
				getBareMetalServerNetworkInterfaceIPOptionsModel := new(vpcv1.GetBareMetalServerNetworkInterfaceIPOptions)
				getBareMetalServerNetworkInterfaceIPOptionsModel.BareMetalServerID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetBareMetalServerNetworkInterfaceIP(getBareMetalServerNetworkInterfaceIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteBareMetalServer(deleteBareMetalServerOptions *DeleteBareMetalServerOptions)`, func() {
		version := "2024-06-23"
		deleteBareMetalServerPath := "/bare_metal_servers/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteBareMetalServerPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteBareMetalServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteBareMetalServer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteBareMetalServerOptions model
				deleteBareMetalServerOptionsModel := new(vpcv1.DeleteBareMetalServerOptions)
				deleteBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				deleteBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteBareMetalServer(deleteBareMetalServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteBareMetalServer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteBareMetalServerOptions model
				deleteBareMetalServerOptionsModel := new(vpcv1.DeleteBareMetalServerOptions)
				deleteBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				deleteBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteBareMetalServer(deleteBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteBareMetalServerOptions model with no property values
				deleteBareMetalServerOptionsModelNew := new(vpcv1.DeleteBareMetalServerOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteBareMetalServer(deleteBareMetalServerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServer(getBareMetalServerOptions *GetBareMetalServerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getBareMetalServerPath := "/bare_metal_servers/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetBareMetalServer with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerOptions model
				getBareMetalServerOptionsModel := new(vpcv1.GetBareMetalServerOptions)
				getBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetBareMetalServer(getBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetBareMetalServer(getBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServer(getBareMetalServerOptions *GetBareMetalServerOptions)`, func() {
		version := "2024-06-23"
		getBareMetalServerPath := "/bare_metal_servers/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "metadata_service": {"enabled": false, "protocol": "http"}, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetBareMetalServer successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetBareMetalServerOptions model
				getBareMetalServerOptionsModel := new(vpcv1.GetBareMetalServerOptions)
				getBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetBareMetalServerWithContext(ctx, getBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetBareMetalServer(getBareMetalServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetBareMetalServerWithContext(ctx, getBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "metadata_service": {"enabled": false, "protocol": "http"}, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetBareMetalServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetBareMetalServer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetBareMetalServerOptions model
				getBareMetalServerOptionsModel := new(vpcv1.GetBareMetalServerOptions)
				getBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetBareMetalServer(getBareMetalServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetBareMetalServer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerOptions model
				getBareMetalServerOptionsModel := new(vpcv1.GetBareMetalServerOptions)
				getBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetBareMetalServer(getBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetBareMetalServerOptions model with no property values
				getBareMetalServerOptionsModelNew := new(vpcv1.GetBareMetalServerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetBareMetalServer(getBareMetalServerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetBareMetalServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerOptions model
				getBareMetalServerOptionsModel := new(vpcv1.GetBareMetalServerOptions)
				getBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetBareMetalServer(getBareMetalServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateBareMetalServer(updateBareMetalServerOptions *UpdateBareMetalServerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateBareMetalServerPath := "/bare_metal_servers/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBareMetalServerPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateBareMetalServer with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BareMetalServerMetadataServicePatch model
				bareMetalServerMetadataServicePatchModel := new(vpcv1.BareMetalServerMetadataServicePatch)
				bareMetalServerMetadataServicePatchModel.Enabled = core.BoolPtr(true)
				bareMetalServerMetadataServicePatchModel.Protocol = core.StringPtr("http")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the BareMetalServerReservationAffinityPatch model
				bareMetalServerReservationAffinityPatchModel := new(vpcv1.BareMetalServerReservationAffinityPatch)
				bareMetalServerReservationAffinityPatchModel.Policy = core.StringPtr("automatic")
				bareMetalServerReservationAffinityPatchModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the BareMetalServerTrustedPlatformModulePatch model
				bareMetalServerTrustedPlatformModulePatchModel := new(vpcv1.BareMetalServerTrustedPlatformModulePatch)
				bareMetalServerTrustedPlatformModulePatchModel.Mode = core.StringPtr("disabled")

				// Construct an instance of the BareMetalServerPatch model
				bareMetalServerPatchModel := new(vpcv1.BareMetalServerPatch)
				bareMetalServerPatchModel.Bandwidth = core.Int64Ptr(int64(20000))
				bareMetalServerPatchModel.EnableSecureBoot = core.BoolPtr(false)
				bareMetalServerPatchModel.MetadataService = bareMetalServerMetadataServicePatchModel
				bareMetalServerPatchModel.Name = core.StringPtr("my-bare-metal-server")
				bareMetalServerPatchModel.ReservationAffinity = bareMetalServerReservationAffinityPatchModel
				bareMetalServerPatchModel.TrustedPlatformModule = bareMetalServerTrustedPlatformModulePatchModel
				bareMetalServerPatchModelAsPatch, asPatchErr := bareMetalServerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerOptions model
				updateBareMetalServerOptionsModel := new(vpcv1.UpdateBareMetalServerOptions)
				updateBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerOptionsModel.BareMetalServerPatch = bareMetalServerPatchModelAsPatch
				updateBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateBareMetalServer(updateBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateBareMetalServer(updateBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateBareMetalServer(updateBareMetalServerOptions *UpdateBareMetalServerOptions)`, func() {
		version := "2024-06-23"
		updateBareMetalServerPath := "/bare_metal_servers/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBareMetalServerPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "metadata_service": {"enabled": false, "protocol": "http"}, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateBareMetalServer successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the BareMetalServerMetadataServicePatch model
				bareMetalServerMetadataServicePatchModel := new(vpcv1.BareMetalServerMetadataServicePatch)
				bareMetalServerMetadataServicePatchModel.Enabled = core.BoolPtr(true)
				bareMetalServerMetadataServicePatchModel.Protocol = core.StringPtr("http")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the BareMetalServerReservationAffinityPatch model
				bareMetalServerReservationAffinityPatchModel := new(vpcv1.BareMetalServerReservationAffinityPatch)
				bareMetalServerReservationAffinityPatchModel.Policy = core.StringPtr("automatic")
				bareMetalServerReservationAffinityPatchModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the BareMetalServerTrustedPlatformModulePatch model
				bareMetalServerTrustedPlatformModulePatchModel := new(vpcv1.BareMetalServerTrustedPlatformModulePatch)
				bareMetalServerTrustedPlatformModulePatchModel.Mode = core.StringPtr("disabled")

				// Construct an instance of the BareMetalServerPatch model
				bareMetalServerPatchModel := new(vpcv1.BareMetalServerPatch)
				bareMetalServerPatchModel.Bandwidth = core.Int64Ptr(int64(20000))
				bareMetalServerPatchModel.EnableSecureBoot = core.BoolPtr(false)
				bareMetalServerPatchModel.MetadataService = bareMetalServerMetadataServicePatchModel
				bareMetalServerPatchModel.Name = core.StringPtr("my-bare-metal-server")
				bareMetalServerPatchModel.ReservationAffinity = bareMetalServerReservationAffinityPatchModel
				bareMetalServerPatchModel.TrustedPlatformModule = bareMetalServerTrustedPlatformModulePatchModel
				bareMetalServerPatchModelAsPatch, asPatchErr := bareMetalServerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerOptions model
				updateBareMetalServerOptionsModel := new(vpcv1.UpdateBareMetalServerOptions)
				updateBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerOptionsModel.BareMetalServerPatch = bareMetalServerPatchModelAsPatch
				updateBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateBareMetalServerWithContext(ctx, updateBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateBareMetalServer(updateBareMetalServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateBareMetalServerWithContext(ctx, updateBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateBareMetalServerPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "0717-3744f199-6ccc-4698-8772-bb3937348c96", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "metadata_service": {"enabled": false, "protocol": "http"}, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateBareMetalServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateBareMetalServer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the BareMetalServerMetadataServicePatch model
				bareMetalServerMetadataServicePatchModel := new(vpcv1.BareMetalServerMetadataServicePatch)
				bareMetalServerMetadataServicePatchModel.Enabled = core.BoolPtr(true)
				bareMetalServerMetadataServicePatchModel.Protocol = core.StringPtr("http")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the BareMetalServerReservationAffinityPatch model
				bareMetalServerReservationAffinityPatchModel := new(vpcv1.BareMetalServerReservationAffinityPatch)
				bareMetalServerReservationAffinityPatchModel.Policy = core.StringPtr("automatic")
				bareMetalServerReservationAffinityPatchModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the BareMetalServerTrustedPlatformModulePatch model
				bareMetalServerTrustedPlatformModulePatchModel := new(vpcv1.BareMetalServerTrustedPlatformModulePatch)
				bareMetalServerTrustedPlatformModulePatchModel.Mode = core.StringPtr("disabled")

				// Construct an instance of the BareMetalServerPatch model
				bareMetalServerPatchModel := new(vpcv1.BareMetalServerPatch)
				bareMetalServerPatchModel.Bandwidth = core.Int64Ptr(int64(20000))
				bareMetalServerPatchModel.EnableSecureBoot = core.BoolPtr(false)
				bareMetalServerPatchModel.MetadataService = bareMetalServerMetadataServicePatchModel
				bareMetalServerPatchModel.Name = core.StringPtr("my-bare-metal-server")
				bareMetalServerPatchModel.ReservationAffinity = bareMetalServerReservationAffinityPatchModel
				bareMetalServerPatchModel.TrustedPlatformModule = bareMetalServerTrustedPlatformModulePatchModel
				bareMetalServerPatchModelAsPatch, asPatchErr := bareMetalServerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerOptions model
				updateBareMetalServerOptionsModel := new(vpcv1.UpdateBareMetalServerOptions)
				updateBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerOptionsModel.BareMetalServerPatch = bareMetalServerPatchModelAsPatch
				updateBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateBareMetalServer(updateBareMetalServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateBareMetalServer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BareMetalServerMetadataServicePatch model
				bareMetalServerMetadataServicePatchModel := new(vpcv1.BareMetalServerMetadataServicePatch)
				bareMetalServerMetadataServicePatchModel.Enabled = core.BoolPtr(true)
				bareMetalServerMetadataServicePatchModel.Protocol = core.StringPtr("http")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the BareMetalServerReservationAffinityPatch model
				bareMetalServerReservationAffinityPatchModel := new(vpcv1.BareMetalServerReservationAffinityPatch)
				bareMetalServerReservationAffinityPatchModel.Policy = core.StringPtr("automatic")
				bareMetalServerReservationAffinityPatchModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the BareMetalServerTrustedPlatformModulePatch model
				bareMetalServerTrustedPlatformModulePatchModel := new(vpcv1.BareMetalServerTrustedPlatformModulePatch)
				bareMetalServerTrustedPlatformModulePatchModel.Mode = core.StringPtr("disabled")

				// Construct an instance of the BareMetalServerPatch model
				bareMetalServerPatchModel := new(vpcv1.BareMetalServerPatch)
				bareMetalServerPatchModel.Bandwidth = core.Int64Ptr(int64(20000))
				bareMetalServerPatchModel.EnableSecureBoot = core.BoolPtr(false)
				bareMetalServerPatchModel.MetadataService = bareMetalServerMetadataServicePatchModel
				bareMetalServerPatchModel.Name = core.StringPtr("my-bare-metal-server")
				bareMetalServerPatchModel.ReservationAffinity = bareMetalServerReservationAffinityPatchModel
				bareMetalServerPatchModel.TrustedPlatformModule = bareMetalServerTrustedPlatformModulePatchModel
				bareMetalServerPatchModelAsPatch, asPatchErr := bareMetalServerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerOptions model
				updateBareMetalServerOptionsModel := new(vpcv1.UpdateBareMetalServerOptions)
				updateBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerOptionsModel.BareMetalServerPatch = bareMetalServerPatchModelAsPatch
				updateBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateBareMetalServer(updateBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateBareMetalServerOptions model with no property values
				updateBareMetalServerOptionsModelNew := new(vpcv1.UpdateBareMetalServerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateBareMetalServer(updateBareMetalServerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateBareMetalServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the BareMetalServerMetadataServicePatch model
				bareMetalServerMetadataServicePatchModel := new(vpcv1.BareMetalServerMetadataServicePatch)
				bareMetalServerMetadataServicePatchModel.Enabled = core.BoolPtr(true)
				bareMetalServerMetadataServicePatchModel.Protocol = core.StringPtr("http")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the BareMetalServerReservationAffinityPatch model
				bareMetalServerReservationAffinityPatchModel := new(vpcv1.BareMetalServerReservationAffinityPatch)
				bareMetalServerReservationAffinityPatchModel.Policy = core.StringPtr("automatic")
				bareMetalServerReservationAffinityPatchModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the BareMetalServerTrustedPlatformModulePatch model
				bareMetalServerTrustedPlatformModulePatchModel := new(vpcv1.BareMetalServerTrustedPlatformModulePatch)
				bareMetalServerTrustedPlatformModulePatchModel.Mode = core.StringPtr("disabled")

				// Construct an instance of the BareMetalServerPatch model
				bareMetalServerPatchModel := new(vpcv1.BareMetalServerPatch)
				bareMetalServerPatchModel.Bandwidth = core.Int64Ptr(int64(20000))
				bareMetalServerPatchModel.EnableSecureBoot = core.BoolPtr(false)
				bareMetalServerPatchModel.MetadataService = bareMetalServerMetadataServicePatchModel
				bareMetalServerPatchModel.Name = core.StringPtr("my-bare-metal-server")
				bareMetalServerPatchModel.ReservationAffinity = bareMetalServerReservationAffinityPatchModel
				bareMetalServerPatchModel.TrustedPlatformModule = bareMetalServerTrustedPlatformModulePatchModel
				bareMetalServerPatchModelAsPatch, asPatchErr := bareMetalServerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateBareMetalServerOptions model
				updateBareMetalServerOptionsModel := new(vpcv1.UpdateBareMetalServerOptions)
				updateBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				updateBareMetalServerOptionsModel.BareMetalServerPatch = bareMetalServerPatchModelAsPatch
				updateBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateBareMetalServer(updateBareMetalServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateFirmwareForBareMetalServer(updateFirmwareForBareMetalServerOptions *UpdateFirmwareForBareMetalServerOptions)`, func() {
		version := "2024-06-23"
		updateFirmwareForBareMetalServerPath := "/bare_metal_servers/testString/firmware/update"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateFirmwareForBareMetalServerPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke UpdateFirmwareForBareMetalServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.UpdateFirmwareForBareMetalServer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the UpdateFirmwareForBareMetalServerOptions model
				updateFirmwareForBareMetalServerOptionsModel := new(vpcv1.UpdateFirmwareForBareMetalServerOptions)
				updateFirmwareForBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				updateFirmwareForBareMetalServerOptionsModel.AutoStart = core.BoolPtr(true)
				updateFirmwareForBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.UpdateFirmwareForBareMetalServer(updateFirmwareForBareMetalServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke UpdateFirmwareForBareMetalServer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the UpdateFirmwareForBareMetalServerOptions model
				updateFirmwareForBareMetalServerOptionsModel := new(vpcv1.UpdateFirmwareForBareMetalServerOptions)
				updateFirmwareForBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				updateFirmwareForBareMetalServerOptionsModel.AutoStart = core.BoolPtr(true)
				updateFirmwareForBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.UpdateFirmwareForBareMetalServer(updateFirmwareForBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the UpdateFirmwareForBareMetalServerOptions model with no property values
				updateFirmwareForBareMetalServerOptionsModelNew := new(vpcv1.UpdateFirmwareForBareMetalServerOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.UpdateFirmwareForBareMetalServer(updateFirmwareForBareMetalServerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServerInitialization(getBareMetalServerInitializationOptions *GetBareMetalServerInitializationOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getBareMetalServerInitializationPath := "/bare_metal_servers/testString/initialization"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerInitializationPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetBareMetalServerInitialization with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerInitializationOptions model
				getBareMetalServerInitializationOptionsModel := new(vpcv1.GetBareMetalServerInitializationOptions)
				getBareMetalServerInitializationOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetBareMetalServerInitialization(getBareMetalServerInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetBareMetalServerInitialization(getBareMetalServerInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetBareMetalServerInitialization(getBareMetalServerInitializationOptions *GetBareMetalServerInitializationOptions)`, func() {
		version := "2024-06-23"
		getBareMetalServerInitializationPath := "/bare_metal_servers/testString/initialization"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerInitializationPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "resource_type": "trusted_profile"}}, "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}, "resource_type": "host_user_account", "username": "Administrator"}]}`)
				}))
			})
			It(`Invoke GetBareMetalServerInitialization successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetBareMetalServerInitializationOptions model
				getBareMetalServerInitializationOptionsModel := new(vpcv1.GetBareMetalServerInitializationOptions)
				getBareMetalServerInitializationOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetBareMetalServerInitializationWithContext(ctx, getBareMetalServerInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetBareMetalServerInitialization(getBareMetalServerInitializationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetBareMetalServerInitializationWithContext(ctx, getBareMetalServerInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getBareMetalServerInitializationPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "resource_type": "trusted_profile"}}, "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}, "resource_type": "host_user_account", "username": "Administrator"}]}`)
				}))
			})
			It(`Invoke GetBareMetalServerInitialization successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetBareMetalServerInitialization(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetBareMetalServerInitializationOptions model
				getBareMetalServerInitializationOptionsModel := new(vpcv1.GetBareMetalServerInitializationOptions)
				getBareMetalServerInitializationOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetBareMetalServerInitialization(getBareMetalServerInitializationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetBareMetalServerInitialization with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerInitializationOptions model
				getBareMetalServerInitializationOptionsModel := new(vpcv1.GetBareMetalServerInitializationOptions)
				getBareMetalServerInitializationOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetBareMetalServerInitialization(getBareMetalServerInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetBareMetalServerInitializationOptions model with no property values
				getBareMetalServerInitializationOptionsModelNew := new(vpcv1.GetBareMetalServerInitializationOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetBareMetalServerInitialization(getBareMetalServerInitializationOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetBareMetalServerInitialization successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetBareMetalServerInitializationOptions model
				getBareMetalServerInitializationOptionsModel := new(vpcv1.GetBareMetalServerInitializationOptions)
				getBareMetalServerInitializationOptionsModel.ID = core.StringPtr("testString")
				getBareMetalServerInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetBareMetalServerInitialization(getBareMetalServerInitializationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ReplaceBareMetalServerInitialization(replaceBareMetalServerInitializationOptions *ReplaceBareMetalServerInitializationOptions) - Operation response error`, func() {
		version := "2024-06-23"
		replaceBareMetalServerInitializationPath := "/bare_metal_servers/testString/initialization"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(replaceBareMetalServerInitializationPath))
					Expect(req.Method).To(Equal("PUT"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ReplaceBareMetalServerInitialization with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the BareMetalServerInitializationDefaultTrustedProfilePrototype model
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel := new(vpcv1.BareMetalServerInitializationDefaultTrustedProfilePrototype)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the ReplaceBareMetalServerInitializationOptions model
				replaceBareMetalServerInitializationOptionsModel := new(vpcv1.ReplaceBareMetalServerInitializationOptions)
				replaceBareMetalServerInitializationOptionsModel.ID = core.StringPtr("testString")
				replaceBareMetalServerInitializationOptionsModel.Image = imageIdentityModel
				replaceBareMetalServerInitializationOptionsModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				replaceBareMetalServerInitializationOptionsModel.DefaultTrustedProfile = bareMetalServerInitializationDefaultTrustedProfilePrototypeModel
				replaceBareMetalServerInitializationOptionsModel.UserData = core.StringPtr("testString")
				replaceBareMetalServerInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ReplaceBareMetalServerInitialization(replaceBareMetalServerInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ReplaceBareMetalServerInitialization(replaceBareMetalServerInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ReplaceBareMetalServerInitialization(replaceBareMetalServerInitializationOptions *ReplaceBareMetalServerInitializationOptions)`, func() {
		version := "2024-06-23"
		replaceBareMetalServerInitializationPath := "/bare_metal_servers/testString/initialization"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(replaceBareMetalServerInitializationPath))
					Expect(req.Method).To(Equal("PUT"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "resource_type": "trusted_profile"}}, "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}, "resource_type": "host_user_account", "username": "Administrator"}]}`)
				}))
			})
			It(`Invoke ReplaceBareMetalServerInitialization successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the BareMetalServerInitializationDefaultTrustedProfilePrototype model
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel := new(vpcv1.BareMetalServerInitializationDefaultTrustedProfilePrototype)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the ReplaceBareMetalServerInitializationOptions model
				replaceBareMetalServerInitializationOptionsModel := new(vpcv1.ReplaceBareMetalServerInitializationOptions)
				replaceBareMetalServerInitializationOptionsModel.ID = core.StringPtr("testString")
				replaceBareMetalServerInitializationOptionsModel.Image = imageIdentityModel
				replaceBareMetalServerInitializationOptionsModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				replaceBareMetalServerInitializationOptionsModel.DefaultTrustedProfile = bareMetalServerInitializationDefaultTrustedProfilePrototypeModel
				replaceBareMetalServerInitializationOptionsModel.UserData = core.StringPtr("testString")
				replaceBareMetalServerInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ReplaceBareMetalServerInitializationWithContext(ctx, replaceBareMetalServerInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ReplaceBareMetalServerInitialization(replaceBareMetalServerInitializationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ReplaceBareMetalServerInitializationWithContext(ctx, replaceBareMetalServerInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(replaceBareMetalServerInitializationPath))
					Expect(req.Method).To(Equal("PUT"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "resource_type": "trusted_profile"}}, "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}, "resource_type": "host_user_account", "username": "Administrator"}]}`)
				}))
			})
			It(`Invoke ReplaceBareMetalServerInitialization successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ReplaceBareMetalServerInitialization(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the BareMetalServerInitializationDefaultTrustedProfilePrototype model
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel := new(vpcv1.BareMetalServerInitializationDefaultTrustedProfilePrototype)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the ReplaceBareMetalServerInitializationOptions model
				replaceBareMetalServerInitializationOptionsModel := new(vpcv1.ReplaceBareMetalServerInitializationOptions)
				replaceBareMetalServerInitializationOptionsModel.ID = core.StringPtr("testString")
				replaceBareMetalServerInitializationOptionsModel.Image = imageIdentityModel
				replaceBareMetalServerInitializationOptionsModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				replaceBareMetalServerInitializationOptionsModel.DefaultTrustedProfile = bareMetalServerInitializationDefaultTrustedProfilePrototypeModel
				replaceBareMetalServerInitializationOptionsModel.UserData = core.StringPtr("testString")
				replaceBareMetalServerInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ReplaceBareMetalServerInitialization(replaceBareMetalServerInitializationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ReplaceBareMetalServerInitialization with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the BareMetalServerInitializationDefaultTrustedProfilePrototype model
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel := new(vpcv1.BareMetalServerInitializationDefaultTrustedProfilePrototype)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the ReplaceBareMetalServerInitializationOptions model
				replaceBareMetalServerInitializationOptionsModel := new(vpcv1.ReplaceBareMetalServerInitializationOptions)
				replaceBareMetalServerInitializationOptionsModel.ID = core.StringPtr("testString")
				replaceBareMetalServerInitializationOptionsModel.Image = imageIdentityModel
				replaceBareMetalServerInitializationOptionsModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				replaceBareMetalServerInitializationOptionsModel.DefaultTrustedProfile = bareMetalServerInitializationDefaultTrustedProfilePrototypeModel
				replaceBareMetalServerInitializationOptionsModel.UserData = core.StringPtr("testString")
				replaceBareMetalServerInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ReplaceBareMetalServerInitialization(replaceBareMetalServerInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ReplaceBareMetalServerInitializationOptions model with no property values
				replaceBareMetalServerInitializationOptionsModelNew := new(vpcv1.ReplaceBareMetalServerInitializationOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ReplaceBareMetalServerInitialization(replaceBareMetalServerInitializationOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ReplaceBareMetalServerInitialization successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the BareMetalServerInitializationDefaultTrustedProfilePrototype model
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel := new(vpcv1.BareMetalServerInitializationDefaultTrustedProfilePrototype)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the ReplaceBareMetalServerInitializationOptions model
				replaceBareMetalServerInitializationOptionsModel := new(vpcv1.ReplaceBareMetalServerInitializationOptions)
				replaceBareMetalServerInitializationOptionsModel.ID = core.StringPtr("testString")
				replaceBareMetalServerInitializationOptionsModel.Image = imageIdentityModel
				replaceBareMetalServerInitializationOptionsModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				replaceBareMetalServerInitializationOptionsModel.DefaultTrustedProfile = bareMetalServerInitializationDefaultTrustedProfilePrototypeModel
				replaceBareMetalServerInitializationOptionsModel.UserData = core.StringPtr("testString")
				replaceBareMetalServerInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ReplaceBareMetalServerInitialization(replaceBareMetalServerInitializationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`RestartBareMetalServer(restartBareMetalServerOptions *RestartBareMetalServerOptions)`, func() {
		version := "2024-06-23"
		restartBareMetalServerPath := "/bare_metal_servers/testString/restart"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(restartBareMetalServerPath))
					Expect(req.Method).To(Equal("POST"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke RestartBareMetalServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.RestartBareMetalServer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the RestartBareMetalServerOptions model
				restartBareMetalServerOptionsModel := new(vpcv1.RestartBareMetalServerOptions)
				restartBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				restartBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.RestartBareMetalServer(restartBareMetalServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke RestartBareMetalServer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RestartBareMetalServerOptions model
				restartBareMetalServerOptionsModel := new(vpcv1.RestartBareMetalServerOptions)
				restartBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				restartBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.RestartBareMetalServer(restartBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the RestartBareMetalServerOptions model with no property values
				restartBareMetalServerOptionsModelNew := new(vpcv1.RestartBareMetalServerOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.RestartBareMetalServer(restartBareMetalServerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`StartBareMetalServer(startBareMetalServerOptions *StartBareMetalServerOptions)`, func() {
		version := "2024-06-23"
		startBareMetalServerPath := "/bare_metal_servers/testString/start"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(startBareMetalServerPath))
					Expect(req.Method).To(Equal("POST"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke StartBareMetalServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.StartBareMetalServer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the StartBareMetalServerOptions model
				startBareMetalServerOptionsModel := new(vpcv1.StartBareMetalServerOptions)
				startBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				startBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.StartBareMetalServer(startBareMetalServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke StartBareMetalServer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the StartBareMetalServerOptions model
				startBareMetalServerOptionsModel := new(vpcv1.StartBareMetalServerOptions)
				startBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				startBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.StartBareMetalServer(startBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the StartBareMetalServerOptions model with no property values
				startBareMetalServerOptionsModelNew := new(vpcv1.StartBareMetalServerOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.StartBareMetalServer(startBareMetalServerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`StopBareMetalServer(stopBareMetalServerOptions *StopBareMetalServerOptions)`, func() {
		version := "2024-06-23"
		stopBareMetalServerPath := "/bare_metal_servers/testString/stop"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(stopBareMetalServerPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke StopBareMetalServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.StopBareMetalServer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the StopBareMetalServerOptions model
				stopBareMetalServerOptionsModel := new(vpcv1.StopBareMetalServerOptions)
				stopBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				stopBareMetalServerOptionsModel.Type = core.StringPtr("hard")
				stopBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.StopBareMetalServer(stopBareMetalServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke StopBareMetalServer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the StopBareMetalServerOptions model
				stopBareMetalServerOptionsModel := new(vpcv1.StopBareMetalServerOptions)
				stopBareMetalServerOptionsModel.ID = core.StringPtr("testString")
				stopBareMetalServerOptionsModel.Type = core.StringPtr("hard")
				stopBareMetalServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.StopBareMetalServer(stopBareMetalServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the StopBareMetalServerOptions model with no property values
				stopBareMetalServerOptionsModelNew := new(vpcv1.StopBareMetalServerOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.StopBareMetalServer(stopBareMetalServerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListClusterNetworkProfiles(listClusterNetworkProfilesOptions *ListClusterNetworkProfilesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listClusterNetworkProfilesPath := "/cluster_network/profiles"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkProfilesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListClusterNetworkProfiles with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworkProfilesOptions model
				listClusterNetworkProfilesOptionsModel := new(vpcv1.ListClusterNetworkProfilesOptions)
				listClusterNetworkProfilesOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListClusterNetworkProfiles(listClusterNetworkProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListClusterNetworkProfiles(listClusterNetworkProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListClusterNetworkProfiles(listClusterNetworkProfilesOptions *ListClusterNetworkProfilesOptions)`, func() {
		version := "2024-06-23"
		listClusterNetworkProfilesPath := "/cluster_network/profiles"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "profiles": [{"family": "vela", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListClusterNetworkProfiles successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListClusterNetworkProfilesOptions model
				listClusterNetworkProfilesOptionsModel := new(vpcv1.ListClusterNetworkProfilesOptions)
				listClusterNetworkProfilesOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListClusterNetworkProfilesWithContext(ctx, listClusterNetworkProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListClusterNetworkProfiles(listClusterNetworkProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListClusterNetworkProfilesWithContext(ctx, listClusterNetworkProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "profiles": [{"family": "vela", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListClusterNetworkProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListClusterNetworkProfiles(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListClusterNetworkProfilesOptions model
				listClusterNetworkProfilesOptionsModel := new(vpcv1.ListClusterNetworkProfilesOptions)
				listClusterNetworkProfilesOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListClusterNetworkProfiles(listClusterNetworkProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListClusterNetworkProfiles with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworkProfilesOptions model
				listClusterNetworkProfilesOptionsModel := new(vpcv1.ListClusterNetworkProfilesOptions)
				listClusterNetworkProfilesOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListClusterNetworkProfiles(listClusterNetworkProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListClusterNetworkProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworkProfilesOptions model
				listClusterNetworkProfilesOptionsModel := new(vpcv1.ListClusterNetworkProfilesOptions)
				listClusterNetworkProfilesOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListClusterNetworkProfiles(listClusterNetworkProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ClusterNetworkProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ClusterNetworkProfileCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ClusterNetworkProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"family":"vela","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100","name":"h100","resource_type":"cluster_network_profile","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zones":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}]}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"profiles":[{"family":"vela","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100","name":"h100","resource_type":"cluster_network_profile","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zones":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}]}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use ClusterNetworkProfilesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listClusterNetworkProfilesOptionsModel := &vpcv1.ListClusterNetworkProfilesOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewClusterNetworkProfilesPager(listClusterNetworkProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.ClusterNetworkProfile
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use ClusterNetworkProfilesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listClusterNetworkProfilesOptionsModel := &vpcv1.ListClusterNetworkProfilesOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewClusterNetworkProfilesPager(listClusterNetworkProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`GetClusterNetworkProfile(getClusterNetworkProfileOptions *GetClusterNetworkProfileOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getClusterNetworkProfilePath := "/cluster_network/profiles/h100"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkProfilePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetClusterNetworkProfile with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkProfileOptions model
				getClusterNetworkProfileOptionsModel := new(vpcv1.GetClusterNetworkProfileOptions)
				getClusterNetworkProfileOptionsModel.Name = core.StringPtr("h100")
				getClusterNetworkProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetClusterNetworkProfile(getClusterNetworkProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetClusterNetworkProfile(getClusterNetworkProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetClusterNetworkProfile(getClusterNetworkProfileOptions *GetClusterNetworkProfileOptions)`, func() {
		version := "2024-06-23"
		getClusterNetworkProfilePath := "/cluster_network/profiles/h100"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkProfilePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"family": "vela", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}`)
				}))
			})
			It(`Invoke GetClusterNetworkProfile successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetClusterNetworkProfileOptions model
				getClusterNetworkProfileOptionsModel := new(vpcv1.GetClusterNetworkProfileOptions)
				getClusterNetworkProfileOptionsModel.Name = core.StringPtr("h100")
				getClusterNetworkProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetClusterNetworkProfileWithContext(ctx, getClusterNetworkProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetClusterNetworkProfile(getClusterNetworkProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetClusterNetworkProfileWithContext(ctx, getClusterNetworkProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkProfilePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"family": "vela", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}`)
				}))
			})
			It(`Invoke GetClusterNetworkProfile successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetClusterNetworkProfile(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetClusterNetworkProfileOptions model
				getClusterNetworkProfileOptionsModel := new(vpcv1.GetClusterNetworkProfileOptions)
				getClusterNetworkProfileOptionsModel.Name = core.StringPtr("h100")
				getClusterNetworkProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetClusterNetworkProfile(getClusterNetworkProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetClusterNetworkProfile with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkProfileOptions model
				getClusterNetworkProfileOptionsModel := new(vpcv1.GetClusterNetworkProfileOptions)
				getClusterNetworkProfileOptionsModel.Name = core.StringPtr("h100")
				getClusterNetworkProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetClusterNetworkProfile(getClusterNetworkProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetClusterNetworkProfileOptions model with no property values
				getClusterNetworkProfileOptionsModelNew := new(vpcv1.GetClusterNetworkProfileOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetClusterNetworkProfile(getClusterNetworkProfileOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetClusterNetworkProfile successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkProfileOptions model
				getClusterNetworkProfileOptionsModel := new(vpcv1.GetClusterNetworkProfileOptions)
				getClusterNetworkProfileOptionsModel.Name = core.StringPtr("h100")
				getClusterNetworkProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetClusterNetworkProfile(getClusterNetworkProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListClusterNetworks(listClusterNetworksOptions *ListClusterNetworksOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listClusterNetworksPath := "/cluster_networks"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworksPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListClusterNetworks with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworksOptions model
				listClusterNetworksOptionsModel := new(vpcv1.ListClusterNetworksOptions)
				listClusterNetworksOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworksOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworksOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listClusterNetworksOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworksOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworksOptionsModel.VPCID = core.StringPtr("testString")
				listClusterNetworksOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listClusterNetworksOptionsModel.VPCName = core.StringPtr("my-vpc")
				listClusterNetworksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListClusterNetworks(listClusterNetworksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListClusterNetworks(listClusterNetworksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListClusterNetworks(listClusterNetworksOptions *ListClusterNetworksOptions)`, func() {
		version := "2024-06-23"
		listClusterNetworksPath := "/cluster_networks"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworksPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cluster_networks": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListClusterNetworks successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListClusterNetworksOptions model
				listClusterNetworksOptionsModel := new(vpcv1.ListClusterNetworksOptions)
				listClusterNetworksOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworksOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworksOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listClusterNetworksOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworksOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworksOptionsModel.VPCID = core.StringPtr("testString")
				listClusterNetworksOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listClusterNetworksOptionsModel.VPCName = core.StringPtr("my-vpc")
				listClusterNetworksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListClusterNetworksWithContext(ctx, listClusterNetworksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListClusterNetworks(listClusterNetworksOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListClusterNetworksWithContext(ctx, listClusterNetworksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworksPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cluster_networks": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListClusterNetworks successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListClusterNetworks(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListClusterNetworksOptions model
				listClusterNetworksOptionsModel := new(vpcv1.ListClusterNetworksOptions)
				listClusterNetworksOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworksOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworksOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listClusterNetworksOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworksOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworksOptionsModel.VPCID = core.StringPtr("testString")
				listClusterNetworksOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listClusterNetworksOptionsModel.VPCName = core.StringPtr("my-vpc")
				listClusterNetworksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListClusterNetworks(listClusterNetworksOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListClusterNetworks with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworksOptions model
				listClusterNetworksOptionsModel := new(vpcv1.ListClusterNetworksOptions)
				listClusterNetworksOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworksOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworksOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listClusterNetworksOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworksOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworksOptionsModel.VPCID = core.StringPtr("testString")
				listClusterNetworksOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listClusterNetworksOptionsModel.VPCName = core.StringPtr("my-vpc")
				listClusterNetworksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListClusterNetworks(listClusterNetworksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListClusterNetworks successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworksOptions model
				listClusterNetworksOptionsModel := new(vpcv1.ListClusterNetworksOptions)
				listClusterNetworksOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworksOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworksOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listClusterNetworksOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworksOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworksOptionsModel.VPCID = core.StringPtr("testString")
				listClusterNetworksOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listClusterNetworksOptionsModel.VPCName = core.StringPtr("my-vpc")
				listClusterNetworksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListClusterNetworks(listClusterNetworksOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ClusterNetworkCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ClusterNetworkCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ClusterNetworkCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworksPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"cluster_networks":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573","id":"0717-da0df18c-7598-4633-a648-fdaac28a5573","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100","name":"h100","resource_type":"cluster_network_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"cluster_network","subnet_prefixes":[{"allocation_policy":"auto","cidr":"10.0.0.0/24"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"cluster_networks":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573","id":"0717-da0df18c-7598-4633-a648-fdaac28a5573","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100","name":"h100","resource_type":"cluster_network_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"cluster_network","subnet_prefixes":[{"allocation_policy":"auto","cidr":"10.0.0.0/24"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use ClusterNetworksPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listClusterNetworksOptionsModel := &vpcv1.ListClusterNetworksOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					Name:            core.StringPtr("my-name"),
					Sort:            core.StringPtr("name"),
					VPCID:           core.StringPtr("testString"),
					VPCCRN:          core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:         core.StringPtr("my-vpc"),
				}

				pager, err := vpcService.NewClusterNetworksPager(listClusterNetworksOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.ClusterNetwork
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use ClusterNetworksPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listClusterNetworksOptionsModel := &vpcv1.ListClusterNetworksOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					Name:            core.StringPtr("my-name"),
					Sort:            core.StringPtr("name"),
					VPCID:           core.StringPtr("testString"),
					VPCCRN:          core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:         core.StringPtr("my-vpc"),
				}

				pager, err := vpcService.NewClusterNetworksPager(listClusterNetworksOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateClusterNetwork(createClusterNetworkOptions *CreateClusterNetworkOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createClusterNetworkPath := "/cluster_networks"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateClusterNetwork with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkProfileIdentityByName model
				clusterNetworkProfileIdentityModel := new(vpcv1.ClusterNetworkProfileIdentityByName)
				clusterNetworkProfileIdentityModel.Name = core.StringPtr("h100")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the ClusterNetworkSubnetPrefixPrototype model
				clusterNetworkSubnetPrefixPrototypeModel := new(vpcv1.ClusterNetworkSubnetPrefixPrototype)
				clusterNetworkSubnetPrefixPrototypeModel.CIDR = core.StringPtr("10.0.0.0/24")

				// Construct an instance of the CreateClusterNetworkOptions model
				createClusterNetworkOptionsModel := new(vpcv1.CreateClusterNetworkOptions)
				createClusterNetworkOptionsModel.Profile = clusterNetworkProfileIdentityModel
				createClusterNetworkOptionsModel.VPC = vpcIdentityModel
				createClusterNetworkOptionsModel.Zone = zoneIdentityModel
				createClusterNetworkOptionsModel.Name = core.StringPtr("my-cluster-network")
				createClusterNetworkOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createClusterNetworkOptionsModel.SubnetPrefixes = []vpcv1.ClusterNetworkSubnetPrefixPrototype{*clusterNetworkSubnetPrefixPrototypeModel}
				createClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateClusterNetwork(createClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateClusterNetwork(createClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateClusterNetwork(createClusterNetworkOptions *CreateClusterNetworkOptions)`, func() {
		version := "2024-06-23"
		createClusterNetworkPath := "/cluster_networks"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateClusterNetwork successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ClusterNetworkProfileIdentityByName model
				clusterNetworkProfileIdentityModel := new(vpcv1.ClusterNetworkProfileIdentityByName)
				clusterNetworkProfileIdentityModel.Name = core.StringPtr("h100")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the ClusterNetworkSubnetPrefixPrototype model
				clusterNetworkSubnetPrefixPrototypeModel := new(vpcv1.ClusterNetworkSubnetPrefixPrototype)
				clusterNetworkSubnetPrefixPrototypeModel.CIDR = core.StringPtr("10.0.0.0/24")

				// Construct an instance of the CreateClusterNetworkOptions model
				createClusterNetworkOptionsModel := new(vpcv1.CreateClusterNetworkOptions)
				createClusterNetworkOptionsModel.Profile = clusterNetworkProfileIdentityModel
				createClusterNetworkOptionsModel.VPC = vpcIdentityModel
				createClusterNetworkOptionsModel.Zone = zoneIdentityModel
				createClusterNetworkOptionsModel.Name = core.StringPtr("my-cluster-network")
				createClusterNetworkOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createClusterNetworkOptionsModel.SubnetPrefixes = []vpcv1.ClusterNetworkSubnetPrefixPrototype{*clusterNetworkSubnetPrefixPrototypeModel}
				createClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateClusterNetworkWithContext(ctx, createClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateClusterNetwork(createClusterNetworkOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateClusterNetworkWithContext(ctx, createClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateClusterNetwork successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateClusterNetwork(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ClusterNetworkProfileIdentityByName model
				clusterNetworkProfileIdentityModel := new(vpcv1.ClusterNetworkProfileIdentityByName)
				clusterNetworkProfileIdentityModel.Name = core.StringPtr("h100")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the ClusterNetworkSubnetPrefixPrototype model
				clusterNetworkSubnetPrefixPrototypeModel := new(vpcv1.ClusterNetworkSubnetPrefixPrototype)
				clusterNetworkSubnetPrefixPrototypeModel.CIDR = core.StringPtr("10.0.0.0/24")

				// Construct an instance of the CreateClusterNetworkOptions model
				createClusterNetworkOptionsModel := new(vpcv1.CreateClusterNetworkOptions)
				createClusterNetworkOptionsModel.Profile = clusterNetworkProfileIdentityModel
				createClusterNetworkOptionsModel.VPC = vpcIdentityModel
				createClusterNetworkOptionsModel.Zone = zoneIdentityModel
				createClusterNetworkOptionsModel.Name = core.StringPtr("my-cluster-network")
				createClusterNetworkOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createClusterNetworkOptionsModel.SubnetPrefixes = []vpcv1.ClusterNetworkSubnetPrefixPrototype{*clusterNetworkSubnetPrefixPrototypeModel}
				createClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateClusterNetwork(createClusterNetworkOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateClusterNetwork with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkProfileIdentityByName model
				clusterNetworkProfileIdentityModel := new(vpcv1.ClusterNetworkProfileIdentityByName)
				clusterNetworkProfileIdentityModel.Name = core.StringPtr("h100")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the ClusterNetworkSubnetPrefixPrototype model
				clusterNetworkSubnetPrefixPrototypeModel := new(vpcv1.ClusterNetworkSubnetPrefixPrototype)
				clusterNetworkSubnetPrefixPrototypeModel.CIDR = core.StringPtr("10.0.0.0/24")

				// Construct an instance of the CreateClusterNetworkOptions model
				createClusterNetworkOptionsModel := new(vpcv1.CreateClusterNetworkOptions)
				createClusterNetworkOptionsModel.Profile = clusterNetworkProfileIdentityModel
				createClusterNetworkOptionsModel.VPC = vpcIdentityModel
				createClusterNetworkOptionsModel.Zone = zoneIdentityModel
				createClusterNetworkOptionsModel.Name = core.StringPtr("my-cluster-network")
				createClusterNetworkOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createClusterNetworkOptionsModel.SubnetPrefixes = []vpcv1.ClusterNetworkSubnetPrefixPrototype{*clusterNetworkSubnetPrefixPrototypeModel}
				createClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateClusterNetwork(createClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateClusterNetworkOptions model with no property values
				createClusterNetworkOptionsModelNew := new(vpcv1.CreateClusterNetworkOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateClusterNetwork(createClusterNetworkOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateClusterNetwork successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkProfileIdentityByName model
				clusterNetworkProfileIdentityModel := new(vpcv1.ClusterNetworkProfileIdentityByName)
				clusterNetworkProfileIdentityModel.Name = core.StringPtr("h100")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the ClusterNetworkSubnetPrefixPrototype model
				clusterNetworkSubnetPrefixPrototypeModel := new(vpcv1.ClusterNetworkSubnetPrefixPrototype)
				clusterNetworkSubnetPrefixPrototypeModel.CIDR = core.StringPtr("10.0.0.0/24")

				// Construct an instance of the CreateClusterNetworkOptions model
				createClusterNetworkOptionsModel := new(vpcv1.CreateClusterNetworkOptions)
				createClusterNetworkOptionsModel.Profile = clusterNetworkProfileIdentityModel
				createClusterNetworkOptionsModel.VPC = vpcIdentityModel
				createClusterNetworkOptionsModel.Zone = zoneIdentityModel
				createClusterNetworkOptionsModel.Name = core.StringPtr("my-cluster-network")
				createClusterNetworkOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createClusterNetworkOptionsModel.SubnetPrefixes = []vpcv1.ClusterNetworkSubnetPrefixPrototype{*clusterNetworkSubnetPrefixPrototypeModel}
				createClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateClusterNetwork(createClusterNetworkOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListClusterNetworkInterfaces(listClusterNetworkInterfacesOptions *ListClusterNetworkInterfacesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listClusterNetworkInterfacesPath := "/cluster_networks/testString/interfaces"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListClusterNetworkInterfaces with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworkInterfacesOptions model
				listClusterNetworkInterfacesOptionsModel := new(vpcv1.ListClusterNetworkInterfacesOptions)
				listClusterNetworkInterfacesOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkInterfacesOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkInterfacesOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListClusterNetworkInterfaces(listClusterNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListClusterNetworkInterfaces(listClusterNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListClusterNetworkInterfaces(listClusterNetworkInterfacesOptions *ListClusterNetworkInterfacesOptions)`, func() {
		version := "2024-06-23"
		listClusterNetworkInterfacesPath := "/cluster_networks/testString/interfaces"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListClusterNetworkInterfaces successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListClusterNetworkInterfacesOptions model
				listClusterNetworkInterfacesOptionsModel := new(vpcv1.ListClusterNetworkInterfacesOptions)
				listClusterNetworkInterfacesOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkInterfacesOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkInterfacesOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListClusterNetworkInterfacesWithContext(ctx, listClusterNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListClusterNetworkInterfaces(listClusterNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListClusterNetworkInterfacesWithContext(ctx, listClusterNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListClusterNetworkInterfaces successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListClusterNetworkInterfaces(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListClusterNetworkInterfacesOptions model
				listClusterNetworkInterfacesOptionsModel := new(vpcv1.ListClusterNetworkInterfacesOptions)
				listClusterNetworkInterfacesOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkInterfacesOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkInterfacesOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListClusterNetworkInterfaces(listClusterNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListClusterNetworkInterfaces with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworkInterfacesOptions model
				listClusterNetworkInterfacesOptionsModel := new(vpcv1.ListClusterNetworkInterfacesOptions)
				listClusterNetworkInterfacesOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkInterfacesOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkInterfacesOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListClusterNetworkInterfaces(listClusterNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListClusterNetworkInterfacesOptions model with no property values
				listClusterNetworkInterfacesOptionsModelNew := new(vpcv1.ListClusterNetworkInterfacesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListClusterNetworkInterfaces(listClusterNetworkInterfacesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListClusterNetworkInterfaces successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworkInterfacesOptions model
				listClusterNetworkInterfacesOptionsModel := new(vpcv1.ListClusterNetworkInterfacesOptions)
				listClusterNetworkInterfacesOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkInterfacesOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkInterfacesOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListClusterNetworkInterfaces(listClusterNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ClusterNetworkInterfaceCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ClusterNetworkInterfaceCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ClusterNetworkInterfaceCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-cluster-network-interface","primary_ip":{"address":"10.1.0.6","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117","id":"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117","name":"my-cluster-network-subnet-reserved-ip","resource_type":"cluster_network_subnet_reserved_ip"},"resource_type":"cluster_network_interface","subnet":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet"},"target":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-cluster-network-interface","primary_ip":{"address":"10.1.0.6","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117","id":"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117","name":"my-cluster-network-subnet-reserved-ip","resource_type":"cluster_network_subnet_reserved_ip"},"resource_type":"cluster_network_interface","subnet":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet"},"target":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use ClusterNetworkInterfacesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listClusterNetworkInterfacesOptionsModel := &vpcv1.ListClusterNetworkInterfacesOptions{
					ClusterNetworkID: core.StringPtr("testString"),
					Limit:            core.Int64Ptr(int64(10)),
					Name:             core.StringPtr("my-name"),
					Sort:             core.StringPtr("name"),
				}

				pager, err := vpcService.NewClusterNetworkInterfacesPager(listClusterNetworkInterfacesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.ClusterNetworkInterface
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use ClusterNetworkInterfacesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listClusterNetworkInterfacesOptionsModel := &vpcv1.ListClusterNetworkInterfacesOptions{
					ClusterNetworkID: core.StringPtr("testString"),
					Limit:            core.Int64Ptr(int64(10)),
					Name:             core.StringPtr("my-name"),
					Sort:             core.StringPtr("name"),
				}

				pager, err := vpcService.NewClusterNetworkInterfacesPager(listClusterNetworkInterfacesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateClusterNetworkInterface(createClusterNetworkInterfaceOptions *CreateClusterNetworkInterfaceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createClusterNetworkInterfacePath := "/cluster_networks/testString/interfaces"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkInterfacePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateClusterNetworkInterface with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the CreateClusterNetworkInterfaceOptions model
				createClusterNetworkInterfaceOptionsModel := new(vpcv1.CreateClusterNetworkInterfaceOptions)
				createClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkInterfaceOptionsModel.Name = core.StringPtr("my-cluster-network-interface")
				createClusterNetworkInterfaceOptionsModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				createClusterNetworkInterfaceOptionsModel.Subnet = clusterNetworkSubnetIdentityModel
				createClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateClusterNetworkInterface(createClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateClusterNetworkInterface(createClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateClusterNetworkInterface(createClusterNetworkInterfaceOptions *CreateClusterNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		createClusterNetworkInterfacePath := "/cluster_networks/testString/interfaces"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkInterfacePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateClusterNetworkInterface successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the CreateClusterNetworkInterfaceOptions model
				createClusterNetworkInterfaceOptionsModel := new(vpcv1.CreateClusterNetworkInterfaceOptions)
				createClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkInterfaceOptionsModel.Name = core.StringPtr("my-cluster-network-interface")
				createClusterNetworkInterfaceOptionsModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				createClusterNetworkInterfaceOptionsModel.Subnet = clusterNetworkSubnetIdentityModel
				createClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateClusterNetworkInterfaceWithContext(ctx, createClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateClusterNetworkInterface(createClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateClusterNetworkInterfaceWithContext(ctx, createClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkInterfacePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateClusterNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateClusterNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the CreateClusterNetworkInterfaceOptions model
				createClusterNetworkInterfaceOptionsModel := new(vpcv1.CreateClusterNetworkInterfaceOptions)
				createClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkInterfaceOptionsModel.Name = core.StringPtr("my-cluster-network-interface")
				createClusterNetworkInterfaceOptionsModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				createClusterNetworkInterfaceOptionsModel.Subnet = clusterNetworkSubnetIdentityModel
				createClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateClusterNetworkInterface(createClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateClusterNetworkInterface with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the CreateClusterNetworkInterfaceOptions model
				createClusterNetworkInterfaceOptionsModel := new(vpcv1.CreateClusterNetworkInterfaceOptions)
				createClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkInterfaceOptionsModel.Name = core.StringPtr("my-cluster-network-interface")
				createClusterNetworkInterfaceOptionsModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				createClusterNetworkInterfaceOptionsModel.Subnet = clusterNetworkSubnetIdentityModel
				createClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateClusterNetworkInterface(createClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateClusterNetworkInterfaceOptions model with no property values
				createClusterNetworkInterfaceOptionsModelNew := new(vpcv1.CreateClusterNetworkInterfaceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateClusterNetworkInterface(createClusterNetworkInterfaceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateClusterNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the CreateClusterNetworkInterfaceOptions model
				createClusterNetworkInterfaceOptionsModel := new(vpcv1.CreateClusterNetworkInterfaceOptions)
				createClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkInterfaceOptionsModel.Name = core.StringPtr("my-cluster-network-interface")
				createClusterNetworkInterfaceOptionsModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				createClusterNetworkInterfaceOptionsModel.Subnet = clusterNetworkSubnetIdentityModel
				createClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateClusterNetworkInterface(createClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteClusterNetworkInterface(deleteClusterNetworkInterfaceOptions *DeleteClusterNetworkInterfaceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deleteClusterNetworkInterfacePath := "/cluster_networks/testString/interfaces/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteClusterNetworkInterfacePath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeleteClusterNetworkInterface with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteClusterNetworkInterfaceOptions model
				deleteClusterNetworkInterfaceOptionsModel := new(vpcv1.DeleteClusterNetworkInterfaceOptions)
				deleteClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeleteClusterNetworkInterface(deleteClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeleteClusterNetworkInterface(deleteClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteClusterNetworkInterface(deleteClusterNetworkInterfaceOptions *DeleteClusterNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		deleteClusterNetworkInterfacePath := "/cluster_networks/testString/interfaces/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteClusterNetworkInterfacePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke DeleteClusterNetworkInterface successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeleteClusterNetworkInterfaceOptions model
				deleteClusterNetworkInterfaceOptionsModel := new(vpcv1.DeleteClusterNetworkInterfaceOptions)
				deleteClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeleteClusterNetworkInterfaceWithContext(ctx, deleteClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeleteClusterNetworkInterface(deleteClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeleteClusterNetworkInterfaceWithContext(ctx, deleteClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteClusterNetworkInterfacePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke DeleteClusterNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeleteClusterNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeleteClusterNetworkInterfaceOptions model
				deleteClusterNetworkInterfaceOptionsModel := new(vpcv1.DeleteClusterNetworkInterfaceOptions)
				deleteClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeleteClusterNetworkInterface(deleteClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeleteClusterNetworkInterface with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteClusterNetworkInterfaceOptions model
				deleteClusterNetworkInterfaceOptionsModel := new(vpcv1.DeleteClusterNetworkInterfaceOptions)
				deleteClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeleteClusterNetworkInterface(deleteClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeleteClusterNetworkInterfaceOptions model with no property values
				deleteClusterNetworkInterfaceOptionsModelNew := new(vpcv1.DeleteClusterNetworkInterfaceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeleteClusterNetworkInterface(deleteClusterNetworkInterfaceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteClusterNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteClusterNetworkInterfaceOptions model
				deleteClusterNetworkInterfaceOptionsModel := new(vpcv1.DeleteClusterNetworkInterfaceOptions)
				deleteClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeleteClusterNetworkInterface(deleteClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetClusterNetworkInterface(getClusterNetworkInterfaceOptions *GetClusterNetworkInterfaceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getClusterNetworkInterfacePath := "/cluster_networks/testString/interfaces/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkInterfacePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetClusterNetworkInterface with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkInterfaceOptions model
				getClusterNetworkInterfaceOptionsModel := new(vpcv1.GetClusterNetworkInterfaceOptions)
				getClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetClusterNetworkInterface(getClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetClusterNetworkInterface(getClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetClusterNetworkInterface(getClusterNetworkInterfaceOptions *GetClusterNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		getClusterNetworkInterfacePath := "/cluster_networks/testString/interfaces/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkInterfacePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetClusterNetworkInterface successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetClusterNetworkInterfaceOptions model
				getClusterNetworkInterfaceOptionsModel := new(vpcv1.GetClusterNetworkInterfaceOptions)
				getClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetClusterNetworkInterfaceWithContext(ctx, getClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetClusterNetworkInterface(getClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetClusterNetworkInterfaceWithContext(ctx, getClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkInterfacePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetClusterNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetClusterNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetClusterNetworkInterfaceOptions model
				getClusterNetworkInterfaceOptionsModel := new(vpcv1.GetClusterNetworkInterfaceOptions)
				getClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetClusterNetworkInterface(getClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetClusterNetworkInterface with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkInterfaceOptions model
				getClusterNetworkInterfaceOptionsModel := new(vpcv1.GetClusterNetworkInterfaceOptions)
				getClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetClusterNetworkInterface(getClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetClusterNetworkInterfaceOptions model with no property values
				getClusterNetworkInterfaceOptionsModelNew := new(vpcv1.GetClusterNetworkInterfaceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetClusterNetworkInterface(getClusterNetworkInterfaceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetClusterNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkInterfaceOptions model
				getClusterNetworkInterfaceOptionsModel := new(vpcv1.GetClusterNetworkInterfaceOptions)
				getClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetClusterNetworkInterface(getClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateClusterNetworkInterface(updateClusterNetworkInterfaceOptions *UpdateClusterNetworkInterfaceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateClusterNetworkInterfacePath := "/cluster_networks/testString/interfaces/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateClusterNetworkInterfacePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateClusterNetworkInterface with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkInterfacePatch model
				clusterNetworkInterfacePatchModel := new(vpcv1.ClusterNetworkInterfacePatch)
				clusterNetworkInterfacePatchModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePatchModel.Name = core.StringPtr("my-cluster-network-interface")
				clusterNetworkInterfacePatchModelAsPatch, asPatchErr := clusterNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkInterfaceOptions model
				updateClusterNetworkInterfaceOptionsModel := new(vpcv1.UpdateClusterNetworkInterfaceOptions)
				updateClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkInterfaceOptionsModel.ClusterNetworkInterfacePatch = clusterNetworkInterfacePatchModelAsPatch
				updateClusterNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateClusterNetworkInterface(updateClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateClusterNetworkInterface(updateClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateClusterNetworkInterface(updateClusterNetworkInterfaceOptions *UpdateClusterNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		updateClusterNetworkInterfacePath := "/cluster_networks/testString/interfaces/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateClusterNetworkInterfacePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateClusterNetworkInterface successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ClusterNetworkInterfacePatch model
				clusterNetworkInterfacePatchModel := new(vpcv1.ClusterNetworkInterfacePatch)
				clusterNetworkInterfacePatchModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePatchModel.Name = core.StringPtr("my-cluster-network-interface")
				clusterNetworkInterfacePatchModelAsPatch, asPatchErr := clusterNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkInterfaceOptions model
				updateClusterNetworkInterfaceOptionsModel := new(vpcv1.UpdateClusterNetworkInterfaceOptions)
				updateClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkInterfaceOptionsModel.ClusterNetworkInterfacePatch = clusterNetworkInterfacePatchModelAsPatch
				updateClusterNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateClusterNetworkInterfaceWithContext(ctx, updateClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateClusterNetworkInterface(updateClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateClusterNetworkInterfaceWithContext(ctx, updateClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateClusterNetworkInterfacePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateClusterNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateClusterNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ClusterNetworkInterfacePatch model
				clusterNetworkInterfacePatchModel := new(vpcv1.ClusterNetworkInterfacePatch)
				clusterNetworkInterfacePatchModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePatchModel.Name = core.StringPtr("my-cluster-network-interface")
				clusterNetworkInterfacePatchModelAsPatch, asPatchErr := clusterNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkInterfaceOptions model
				updateClusterNetworkInterfaceOptionsModel := new(vpcv1.UpdateClusterNetworkInterfaceOptions)
				updateClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkInterfaceOptionsModel.ClusterNetworkInterfacePatch = clusterNetworkInterfacePatchModelAsPatch
				updateClusterNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateClusterNetworkInterface(updateClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateClusterNetworkInterface with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkInterfacePatch model
				clusterNetworkInterfacePatchModel := new(vpcv1.ClusterNetworkInterfacePatch)
				clusterNetworkInterfacePatchModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePatchModel.Name = core.StringPtr("my-cluster-network-interface")
				clusterNetworkInterfacePatchModelAsPatch, asPatchErr := clusterNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkInterfaceOptions model
				updateClusterNetworkInterfaceOptionsModel := new(vpcv1.UpdateClusterNetworkInterfaceOptions)
				updateClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkInterfaceOptionsModel.ClusterNetworkInterfacePatch = clusterNetworkInterfacePatchModelAsPatch
				updateClusterNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateClusterNetworkInterface(updateClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateClusterNetworkInterfaceOptions model with no property values
				updateClusterNetworkInterfaceOptionsModelNew := new(vpcv1.UpdateClusterNetworkInterfaceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateClusterNetworkInterface(updateClusterNetworkInterfaceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateClusterNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkInterfacePatch model
				clusterNetworkInterfacePatchModel := new(vpcv1.ClusterNetworkInterfacePatch)
				clusterNetworkInterfacePatchModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePatchModel.Name = core.StringPtr("my-cluster-network-interface")
				clusterNetworkInterfacePatchModelAsPatch, asPatchErr := clusterNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkInterfaceOptions model
				updateClusterNetworkInterfaceOptionsModel := new(vpcv1.UpdateClusterNetworkInterfaceOptions)
				updateClusterNetworkInterfaceOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkInterfaceOptionsModel.ClusterNetworkInterfacePatch = clusterNetworkInterfacePatchModelAsPatch
				updateClusterNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateClusterNetworkInterface(updateClusterNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListClusterNetworkSubnets(listClusterNetworkSubnetsOptions *ListClusterNetworkSubnetsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listClusterNetworkSubnetsPath := "/cluster_networks/testString/subnets"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkSubnetsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListClusterNetworkSubnets with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworkSubnetsOptions model
				listClusterNetworkSubnetsOptionsModel := new(vpcv1.ListClusterNetworkSubnetsOptions)
				listClusterNetworkSubnetsOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkSubnetsOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkSubnetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkSubnetsOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkSubnetsOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkSubnetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListClusterNetworkSubnets(listClusterNetworkSubnetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListClusterNetworkSubnets(listClusterNetworkSubnetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListClusterNetworkSubnets(listClusterNetworkSubnetsOptions *ListClusterNetworkSubnetsOptions)`, func() {
		version := "2024-06-23"
		listClusterNetworkSubnetsPath := "/cluster_networks/testString/subnets"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkSubnetsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListClusterNetworkSubnets successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListClusterNetworkSubnetsOptions model
				listClusterNetworkSubnetsOptionsModel := new(vpcv1.ListClusterNetworkSubnetsOptions)
				listClusterNetworkSubnetsOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkSubnetsOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkSubnetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkSubnetsOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkSubnetsOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkSubnetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListClusterNetworkSubnetsWithContext(ctx, listClusterNetworkSubnetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListClusterNetworkSubnets(listClusterNetworkSubnetsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListClusterNetworkSubnetsWithContext(ctx, listClusterNetworkSubnetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkSubnetsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListClusterNetworkSubnets successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListClusterNetworkSubnets(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListClusterNetworkSubnetsOptions model
				listClusterNetworkSubnetsOptionsModel := new(vpcv1.ListClusterNetworkSubnetsOptions)
				listClusterNetworkSubnetsOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkSubnetsOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkSubnetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkSubnetsOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkSubnetsOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkSubnetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListClusterNetworkSubnets(listClusterNetworkSubnetsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListClusterNetworkSubnets with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworkSubnetsOptions model
				listClusterNetworkSubnetsOptionsModel := new(vpcv1.ListClusterNetworkSubnetsOptions)
				listClusterNetworkSubnetsOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkSubnetsOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkSubnetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkSubnetsOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkSubnetsOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkSubnetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListClusterNetworkSubnets(listClusterNetworkSubnetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListClusterNetworkSubnetsOptions model with no property values
				listClusterNetworkSubnetsOptionsModelNew := new(vpcv1.ListClusterNetworkSubnetsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListClusterNetworkSubnets(listClusterNetworkSubnetsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListClusterNetworkSubnets successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworkSubnetsOptions model
				listClusterNetworkSubnetsOptionsModel := new(vpcv1.ListClusterNetworkSubnetsOptions)
				listClusterNetworkSubnetsOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkSubnetsOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkSubnetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkSubnetsOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkSubnetsOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkSubnetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListClusterNetworkSubnets(listClusterNetworkSubnetsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ClusterNetworkSubnetCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ClusterNetworkSubnetCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ClusterNetworkSubnetCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkSubnetsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"subnets":[{"available_ipv4_address_count":15,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","ip_version":"ipv4","ipv4_cidr_block":"10.0.0.0/24","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet","total_ipv4_address_count":256}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"subnets":[{"available_ipv4_address_count":15,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","ip_version":"ipv4","ipv4_cidr_block":"10.0.0.0/24","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet","total_ipv4_address_count":256}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use ClusterNetworkSubnetsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listClusterNetworkSubnetsOptionsModel := &vpcv1.ListClusterNetworkSubnetsOptions{
					ClusterNetworkID: core.StringPtr("testString"),
					Limit:            core.Int64Ptr(int64(10)),
					Name:             core.StringPtr("my-name"),
					Sort:             core.StringPtr("name"),
				}

				pager, err := vpcService.NewClusterNetworkSubnetsPager(listClusterNetworkSubnetsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.ClusterNetworkSubnet
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use ClusterNetworkSubnetsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listClusterNetworkSubnetsOptionsModel := &vpcv1.ListClusterNetworkSubnetsOptions{
					ClusterNetworkID: core.StringPtr("testString"),
					Limit:            core.Int64Ptr(int64(10)),
					Name:             core.StringPtr("my-name"),
					Sort:             core.StringPtr("name"),
				}

				pager, err := vpcService.NewClusterNetworkSubnetsPager(listClusterNetworkSubnetsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateClusterNetworkSubnet(createClusterNetworkSubnetOptions *CreateClusterNetworkSubnetOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createClusterNetworkSubnetPath := "/cluster_networks/testString/subnets"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkSubnetPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateClusterNetworkSubnet with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype model
				clusterNetworkSubnetPrototypeModel := new(vpcv1.ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype)
				clusterNetworkSubnetPrototypeModel.IPVersion = core.StringPtr("ipv4")
				clusterNetworkSubnetPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet")
				clusterNetworkSubnetPrototypeModel.TotalIpv4AddressCount = core.Int64Ptr(int64(256))

				// Construct an instance of the CreateClusterNetworkSubnetOptions model
				createClusterNetworkSubnetOptionsModel := new(vpcv1.CreateClusterNetworkSubnetOptions)
				createClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkSubnetOptionsModel.ClusterNetworkSubnetPrototype = clusterNetworkSubnetPrototypeModel
				createClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateClusterNetworkSubnet(createClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateClusterNetworkSubnet(createClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateClusterNetworkSubnet(createClusterNetworkSubnetOptions *CreateClusterNetworkSubnetOptions)`, func() {
		version := "2024-06-23"
		createClusterNetworkSubnetPath := "/cluster_networks/testString/subnets"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkSubnetPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}`)
				}))
			})
			It(`Invoke CreateClusterNetworkSubnet successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype model
				clusterNetworkSubnetPrototypeModel := new(vpcv1.ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype)
				clusterNetworkSubnetPrototypeModel.IPVersion = core.StringPtr("ipv4")
				clusterNetworkSubnetPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet")
				clusterNetworkSubnetPrototypeModel.TotalIpv4AddressCount = core.Int64Ptr(int64(256))

				// Construct an instance of the CreateClusterNetworkSubnetOptions model
				createClusterNetworkSubnetOptionsModel := new(vpcv1.CreateClusterNetworkSubnetOptions)
				createClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkSubnetOptionsModel.ClusterNetworkSubnetPrototype = clusterNetworkSubnetPrototypeModel
				createClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateClusterNetworkSubnetWithContext(ctx, createClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateClusterNetworkSubnet(createClusterNetworkSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateClusterNetworkSubnetWithContext(ctx, createClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkSubnetPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}`)
				}))
			})
			It(`Invoke CreateClusterNetworkSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateClusterNetworkSubnet(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype model
				clusterNetworkSubnetPrototypeModel := new(vpcv1.ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype)
				clusterNetworkSubnetPrototypeModel.IPVersion = core.StringPtr("ipv4")
				clusterNetworkSubnetPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet")
				clusterNetworkSubnetPrototypeModel.TotalIpv4AddressCount = core.Int64Ptr(int64(256))

				// Construct an instance of the CreateClusterNetworkSubnetOptions model
				createClusterNetworkSubnetOptionsModel := new(vpcv1.CreateClusterNetworkSubnetOptions)
				createClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkSubnetOptionsModel.ClusterNetworkSubnetPrototype = clusterNetworkSubnetPrototypeModel
				createClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateClusterNetworkSubnet(createClusterNetworkSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateClusterNetworkSubnet with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype model
				clusterNetworkSubnetPrototypeModel := new(vpcv1.ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype)
				clusterNetworkSubnetPrototypeModel.IPVersion = core.StringPtr("ipv4")
				clusterNetworkSubnetPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet")
				clusterNetworkSubnetPrototypeModel.TotalIpv4AddressCount = core.Int64Ptr(int64(256))

				// Construct an instance of the CreateClusterNetworkSubnetOptions model
				createClusterNetworkSubnetOptionsModel := new(vpcv1.CreateClusterNetworkSubnetOptions)
				createClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkSubnetOptionsModel.ClusterNetworkSubnetPrototype = clusterNetworkSubnetPrototypeModel
				createClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateClusterNetworkSubnet(createClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateClusterNetworkSubnetOptions model with no property values
				createClusterNetworkSubnetOptionsModelNew := new(vpcv1.CreateClusterNetworkSubnetOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateClusterNetworkSubnet(createClusterNetworkSubnetOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateClusterNetworkSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype model
				clusterNetworkSubnetPrototypeModel := new(vpcv1.ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype)
				clusterNetworkSubnetPrototypeModel.IPVersion = core.StringPtr("ipv4")
				clusterNetworkSubnetPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet")
				clusterNetworkSubnetPrototypeModel.TotalIpv4AddressCount = core.Int64Ptr(int64(256))

				// Construct an instance of the CreateClusterNetworkSubnetOptions model
				createClusterNetworkSubnetOptionsModel := new(vpcv1.CreateClusterNetworkSubnetOptions)
				createClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkSubnetOptionsModel.ClusterNetworkSubnetPrototype = clusterNetworkSubnetPrototypeModel
				createClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateClusterNetworkSubnet(createClusterNetworkSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListClusterNetworkSubnetReservedIps(listClusterNetworkSubnetReservedIpsOptions *ListClusterNetworkSubnetReservedIpsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listClusterNetworkSubnetReservedIpsPath := "/cluster_networks/testString/subnets/testString/reserved_ips"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkSubnetReservedIpsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListClusterNetworkSubnetReservedIps with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworkSubnetReservedIpsOptions model
				listClusterNetworkSubnetReservedIpsOptionsModel := new(vpcv1.ListClusterNetworkSubnetReservedIpsOptions)
				listClusterNetworkSubnetReservedIpsOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkSubnetReservedIpsOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkSubnetReservedIpsOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkSubnetReservedIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListClusterNetworkSubnetReservedIps(listClusterNetworkSubnetReservedIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListClusterNetworkSubnetReservedIps(listClusterNetworkSubnetReservedIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListClusterNetworkSubnetReservedIps(listClusterNetworkSubnetReservedIpsOptions *ListClusterNetworkSubnetReservedIpsOptions)`, func() {
		version := "2024-06-23"
		listClusterNetworkSubnetReservedIpsPath := "/cluster_networks/testString/subnets/testString/reserved_ips"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkSubnetReservedIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "reserved_ips": [{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListClusterNetworkSubnetReservedIps successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListClusterNetworkSubnetReservedIpsOptions model
				listClusterNetworkSubnetReservedIpsOptionsModel := new(vpcv1.ListClusterNetworkSubnetReservedIpsOptions)
				listClusterNetworkSubnetReservedIpsOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkSubnetReservedIpsOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkSubnetReservedIpsOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkSubnetReservedIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListClusterNetworkSubnetReservedIpsWithContext(ctx, listClusterNetworkSubnetReservedIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListClusterNetworkSubnetReservedIps(listClusterNetworkSubnetReservedIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListClusterNetworkSubnetReservedIpsWithContext(ctx, listClusterNetworkSubnetReservedIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkSubnetReservedIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "reserved_ips": [{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListClusterNetworkSubnetReservedIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListClusterNetworkSubnetReservedIps(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListClusterNetworkSubnetReservedIpsOptions model
				listClusterNetworkSubnetReservedIpsOptionsModel := new(vpcv1.ListClusterNetworkSubnetReservedIpsOptions)
				listClusterNetworkSubnetReservedIpsOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkSubnetReservedIpsOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkSubnetReservedIpsOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkSubnetReservedIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListClusterNetworkSubnetReservedIps(listClusterNetworkSubnetReservedIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListClusterNetworkSubnetReservedIps with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworkSubnetReservedIpsOptions model
				listClusterNetworkSubnetReservedIpsOptionsModel := new(vpcv1.ListClusterNetworkSubnetReservedIpsOptions)
				listClusterNetworkSubnetReservedIpsOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkSubnetReservedIpsOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkSubnetReservedIpsOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkSubnetReservedIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListClusterNetworkSubnetReservedIps(listClusterNetworkSubnetReservedIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListClusterNetworkSubnetReservedIpsOptions model with no property values
				listClusterNetworkSubnetReservedIpsOptionsModelNew := new(vpcv1.ListClusterNetworkSubnetReservedIpsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListClusterNetworkSubnetReservedIps(listClusterNetworkSubnetReservedIpsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListClusterNetworkSubnetReservedIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListClusterNetworkSubnetReservedIpsOptions model
				listClusterNetworkSubnetReservedIpsOptionsModel := new(vpcv1.ListClusterNetworkSubnetReservedIpsOptions)
				listClusterNetworkSubnetReservedIpsOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.Start = core.StringPtr("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listClusterNetworkSubnetReservedIpsOptionsModel.Name = core.StringPtr("my-name")
				listClusterNetworkSubnetReservedIpsOptionsModel.Sort = core.StringPtr("name")
				listClusterNetworkSubnetReservedIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListClusterNetworkSubnetReservedIps(listClusterNetworkSubnetReservedIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ClusterNetworkSubnetReservedIPCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ClusterNetworkSubnetReservedIPCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ClusterNetworkSubnetReservedIPCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listClusterNetworkSubnetReservedIpsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"reserved_ips":[{"address":"10.1.0.6","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117","id":"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network-subnet-reserved-ip","owner":"user","resource_type":"cluster_network_subnet_reserved_ip","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","name":"my-cluster-network-interface","resource_type":"cluster_network_interface"}}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"reserved_ips":[{"address":"10.1.0.6","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117","id":"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network-subnet-reserved-ip","owner":"user","resource_type":"cluster_network_subnet_reserved_ip","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","name":"my-cluster-network-interface","resource_type":"cluster_network_interface"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use ClusterNetworkSubnetReservedIpsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listClusterNetworkSubnetReservedIpsOptionsModel := &vpcv1.ListClusterNetworkSubnetReservedIpsOptions{
					ClusterNetworkID:       core.StringPtr("testString"),
					ClusterNetworkSubnetID: core.StringPtr("testString"),
					Limit:                  core.Int64Ptr(int64(10)),
					Name:                   core.StringPtr("my-name"),
					Sort:                   core.StringPtr("name"),
				}

				pager, err := vpcService.NewClusterNetworkSubnetReservedIpsPager(listClusterNetworkSubnetReservedIpsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.ClusterNetworkSubnetReservedIP
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use ClusterNetworkSubnetReservedIpsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listClusterNetworkSubnetReservedIpsOptionsModel := &vpcv1.ListClusterNetworkSubnetReservedIpsOptions{
					ClusterNetworkID:       core.StringPtr("testString"),
					ClusterNetworkSubnetID: core.StringPtr("testString"),
					Limit:                  core.Int64Ptr(int64(10)),
					Name:                   core.StringPtr("my-name"),
					Sort:                   core.StringPtr("name"),
				}

				pager, err := vpcService.NewClusterNetworkSubnetReservedIpsPager(listClusterNetworkSubnetReservedIpsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateClusterNetworkSubnetReservedIP(createClusterNetworkSubnetReservedIPOptions *CreateClusterNetworkSubnetReservedIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createClusterNetworkSubnetReservedIPPath := "/cluster_networks/testString/subnets/testString/reserved_ips"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkSubnetReservedIPPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateClusterNetworkSubnetReservedIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateClusterNetworkSubnetReservedIPOptions model
				createClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.CreateClusterNetworkSubnetReservedIPOptions)
				createClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				createClusterNetworkSubnetReservedIPOptionsModel.Address = core.StringPtr("192.168.3.4")
				createClusterNetworkSubnetReservedIPOptionsModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")
				createClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateClusterNetworkSubnetReservedIP(createClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateClusterNetworkSubnetReservedIP(createClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateClusterNetworkSubnetReservedIP(createClusterNetworkSubnetReservedIPOptions *CreateClusterNetworkSubnetReservedIPOptions)`, func() {
		version := "2024-06-23"
		createClusterNetworkSubnetReservedIPPath := "/cluster_networks/testString/subnets/testString/reserved_ips"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkSubnetReservedIPPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}`)
				}))
			})
			It(`Invoke CreateClusterNetworkSubnetReservedIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the CreateClusterNetworkSubnetReservedIPOptions model
				createClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.CreateClusterNetworkSubnetReservedIPOptions)
				createClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				createClusterNetworkSubnetReservedIPOptionsModel.Address = core.StringPtr("192.168.3.4")
				createClusterNetworkSubnetReservedIPOptionsModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")
				createClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateClusterNetworkSubnetReservedIPWithContext(ctx, createClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateClusterNetworkSubnetReservedIP(createClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateClusterNetworkSubnetReservedIPWithContext(ctx, createClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkSubnetReservedIPPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}`)
				}))
			})
			It(`Invoke CreateClusterNetworkSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateClusterNetworkSubnetReservedIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the CreateClusterNetworkSubnetReservedIPOptions model
				createClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.CreateClusterNetworkSubnetReservedIPOptions)
				createClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				createClusterNetworkSubnetReservedIPOptionsModel.Address = core.StringPtr("192.168.3.4")
				createClusterNetworkSubnetReservedIPOptionsModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")
				createClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateClusterNetworkSubnetReservedIP(createClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateClusterNetworkSubnetReservedIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateClusterNetworkSubnetReservedIPOptions model
				createClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.CreateClusterNetworkSubnetReservedIPOptions)
				createClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				createClusterNetworkSubnetReservedIPOptionsModel.Address = core.StringPtr("192.168.3.4")
				createClusterNetworkSubnetReservedIPOptionsModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")
				createClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateClusterNetworkSubnetReservedIP(createClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateClusterNetworkSubnetReservedIPOptions model with no property values
				createClusterNetworkSubnetReservedIPOptionsModelNew := new(vpcv1.CreateClusterNetworkSubnetReservedIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateClusterNetworkSubnetReservedIP(createClusterNetworkSubnetReservedIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateClusterNetworkSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateClusterNetworkSubnetReservedIPOptions model
				createClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.CreateClusterNetworkSubnetReservedIPOptions)
				createClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				createClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				createClusterNetworkSubnetReservedIPOptionsModel.Address = core.StringPtr("192.168.3.4")
				createClusterNetworkSubnetReservedIPOptionsModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")
				createClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateClusterNetworkSubnetReservedIP(createClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteClusterNetworkSubnetReservedIP(deleteClusterNetworkSubnetReservedIPOptions *DeleteClusterNetworkSubnetReservedIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deleteClusterNetworkSubnetReservedIPPath := "/cluster_networks/testString/subnets/testString/reserved_ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteClusterNetworkSubnetReservedIPPath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeleteClusterNetworkSubnetReservedIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteClusterNetworkSubnetReservedIPOptions model
				deleteClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.DeleteClusterNetworkSubnetReservedIPOptions)
				deleteClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeleteClusterNetworkSubnetReservedIP(deleteClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeleteClusterNetworkSubnetReservedIP(deleteClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteClusterNetworkSubnetReservedIP(deleteClusterNetworkSubnetReservedIPOptions *DeleteClusterNetworkSubnetReservedIPOptions)`, func() {
		version := "2024-06-23"
		deleteClusterNetworkSubnetReservedIPPath := "/cluster_networks/testString/subnets/testString/reserved_ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteClusterNetworkSubnetReservedIPPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}`)
				}))
			})
			It(`Invoke DeleteClusterNetworkSubnetReservedIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeleteClusterNetworkSubnetReservedIPOptions model
				deleteClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.DeleteClusterNetworkSubnetReservedIPOptions)
				deleteClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeleteClusterNetworkSubnetReservedIPWithContext(ctx, deleteClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeleteClusterNetworkSubnetReservedIP(deleteClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeleteClusterNetworkSubnetReservedIPWithContext(ctx, deleteClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteClusterNetworkSubnetReservedIPPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}`)
				}))
			})
			It(`Invoke DeleteClusterNetworkSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeleteClusterNetworkSubnetReservedIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeleteClusterNetworkSubnetReservedIPOptions model
				deleteClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.DeleteClusterNetworkSubnetReservedIPOptions)
				deleteClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeleteClusterNetworkSubnetReservedIP(deleteClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeleteClusterNetworkSubnetReservedIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteClusterNetworkSubnetReservedIPOptions model
				deleteClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.DeleteClusterNetworkSubnetReservedIPOptions)
				deleteClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeleteClusterNetworkSubnetReservedIP(deleteClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeleteClusterNetworkSubnetReservedIPOptions model with no property values
				deleteClusterNetworkSubnetReservedIPOptionsModelNew := new(vpcv1.DeleteClusterNetworkSubnetReservedIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeleteClusterNetworkSubnetReservedIP(deleteClusterNetworkSubnetReservedIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteClusterNetworkSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteClusterNetworkSubnetReservedIPOptions model
				deleteClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.DeleteClusterNetworkSubnetReservedIPOptions)
				deleteClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeleteClusterNetworkSubnetReservedIP(deleteClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetClusterNetworkSubnetReservedIP(getClusterNetworkSubnetReservedIPOptions *GetClusterNetworkSubnetReservedIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getClusterNetworkSubnetReservedIPPath := "/cluster_networks/testString/subnets/testString/reserved_ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkSubnetReservedIPPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetClusterNetworkSubnetReservedIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkSubnetReservedIPOptions model
				getClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.GetClusterNetworkSubnetReservedIPOptions)
				getClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetClusterNetworkSubnetReservedIP(getClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetClusterNetworkSubnetReservedIP(getClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetClusterNetworkSubnetReservedIP(getClusterNetworkSubnetReservedIPOptions *GetClusterNetworkSubnetReservedIPOptions)`, func() {
		version := "2024-06-23"
		getClusterNetworkSubnetReservedIPPath := "/cluster_networks/testString/subnets/testString/reserved_ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkSubnetReservedIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}`)
				}))
			})
			It(`Invoke GetClusterNetworkSubnetReservedIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetClusterNetworkSubnetReservedIPOptions model
				getClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.GetClusterNetworkSubnetReservedIPOptions)
				getClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetClusterNetworkSubnetReservedIPWithContext(ctx, getClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetClusterNetworkSubnetReservedIP(getClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetClusterNetworkSubnetReservedIPWithContext(ctx, getClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkSubnetReservedIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}`)
				}))
			})
			It(`Invoke GetClusterNetworkSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetClusterNetworkSubnetReservedIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetClusterNetworkSubnetReservedIPOptions model
				getClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.GetClusterNetworkSubnetReservedIPOptions)
				getClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetClusterNetworkSubnetReservedIP(getClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetClusterNetworkSubnetReservedIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkSubnetReservedIPOptions model
				getClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.GetClusterNetworkSubnetReservedIPOptions)
				getClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetClusterNetworkSubnetReservedIP(getClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetClusterNetworkSubnetReservedIPOptions model with no property values
				getClusterNetworkSubnetReservedIPOptionsModelNew := new(vpcv1.GetClusterNetworkSubnetReservedIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetClusterNetworkSubnetReservedIP(getClusterNetworkSubnetReservedIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetClusterNetworkSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkSubnetReservedIPOptions model
				getClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.GetClusterNetworkSubnetReservedIPOptions)
				getClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetClusterNetworkSubnetReservedIP(getClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateClusterNetworkSubnetReservedIP(updateClusterNetworkSubnetReservedIPOptions *UpdateClusterNetworkSubnetReservedIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateClusterNetworkSubnetReservedIPPath := "/cluster_networks/testString/subnets/testString/reserved_ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateClusterNetworkSubnetReservedIPPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateClusterNetworkSubnetReservedIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkSubnetReservedIPPatch model
				clusterNetworkSubnetReservedIPPatchModel := new(vpcv1.ClusterNetworkSubnetReservedIPPatch)
				clusterNetworkSubnetReservedIPPatchModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkSubnetReservedIPPatchModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")
				clusterNetworkSubnetReservedIPPatchModelAsPatch, asPatchErr := clusterNetworkSubnetReservedIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkSubnetReservedIPOptions model
				updateClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.UpdateClusterNetworkSubnetReservedIPOptions)
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetReservedIPPatch = clusterNetworkSubnetReservedIPPatchModelAsPatch
				updateClusterNetworkSubnetReservedIPOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateClusterNetworkSubnetReservedIP(updateClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateClusterNetworkSubnetReservedIP(updateClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateClusterNetworkSubnetReservedIP(updateClusterNetworkSubnetReservedIPOptions *UpdateClusterNetworkSubnetReservedIPOptions)`, func() {
		version := "2024-06-23"
		updateClusterNetworkSubnetReservedIPPath := "/cluster_networks/testString/subnets/testString/reserved_ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateClusterNetworkSubnetReservedIPPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}`)
				}))
			})
			It(`Invoke UpdateClusterNetworkSubnetReservedIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ClusterNetworkSubnetReservedIPPatch model
				clusterNetworkSubnetReservedIPPatchModel := new(vpcv1.ClusterNetworkSubnetReservedIPPatch)
				clusterNetworkSubnetReservedIPPatchModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkSubnetReservedIPPatchModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")
				clusterNetworkSubnetReservedIPPatchModelAsPatch, asPatchErr := clusterNetworkSubnetReservedIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkSubnetReservedIPOptions model
				updateClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.UpdateClusterNetworkSubnetReservedIPOptions)
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetReservedIPPatch = clusterNetworkSubnetReservedIPPatchModelAsPatch
				updateClusterNetworkSubnetReservedIPOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateClusterNetworkSubnetReservedIPWithContext(ctx, updateClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateClusterNetworkSubnetReservedIP(updateClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateClusterNetworkSubnetReservedIPWithContext(ctx, updateClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateClusterNetworkSubnetReservedIPPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}`)
				}))
			})
			It(`Invoke UpdateClusterNetworkSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateClusterNetworkSubnetReservedIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ClusterNetworkSubnetReservedIPPatch model
				clusterNetworkSubnetReservedIPPatchModel := new(vpcv1.ClusterNetworkSubnetReservedIPPatch)
				clusterNetworkSubnetReservedIPPatchModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkSubnetReservedIPPatchModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")
				clusterNetworkSubnetReservedIPPatchModelAsPatch, asPatchErr := clusterNetworkSubnetReservedIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkSubnetReservedIPOptions model
				updateClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.UpdateClusterNetworkSubnetReservedIPOptions)
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetReservedIPPatch = clusterNetworkSubnetReservedIPPatchModelAsPatch
				updateClusterNetworkSubnetReservedIPOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateClusterNetworkSubnetReservedIP(updateClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateClusterNetworkSubnetReservedIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkSubnetReservedIPPatch model
				clusterNetworkSubnetReservedIPPatchModel := new(vpcv1.ClusterNetworkSubnetReservedIPPatch)
				clusterNetworkSubnetReservedIPPatchModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkSubnetReservedIPPatchModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")
				clusterNetworkSubnetReservedIPPatchModelAsPatch, asPatchErr := clusterNetworkSubnetReservedIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkSubnetReservedIPOptions model
				updateClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.UpdateClusterNetworkSubnetReservedIPOptions)
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetReservedIPPatch = clusterNetworkSubnetReservedIPPatchModelAsPatch
				updateClusterNetworkSubnetReservedIPOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateClusterNetworkSubnetReservedIP(updateClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateClusterNetworkSubnetReservedIPOptions model with no property values
				updateClusterNetworkSubnetReservedIPOptionsModelNew := new(vpcv1.UpdateClusterNetworkSubnetReservedIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateClusterNetworkSubnetReservedIP(updateClusterNetworkSubnetReservedIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateClusterNetworkSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkSubnetReservedIPPatch model
				clusterNetworkSubnetReservedIPPatchModel := new(vpcv1.ClusterNetworkSubnetReservedIPPatch)
				clusterNetworkSubnetReservedIPPatchModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkSubnetReservedIPPatchModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")
				clusterNetworkSubnetReservedIPPatchModelAsPatch, asPatchErr := clusterNetworkSubnetReservedIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkSubnetReservedIPOptions model
				updateClusterNetworkSubnetReservedIPOptionsModel := new(vpcv1.UpdateClusterNetworkSubnetReservedIPOptions)
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetReservedIPPatch = clusterNetworkSubnetReservedIPPatchModelAsPatch
				updateClusterNetworkSubnetReservedIPOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateClusterNetworkSubnetReservedIP(updateClusterNetworkSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteClusterNetworkSubnet(deleteClusterNetworkSubnetOptions *DeleteClusterNetworkSubnetOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deleteClusterNetworkSubnetPath := "/cluster_networks/testString/subnets/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteClusterNetworkSubnetPath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeleteClusterNetworkSubnet with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteClusterNetworkSubnetOptions model
				deleteClusterNetworkSubnetOptionsModel := new(vpcv1.DeleteClusterNetworkSubnetOptions)
				deleteClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkSubnetOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeleteClusterNetworkSubnet(deleteClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeleteClusterNetworkSubnet(deleteClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteClusterNetworkSubnet(deleteClusterNetworkSubnetOptions *DeleteClusterNetworkSubnetOptions)`, func() {
		version := "2024-06-23"
		deleteClusterNetworkSubnetPath := "/cluster_networks/testString/subnets/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteClusterNetworkSubnetPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}`)
				}))
			})
			It(`Invoke DeleteClusterNetworkSubnet successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeleteClusterNetworkSubnetOptions model
				deleteClusterNetworkSubnetOptionsModel := new(vpcv1.DeleteClusterNetworkSubnetOptions)
				deleteClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkSubnetOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeleteClusterNetworkSubnetWithContext(ctx, deleteClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeleteClusterNetworkSubnet(deleteClusterNetworkSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeleteClusterNetworkSubnetWithContext(ctx, deleteClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteClusterNetworkSubnetPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}`)
				}))
			})
			It(`Invoke DeleteClusterNetworkSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeleteClusterNetworkSubnet(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeleteClusterNetworkSubnetOptions model
				deleteClusterNetworkSubnetOptionsModel := new(vpcv1.DeleteClusterNetworkSubnetOptions)
				deleteClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkSubnetOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeleteClusterNetworkSubnet(deleteClusterNetworkSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeleteClusterNetworkSubnet with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteClusterNetworkSubnetOptions model
				deleteClusterNetworkSubnetOptionsModel := new(vpcv1.DeleteClusterNetworkSubnetOptions)
				deleteClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkSubnetOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeleteClusterNetworkSubnet(deleteClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeleteClusterNetworkSubnetOptions model with no property values
				deleteClusterNetworkSubnetOptionsModelNew := new(vpcv1.DeleteClusterNetworkSubnetOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeleteClusterNetworkSubnet(deleteClusterNetworkSubnetOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteClusterNetworkSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteClusterNetworkSubnetOptions model
				deleteClusterNetworkSubnetOptionsModel := new(vpcv1.DeleteClusterNetworkSubnetOptions)
				deleteClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				deleteClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkSubnetOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeleteClusterNetworkSubnet(deleteClusterNetworkSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetClusterNetworkSubnet(getClusterNetworkSubnetOptions *GetClusterNetworkSubnetOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getClusterNetworkSubnetPath := "/cluster_networks/testString/subnets/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkSubnetPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetClusterNetworkSubnet with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkSubnetOptions model
				getClusterNetworkSubnetOptionsModel := new(vpcv1.GetClusterNetworkSubnetOptions)
				getClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetClusterNetworkSubnet(getClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetClusterNetworkSubnet(getClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetClusterNetworkSubnet(getClusterNetworkSubnetOptions *GetClusterNetworkSubnetOptions)`, func() {
		version := "2024-06-23"
		getClusterNetworkSubnetPath := "/cluster_networks/testString/subnets/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkSubnetPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}`)
				}))
			})
			It(`Invoke GetClusterNetworkSubnet successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetClusterNetworkSubnetOptions model
				getClusterNetworkSubnetOptionsModel := new(vpcv1.GetClusterNetworkSubnetOptions)
				getClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetClusterNetworkSubnetWithContext(ctx, getClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetClusterNetworkSubnet(getClusterNetworkSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetClusterNetworkSubnetWithContext(ctx, getClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkSubnetPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}`)
				}))
			})
			It(`Invoke GetClusterNetworkSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetClusterNetworkSubnet(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetClusterNetworkSubnetOptions model
				getClusterNetworkSubnetOptionsModel := new(vpcv1.GetClusterNetworkSubnetOptions)
				getClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetClusterNetworkSubnet(getClusterNetworkSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetClusterNetworkSubnet with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkSubnetOptions model
				getClusterNetworkSubnetOptionsModel := new(vpcv1.GetClusterNetworkSubnetOptions)
				getClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetClusterNetworkSubnet(getClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetClusterNetworkSubnetOptions model with no property values
				getClusterNetworkSubnetOptionsModelNew := new(vpcv1.GetClusterNetworkSubnetOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetClusterNetworkSubnet(getClusterNetworkSubnetOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetClusterNetworkSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkSubnetOptions model
				getClusterNetworkSubnetOptionsModel := new(vpcv1.GetClusterNetworkSubnetOptions)
				getClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				getClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetClusterNetworkSubnet(getClusterNetworkSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateClusterNetworkSubnet(updateClusterNetworkSubnetOptions *UpdateClusterNetworkSubnetOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateClusterNetworkSubnetPath := "/cluster_networks/testString/subnets/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateClusterNetworkSubnetPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateClusterNetworkSubnet with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkSubnetPatch model
				clusterNetworkSubnetPatchModel := new(vpcv1.ClusterNetworkSubnetPatch)
				clusterNetworkSubnetPatchModel.Name = core.StringPtr("my-cluster-network-subnet")
				clusterNetworkSubnetPatchModelAsPatch, asPatchErr := clusterNetworkSubnetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkSubnetOptions model
				updateClusterNetworkSubnetOptionsModel := new(vpcv1.UpdateClusterNetworkSubnetOptions)
				updateClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkSubnetOptionsModel.ClusterNetworkSubnetPatch = clusterNetworkSubnetPatchModelAsPatch
				updateClusterNetworkSubnetOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateClusterNetworkSubnet(updateClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateClusterNetworkSubnet(updateClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateClusterNetworkSubnet(updateClusterNetworkSubnetOptions *UpdateClusterNetworkSubnetOptions)`, func() {
		version := "2024-06-23"
		updateClusterNetworkSubnetPath := "/cluster_networks/testString/subnets/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateClusterNetworkSubnetPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}`)
				}))
			})
			It(`Invoke UpdateClusterNetworkSubnet successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ClusterNetworkSubnetPatch model
				clusterNetworkSubnetPatchModel := new(vpcv1.ClusterNetworkSubnetPatch)
				clusterNetworkSubnetPatchModel.Name = core.StringPtr("my-cluster-network-subnet")
				clusterNetworkSubnetPatchModelAsPatch, asPatchErr := clusterNetworkSubnetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkSubnetOptions model
				updateClusterNetworkSubnetOptionsModel := new(vpcv1.UpdateClusterNetworkSubnetOptions)
				updateClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkSubnetOptionsModel.ClusterNetworkSubnetPatch = clusterNetworkSubnetPatchModelAsPatch
				updateClusterNetworkSubnetOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateClusterNetworkSubnetWithContext(ctx, updateClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateClusterNetworkSubnet(updateClusterNetworkSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateClusterNetworkSubnetWithContext(ctx, updateClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateClusterNetworkSubnetPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}`)
				}))
			})
			It(`Invoke UpdateClusterNetworkSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateClusterNetworkSubnet(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ClusterNetworkSubnetPatch model
				clusterNetworkSubnetPatchModel := new(vpcv1.ClusterNetworkSubnetPatch)
				clusterNetworkSubnetPatchModel.Name = core.StringPtr("my-cluster-network-subnet")
				clusterNetworkSubnetPatchModelAsPatch, asPatchErr := clusterNetworkSubnetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkSubnetOptions model
				updateClusterNetworkSubnetOptionsModel := new(vpcv1.UpdateClusterNetworkSubnetOptions)
				updateClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkSubnetOptionsModel.ClusterNetworkSubnetPatch = clusterNetworkSubnetPatchModelAsPatch
				updateClusterNetworkSubnetOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateClusterNetworkSubnet(updateClusterNetworkSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateClusterNetworkSubnet with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkSubnetPatch model
				clusterNetworkSubnetPatchModel := new(vpcv1.ClusterNetworkSubnetPatch)
				clusterNetworkSubnetPatchModel.Name = core.StringPtr("my-cluster-network-subnet")
				clusterNetworkSubnetPatchModelAsPatch, asPatchErr := clusterNetworkSubnetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkSubnetOptions model
				updateClusterNetworkSubnetOptionsModel := new(vpcv1.UpdateClusterNetworkSubnetOptions)
				updateClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkSubnetOptionsModel.ClusterNetworkSubnetPatch = clusterNetworkSubnetPatchModelAsPatch
				updateClusterNetworkSubnetOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateClusterNetworkSubnet(updateClusterNetworkSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateClusterNetworkSubnetOptions model with no property values
				updateClusterNetworkSubnetOptionsModelNew := new(vpcv1.UpdateClusterNetworkSubnetOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateClusterNetworkSubnet(updateClusterNetworkSubnetOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateClusterNetworkSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkSubnetPatch model
				clusterNetworkSubnetPatchModel := new(vpcv1.ClusterNetworkSubnetPatch)
				clusterNetworkSubnetPatchModel.Name = core.StringPtr("my-cluster-network-subnet")
				clusterNetworkSubnetPatchModelAsPatch, asPatchErr := clusterNetworkSubnetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkSubnetOptions model
				updateClusterNetworkSubnetOptionsModel := new(vpcv1.UpdateClusterNetworkSubnetOptions)
				updateClusterNetworkSubnetOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				updateClusterNetworkSubnetOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkSubnetOptionsModel.ClusterNetworkSubnetPatch = clusterNetworkSubnetPatchModelAsPatch
				updateClusterNetworkSubnetOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateClusterNetworkSubnet(updateClusterNetworkSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteClusterNetwork(deleteClusterNetworkOptions *DeleteClusterNetworkOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deleteClusterNetworkPath := "/cluster_networks/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteClusterNetworkPath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeleteClusterNetwork with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteClusterNetworkOptions model
				deleteClusterNetworkOptionsModel := new(vpcv1.DeleteClusterNetworkOptions)
				deleteClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeleteClusterNetwork(deleteClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeleteClusterNetwork(deleteClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteClusterNetwork(deleteClusterNetworkOptions *DeleteClusterNetworkOptions)`, func() {
		version := "2024-06-23"
		deleteClusterNetworkPath := "/cluster_networks/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteClusterNetworkPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke DeleteClusterNetwork successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeleteClusterNetworkOptions model
				deleteClusterNetworkOptionsModel := new(vpcv1.DeleteClusterNetworkOptions)
				deleteClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeleteClusterNetworkWithContext(ctx, deleteClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeleteClusterNetwork(deleteClusterNetworkOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeleteClusterNetworkWithContext(ctx, deleteClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteClusterNetworkPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke DeleteClusterNetwork successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeleteClusterNetwork(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeleteClusterNetworkOptions model
				deleteClusterNetworkOptionsModel := new(vpcv1.DeleteClusterNetworkOptions)
				deleteClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeleteClusterNetwork(deleteClusterNetworkOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeleteClusterNetwork with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteClusterNetworkOptions model
				deleteClusterNetworkOptionsModel := new(vpcv1.DeleteClusterNetworkOptions)
				deleteClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeleteClusterNetwork(deleteClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeleteClusterNetworkOptions model with no property values
				deleteClusterNetworkOptionsModelNew := new(vpcv1.DeleteClusterNetworkOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeleteClusterNetwork(deleteClusterNetworkOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteClusterNetwork successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteClusterNetworkOptions model
				deleteClusterNetworkOptionsModel := new(vpcv1.DeleteClusterNetworkOptions)
				deleteClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				deleteClusterNetworkOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeleteClusterNetwork(deleteClusterNetworkOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetClusterNetwork(getClusterNetworkOptions *GetClusterNetworkOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getClusterNetworkPath := "/cluster_networks/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetClusterNetwork with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkOptions model
				getClusterNetworkOptionsModel := new(vpcv1.GetClusterNetworkOptions)
				getClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetClusterNetwork(getClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetClusterNetwork(getClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetClusterNetwork(getClusterNetworkOptions *GetClusterNetworkOptions)`, func() {
		version := "2024-06-23"
		getClusterNetworkPath := "/cluster_networks/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetClusterNetwork successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetClusterNetworkOptions model
				getClusterNetworkOptionsModel := new(vpcv1.GetClusterNetworkOptions)
				getClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetClusterNetworkWithContext(ctx, getClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetClusterNetwork(getClusterNetworkOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetClusterNetworkWithContext(ctx, getClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getClusterNetworkPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetClusterNetwork successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetClusterNetwork(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetClusterNetworkOptions model
				getClusterNetworkOptionsModel := new(vpcv1.GetClusterNetworkOptions)
				getClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetClusterNetwork(getClusterNetworkOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetClusterNetwork with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkOptions model
				getClusterNetworkOptionsModel := new(vpcv1.GetClusterNetworkOptions)
				getClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetClusterNetwork(getClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetClusterNetworkOptions model with no property values
				getClusterNetworkOptionsModelNew := new(vpcv1.GetClusterNetworkOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetClusterNetwork(getClusterNetworkOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetClusterNetwork successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetClusterNetworkOptions model
				getClusterNetworkOptionsModel := new(vpcv1.GetClusterNetworkOptions)
				getClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				getClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetClusterNetwork(getClusterNetworkOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateClusterNetwork(updateClusterNetworkOptions *UpdateClusterNetworkOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateClusterNetworkPath := "/cluster_networks/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateClusterNetworkPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateClusterNetwork with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkPatch model
				clusterNetworkPatchModel := new(vpcv1.ClusterNetworkPatch)
				clusterNetworkPatchModel.Name = core.StringPtr("my-cluster-network")
				clusterNetworkPatchModelAsPatch, asPatchErr := clusterNetworkPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkOptions model
				updateClusterNetworkOptionsModel := new(vpcv1.UpdateClusterNetworkOptions)
				updateClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkOptionsModel.ClusterNetworkPatch = clusterNetworkPatchModelAsPatch
				updateClusterNetworkOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateClusterNetwork(updateClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateClusterNetwork(updateClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateClusterNetwork(updateClusterNetworkOptions *UpdateClusterNetworkOptions)`, func() {
		version := "2024-06-23"
		updateClusterNetworkPath := "/cluster_networks/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateClusterNetworkPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateClusterNetwork successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ClusterNetworkPatch model
				clusterNetworkPatchModel := new(vpcv1.ClusterNetworkPatch)
				clusterNetworkPatchModel.Name = core.StringPtr("my-cluster-network")
				clusterNetworkPatchModelAsPatch, asPatchErr := clusterNetworkPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkOptions model
				updateClusterNetworkOptionsModel := new(vpcv1.UpdateClusterNetworkOptions)
				updateClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkOptionsModel.ClusterNetworkPatch = clusterNetworkPatchModelAsPatch
				updateClusterNetworkOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateClusterNetworkWithContext(ctx, updateClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateClusterNetwork(updateClusterNetworkOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateClusterNetworkWithContext(ctx, updateClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateClusterNetworkPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateClusterNetwork successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateClusterNetwork(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ClusterNetworkPatch model
				clusterNetworkPatchModel := new(vpcv1.ClusterNetworkPatch)
				clusterNetworkPatchModel.Name = core.StringPtr("my-cluster-network")
				clusterNetworkPatchModelAsPatch, asPatchErr := clusterNetworkPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkOptions model
				updateClusterNetworkOptionsModel := new(vpcv1.UpdateClusterNetworkOptions)
				updateClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkOptionsModel.ClusterNetworkPatch = clusterNetworkPatchModelAsPatch
				updateClusterNetworkOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateClusterNetwork(updateClusterNetworkOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateClusterNetwork with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkPatch model
				clusterNetworkPatchModel := new(vpcv1.ClusterNetworkPatch)
				clusterNetworkPatchModel.Name = core.StringPtr("my-cluster-network")
				clusterNetworkPatchModelAsPatch, asPatchErr := clusterNetworkPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkOptions model
				updateClusterNetworkOptionsModel := new(vpcv1.UpdateClusterNetworkOptions)
				updateClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkOptionsModel.ClusterNetworkPatch = clusterNetworkPatchModelAsPatch
				updateClusterNetworkOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateClusterNetwork(updateClusterNetworkOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateClusterNetworkOptions model with no property values
				updateClusterNetworkOptionsModelNew := new(vpcv1.UpdateClusterNetworkOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateClusterNetwork(updateClusterNetworkOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateClusterNetwork successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkPatch model
				clusterNetworkPatchModel := new(vpcv1.ClusterNetworkPatch)
				clusterNetworkPatchModel.Name = core.StringPtr("my-cluster-network")
				clusterNetworkPatchModelAsPatch, asPatchErr := clusterNetworkPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateClusterNetworkOptions model
				updateClusterNetworkOptionsModel := new(vpcv1.UpdateClusterNetworkOptions)
				updateClusterNetworkOptionsModel.ID = core.StringPtr("testString")
				updateClusterNetworkOptionsModel.ClusterNetworkPatch = clusterNetworkPatchModelAsPatch
				updateClusterNetworkOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateClusterNetwork(updateClusterNetworkOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListDedicatedHostGroups(listDedicatedHostGroupsOptions *ListDedicatedHostGroupsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listDedicatedHostGroupsPath := "/dedicated_host/groups"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostGroupsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListDedicatedHostGroups with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListDedicatedHostGroupsOptions model
				listDedicatedHostGroupsOptionsModel := new(vpcv1.ListDedicatedHostGroupsOptions)
				listDedicatedHostGroupsOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listDedicatedHostGroupsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listDedicatedHostGroupsOptionsModel.Name = core.StringPtr("my-name")
				listDedicatedHostGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListDedicatedHostGroups(listDedicatedHostGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListDedicatedHostGroups(listDedicatedHostGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListDedicatedHostGroups(listDedicatedHostGroupsOptions *ListDedicatedHostGroupsOptions)`, func() {
		version := "2024-06-23"
		listDedicatedHostGroupsPath := "/dedicated_host/groups"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "groups": [{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListDedicatedHostGroups successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListDedicatedHostGroupsOptions model
				listDedicatedHostGroupsOptionsModel := new(vpcv1.ListDedicatedHostGroupsOptions)
				listDedicatedHostGroupsOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listDedicatedHostGroupsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listDedicatedHostGroupsOptionsModel.Name = core.StringPtr("my-name")
				listDedicatedHostGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListDedicatedHostGroupsWithContext(ctx, listDedicatedHostGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListDedicatedHostGroups(listDedicatedHostGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListDedicatedHostGroupsWithContext(ctx, listDedicatedHostGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "groups": [{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListDedicatedHostGroups successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListDedicatedHostGroups(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListDedicatedHostGroupsOptions model
				listDedicatedHostGroupsOptionsModel := new(vpcv1.ListDedicatedHostGroupsOptions)
				listDedicatedHostGroupsOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listDedicatedHostGroupsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listDedicatedHostGroupsOptionsModel.Name = core.StringPtr("my-name")
				listDedicatedHostGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListDedicatedHostGroups(listDedicatedHostGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListDedicatedHostGroups with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListDedicatedHostGroupsOptions model
				listDedicatedHostGroupsOptionsModel := new(vpcv1.ListDedicatedHostGroupsOptions)
				listDedicatedHostGroupsOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listDedicatedHostGroupsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listDedicatedHostGroupsOptionsModel.Name = core.StringPtr("my-name")
				listDedicatedHostGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListDedicatedHostGroups(listDedicatedHostGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListDedicatedHostGroups successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListDedicatedHostGroupsOptions model
				listDedicatedHostGroupsOptionsModel := new(vpcv1.ListDedicatedHostGroupsOptions)
				listDedicatedHostGroupsOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listDedicatedHostGroupsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listDedicatedHostGroupsOptionsModel.Name = core.StringPtr("my-name")
				listDedicatedHostGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListDedicatedHostGroups(listDedicatedHostGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.DedicatedHostGroupCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.DedicatedHostGroupCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.DedicatedHostGroupCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"groups":[{"class":"bx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"groups":[{"class":"bx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use DedicatedHostGroupsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listDedicatedHostGroupsOptionsModel := &vpcv1.ListDedicatedHostGroupsOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					ZoneName:        core.StringPtr("us-south-1"),
					Name:            core.StringPtr("my-name"),
				}

				pager, err := vpcService.NewDedicatedHostGroupsPager(listDedicatedHostGroupsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.DedicatedHostGroup
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use DedicatedHostGroupsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listDedicatedHostGroupsOptionsModel := &vpcv1.ListDedicatedHostGroupsOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					ZoneName:        core.StringPtr("us-south-1"),
					Name:            core.StringPtr("my-name"),
				}

				pager, err := vpcService.NewDedicatedHostGroupsPager(listDedicatedHostGroupsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateDedicatedHostGroup(createDedicatedHostGroupOptions *CreateDedicatedHostGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createDedicatedHostGroupPath := "/dedicated_host/groups"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createDedicatedHostGroupPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateDedicatedHostGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateDedicatedHostGroupOptions model
				createDedicatedHostGroupOptionsModel := new(vpcv1.CreateDedicatedHostGroupOptions)
				createDedicatedHostGroupOptionsModel.Class = core.StringPtr("mx2")
				createDedicatedHostGroupOptionsModel.Family = core.StringPtr("balanced")
				createDedicatedHostGroupOptionsModel.Zone = zoneIdentityModel
				createDedicatedHostGroupOptionsModel.Name = core.StringPtr("testString")
				createDedicatedHostGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateDedicatedHostGroup(createDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateDedicatedHostGroup(createDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateDedicatedHostGroup(createDedicatedHostGroupOptions *CreateDedicatedHostGroupOptions)`, func() {
		version := "2024-06-23"
		createDedicatedHostGroupPath := "/dedicated_host/groups"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createDedicatedHostGroupPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateDedicatedHostGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateDedicatedHostGroupOptions model
				createDedicatedHostGroupOptionsModel := new(vpcv1.CreateDedicatedHostGroupOptions)
				createDedicatedHostGroupOptionsModel.Class = core.StringPtr("mx2")
				createDedicatedHostGroupOptionsModel.Family = core.StringPtr("balanced")
				createDedicatedHostGroupOptionsModel.Zone = zoneIdentityModel
				createDedicatedHostGroupOptionsModel.Name = core.StringPtr("testString")
				createDedicatedHostGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateDedicatedHostGroupWithContext(ctx, createDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateDedicatedHostGroup(createDedicatedHostGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateDedicatedHostGroupWithContext(ctx, createDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createDedicatedHostGroupPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateDedicatedHostGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateDedicatedHostGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateDedicatedHostGroupOptions model
				createDedicatedHostGroupOptionsModel := new(vpcv1.CreateDedicatedHostGroupOptions)
				createDedicatedHostGroupOptionsModel.Class = core.StringPtr("mx2")
				createDedicatedHostGroupOptionsModel.Family = core.StringPtr("balanced")
				createDedicatedHostGroupOptionsModel.Zone = zoneIdentityModel
				createDedicatedHostGroupOptionsModel.Name = core.StringPtr("testString")
				createDedicatedHostGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateDedicatedHostGroup(createDedicatedHostGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateDedicatedHostGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateDedicatedHostGroupOptions model
				createDedicatedHostGroupOptionsModel := new(vpcv1.CreateDedicatedHostGroupOptions)
				createDedicatedHostGroupOptionsModel.Class = core.StringPtr("mx2")
				createDedicatedHostGroupOptionsModel.Family = core.StringPtr("balanced")
				createDedicatedHostGroupOptionsModel.Zone = zoneIdentityModel
				createDedicatedHostGroupOptionsModel.Name = core.StringPtr("testString")
				createDedicatedHostGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateDedicatedHostGroup(createDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateDedicatedHostGroupOptions model with no property values
				createDedicatedHostGroupOptionsModelNew := new(vpcv1.CreateDedicatedHostGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateDedicatedHostGroup(createDedicatedHostGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateDedicatedHostGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateDedicatedHostGroupOptions model
				createDedicatedHostGroupOptionsModel := new(vpcv1.CreateDedicatedHostGroupOptions)
				createDedicatedHostGroupOptionsModel.Class = core.StringPtr("mx2")
				createDedicatedHostGroupOptionsModel.Family = core.StringPtr("balanced")
				createDedicatedHostGroupOptionsModel.Zone = zoneIdentityModel
				createDedicatedHostGroupOptionsModel.Name = core.StringPtr("testString")
				createDedicatedHostGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateDedicatedHostGroup(createDedicatedHostGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteDedicatedHostGroup(deleteDedicatedHostGroupOptions *DeleteDedicatedHostGroupOptions)`, func() {
		version := "2024-06-23"
		deleteDedicatedHostGroupPath := "/dedicated_host/groups/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteDedicatedHostGroupPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteDedicatedHostGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteDedicatedHostGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteDedicatedHostGroupOptions model
				deleteDedicatedHostGroupOptionsModel := new(vpcv1.DeleteDedicatedHostGroupOptions)
				deleteDedicatedHostGroupOptionsModel.ID = core.StringPtr("testString")
				deleteDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteDedicatedHostGroup(deleteDedicatedHostGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteDedicatedHostGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteDedicatedHostGroupOptions model
				deleteDedicatedHostGroupOptionsModel := new(vpcv1.DeleteDedicatedHostGroupOptions)
				deleteDedicatedHostGroupOptionsModel.ID = core.StringPtr("testString")
				deleteDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteDedicatedHostGroup(deleteDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteDedicatedHostGroupOptions model with no property values
				deleteDedicatedHostGroupOptionsModelNew := new(vpcv1.DeleteDedicatedHostGroupOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteDedicatedHostGroup(deleteDedicatedHostGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetDedicatedHostGroup(getDedicatedHostGroupOptions *GetDedicatedHostGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getDedicatedHostGroupPath := "/dedicated_host/groups/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getDedicatedHostGroupPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetDedicatedHostGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetDedicatedHostGroupOptions model
				getDedicatedHostGroupOptionsModel := new(vpcv1.GetDedicatedHostGroupOptions)
				getDedicatedHostGroupOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetDedicatedHostGroup(getDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetDedicatedHostGroup(getDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetDedicatedHostGroup(getDedicatedHostGroupOptions *GetDedicatedHostGroupOptions)`, func() {
		version := "2024-06-23"
		getDedicatedHostGroupPath := "/dedicated_host/groups/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getDedicatedHostGroupPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetDedicatedHostGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetDedicatedHostGroupOptions model
				getDedicatedHostGroupOptionsModel := new(vpcv1.GetDedicatedHostGroupOptions)
				getDedicatedHostGroupOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetDedicatedHostGroupWithContext(ctx, getDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetDedicatedHostGroup(getDedicatedHostGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetDedicatedHostGroupWithContext(ctx, getDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getDedicatedHostGroupPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetDedicatedHostGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetDedicatedHostGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetDedicatedHostGroupOptions model
				getDedicatedHostGroupOptionsModel := new(vpcv1.GetDedicatedHostGroupOptions)
				getDedicatedHostGroupOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetDedicatedHostGroup(getDedicatedHostGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetDedicatedHostGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetDedicatedHostGroupOptions model
				getDedicatedHostGroupOptionsModel := new(vpcv1.GetDedicatedHostGroupOptions)
				getDedicatedHostGroupOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetDedicatedHostGroup(getDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetDedicatedHostGroupOptions model with no property values
				getDedicatedHostGroupOptionsModelNew := new(vpcv1.GetDedicatedHostGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetDedicatedHostGroup(getDedicatedHostGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetDedicatedHostGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetDedicatedHostGroupOptions model
				getDedicatedHostGroupOptionsModel := new(vpcv1.GetDedicatedHostGroupOptions)
				getDedicatedHostGroupOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetDedicatedHostGroup(getDedicatedHostGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateDedicatedHostGroup(updateDedicatedHostGroupOptions *UpdateDedicatedHostGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateDedicatedHostGroupPath := "/dedicated_host/groups/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateDedicatedHostGroupPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateDedicatedHostGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DedicatedHostGroupPatch model
				dedicatedHostGroupPatchModel := new(vpcv1.DedicatedHostGroupPatch)
				dedicatedHostGroupPatchModel.Name = core.StringPtr("my-dedicated-host-group-updated")
				dedicatedHostGroupPatchModelAsPatch, asPatchErr := dedicatedHostGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostGroupOptions model
				updateDedicatedHostGroupOptionsModel := new(vpcv1.UpdateDedicatedHostGroupOptions)
				updateDedicatedHostGroupOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostGroupOptionsModel.DedicatedHostGroupPatch = dedicatedHostGroupPatchModelAsPatch
				updateDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateDedicatedHostGroup(updateDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateDedicatedHostGroup(updateDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateDedicatedHostGroup(updateDedicatedHostGroupOptions *UpdateDedicatedHostGroupOptions)`, func() {
		version := "2024-06-23"
		updateDedicatedHostGroupPath := "/dedicated_host/groups/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateDedicatedHostGroupPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateDedicatedHostGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DedicatedHostGroupPatch model
				dedicatedHostGroupPatchModel := new(vpcv1.DedicatedHostGroupPatch)
				dedicatedHostGroupPatchModel.Name = core.StringPtr("my-dedicated-host-group-updated")
				dedicatedHostGroupPatchModelAsPatch, asPatchErr := dedicatedHostGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostGroupOptions model
				updateDedicatedHostGroupOptionsModel := new(vpcv1.UpdateDedicatedHostGroupOptions)
				updateDedicatedHostGroupOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostGroupOptionsModel.DedicatedHostGroupPatch = dedicatedHostGroupPatchModelAsPatch
				updateDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateDedicatedHostGroupWithContext(ctx, updateDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateDedicatedHostGroup(updateDedicatedHostGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateDedicatedHostGroupWithContext(ctx, updateDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateDedicatedHostGroupPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateDedicatedHostGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateDedicatedHostGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DedicatedHostGroupPatch model
				dedicatedHostGroupPatchModel := new(vpcv1.DedicatedHostGroupPatch)
				dedicatedHostGroupPatchModel.Name = core.StringPtr("my-dedicated-host-group-updated")
				dedicatedHostGroupPatchModelAsPatch, asPatchErr := dedicatedHostGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostGroupOptions model
				updateDedicatedHostGroupOptionsModel := new(vpcv1.UpdateDedicatedHostGroupOptions)
				updateDedicatedHostGroupOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostGroupOptionsModel.DedicatedHostGroupPatch = dedicatedHostGroupPatchModelAsPatch
				updateDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateDedicatedHostGroup(updateDedicatedHostGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateDedicatedHostGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DedicatedHostGroupPatch model
				dedicatedHostGroupPatchModel := new(vpcv1.DedicatedHostGroupPatch)
				dedicatedHostGroupPatchModel.Name = core.StringPtr("my-dedicated-host-group-updated")
				dedicatedHostGroupPatchModelAsPatch, asPatchErr := dedicatedHostGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostGroupOptions model
				updateDedicatedHostGroupOptionsModel := new(vpcv1.UpdateDedicatedHostGroupOptions)
				updateDedicatedHostGroupOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostGroupOptionsModel.DedicatedHostGroupPatch = dedicatedHostGroupPatchModelAsPatch
				updateDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateDedicatedHostGroup(updateDedicatedHostGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateDedicatedHostGroupOptions model with no property values
				updateDedicatedHostGroupOptionsModelNew := new(vpcv1.UpdateDedicatedHostGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateDedicatedHostGroup(updateDedicatedHostGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateDedicatedHostGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DedicatedHostGroupPatch model
				dedicatedHostGroupPatchModel := new(vpcv1.DedicatedHostGroupPatch)
				dedicatedHostGroupPatchModel.Name = core.StringPtr("my-dedicated-host-group-updated")
				dedicatedHostGroupPatchModelAsPatch, asPatchErr := dedicatedHostGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostGroupOptions model
				updateDedicatedHostGroupOptionsModel := new(vpcv1.UpdateDedicatedHostGroupOptions)
				updateDedicatedHostGroupOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostGroupOptionsModel.DedicatedHostGroupPatch = dedicatedHostGroupPatchModelAsPatch
				updateDedicatedHostGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateDedicatedHostGroup(updateDedicatedHostGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListDedicatedHostProfiles(listDedicatedHostProfilesOptions *ListDedicatedHostProfilesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listDedicatedHostProfilesPath := "/dedicated_host/profiles"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostProfilesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListDedicatedHostProfiles with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListDedicatedHostProfilesOptions model
				listDedicatedHostProfilesOptionsModel := new(vpcv1.ListDedicatedHostProfilesOptions)
				listDedicatedHostProfilesOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListDedicatedHostProfiles(listDedicatedHostProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListDedicatedHostProfiles(listDedicatedHostProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListDedicatedHostProfiles(listDedicatedHostProfilesOptions *ListDedicatedHostProfilesOptions)`, func() {
		version := "2024-06-23"
		listDedicatedHostProfilesPath := "/dedicated_host/profiles"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "profiles": [{"class": "bx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListDedicatedHostProfiles successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListDedicatedHostProfilesOptions model
				listDedicatedHostProfilesOptionsModel := new(vpcv1.ListDedicatedHostProfilesOptions)
				listDedicatedHostProfilesOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListDedicatedHostProfilesWithContext(ctx, listDedicatedHostProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListDedicatedHostProfiles(listDedicatedHostProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListDedicatedHostProfilesWithContext(ctx, listDedicatedHostProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "profiles": [{"class": "bx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListDedicatedHostProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListDedicatedHostProfiles(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListDedicatedHostProfilesOptions model
				listDedicatedHostProfilesOptionsModel := new(vpcv1.ListDedicatedHostProfilesOptions)
				listDedicatedHostProfilesOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListDedicatedHostProfiles(listDedicatedHostProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListDedicatedHostProfiles with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListDedicatedHostProfilesOptions model
				listDedicatedHostProfilesOptionsModel := new(vpcv1.ListDedicatedHostProfilesOptions)
				listDedicatedHostProfilesOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListDedicatedHostProfiles(listDedicatedHostProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListDedicatedHostProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListDedicatedHostProfilesOptions model
				listDedicatedHostProfilesOptionsModel := new(vpcv1.ListDedicatedHostProfilesOptions)
				listDedicatedHostProfilesOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListDedicatedHostProfiles(listDedicatedHostProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.DedicatedHostProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.DedicatedHostProfileCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.DedicatedHostProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"class":"bx2","disks":[{"interface_type":{"type":"fixed","value":"nvme"},"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":3200},"supported_instance_interface_types":{"type":"fixed","value":["nvme"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","memory":{"type":"fixed","value":16},"name":"mx2-host-152x1216","socket_count":{"type":"fixed","value":2},"status":"current","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu_architecture":{"type":"fixed","value":"amd64"},"vcpu_count":{"type":"fixed","value":16},"vcpu_manufacturer":{"type":"fixed","value":"intel"}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"profiles":[{"class":"bx2","disks":[{"interface_type":{"type":"fixed","value":"nvme"},"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":3200},"supported_instance_interface_types":{"type":"fixed","value":["nvme"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","memory":{"type":"fixed","value":16},"name":"mx2-host-152x1216","socket_count":{"type":"fixed","value":2},"status":"current","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu_architecture":{"type":"fixed","value":"amd64"},"vcpu_count":{"type":"fixed","value":16},"vcpu_manufacturer":{"type":"fixed","value":"intel"}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use DedicatedHostProfilesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listDedicatedHostProfilesOptionsModel := &vpcv1.ListDedicatedHostProfilesOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewDedicatedHostProfilesPager(listDedicatedHostProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.DedicatedHostProfile
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use DedicatedHostProfilesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listDedicatedHostProfilesOptionsModel := &vpcv1.ListDedicatedHostProfilesOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewDedicatedHostProfilesPager(listDedicatedHostProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`GetDedicatedHostProfile(getDedicatedHostProfileOptions *GetDedicatedHostProfileOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getDedicatedHostProfilePath := "/dedicated_host/profiles/mx2-host-152x1216"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getDedicatedHostProfilePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetDedicatedHostProfile with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetDedicatedHostProfileOptions model
				getDedicatedHostProfileOptionsModel := new(vpcv1.GetDedicatedHostProfileOptions)
				getDedicatedHostProfileOptionsModel.Name = core.StringPtr("mx2-host-152x1216")
				getDedicatedHostProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetDedicatedHostProfile(getDedicatedHostProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetDedicatedHostProfile(getDedicatedHostProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetDedicatedHostProfile(getDedicatedHostProfileOptions *GetDedicatedHostProfileOptions)`, func() {
		version := "2024-06-23"
		getDedicatedHostProfilePath := "/dedicated_host/profiles/mx2-host-152x1216"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getDedicatedHostProfilePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"class": "bx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}`)
				}))
			})
			It(`Invoke GetDedicatedHostProfile successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetDedicatedHostProfileOptions model
				getDedicatedHostProfileOptionsModel := new(vpcv1.GetDedicatedHostProfileOptions)
				getDedicatedHostProfileOptionsModel.Name = core.StringPtr("mx2-host-152x1216")
				getDedicatedHostProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetDedicatedHostProfileWithContext(ctx, getDedicatedHostProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetDedicatedHostProfile(getDedicatedHostProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetDedicatedHostProfileWithContext(ctx, getDedicatedHostProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getDedicatedHostProfilePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"class": "bx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}`)
				}))
			})
			It(`Invoke GetDedicatedHostProfile successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetDedicatedHostProfile(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetDedicatedHostProfileOptions model
				getDedicatedHostProfileOptionsModel := new(vpcv1.GetDedicatedHostProfileOptions)
				getDedicatedHostProfileOptionsModel.Name = core.StringPtr("mx2-host-152x1216")
				getDedicatedHostProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetDedicatedHostProfile(getDedicatedHostProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetDedicatedHostProfile with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetDedicatedHostProfileOptions model
				getDedicatedHostProfileOptionsModel := new(vpcv1.GetDedicatedHostProfileOptions)
				getDedicatedHostProfileOptionsModel.Name = core.StringPtr("mx2-host-152x1216")
				getDedicatedHostProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetDedicatedHostProfile(getDedicatedHostProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetDedicatedHostProfileOptions model with no property values
				getDedicatedHostProfileOptionsModelNew := new(vpcv1.GetDedicatedHostProfileOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetDedicatedHostProfile(getDedicatedHostProfileOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetDedicatedHostProfile successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetDedicatedHostProfileOptions model
				getDedicatedHostProfileOptionsModel := new(vpcv1.GetDedicatedHostProfileOptions)
				getDedicatedHostProfileOptionsModel.Name = core.StringPtr("mx2-host-152x1216")
				getDedicatedHostProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetDedicatedHostProfile(getDedicatedHostProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListDedicatedHosts(listDedicatedHostsOptions *ListDedicatedHostsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listDedicatedHostsPath := "/dedicated_hosts"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["dedicated_host_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListDedicatedHosts with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListDedicatedHostsOptions model
				listDedicatedHostsOptionsModel := new(vpcv1.ListDedicatedHostsOptions)
				listDedicatedHostsOptionsModel.DedicatedHostGroupID = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listDedicatedHostsOptionsModel.Name = core.StringPtr("my-name")
				listDedicatedHostsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListDedicatedHosts(listDedicatedHostsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListDedicatedHosts(listDedicatedHostsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListDedicatedHosts(listDedicatedHostsOptions *ListDedicatedHostsOptions)`, func() {
		version := "2024-06-23"
		listDedicatedHostsPath := "/dedicated_hosts"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["dedicated_host_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListDedicatedHosts successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListDedicatedHostsOptions model
				listDedicatedHostsOptionsModel := new(vpcv1.ListDedicatedHostsOptions)
				listDedicatedHostsOptionsModel.DedicatedHostGroupID = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listDedicatedHostsOptionsModel.Name = core.StringPtr("my-name")
				listDedicatedHostsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListDedicatedHostsWithContext(ctx, listDedicatedHostsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListDedicatedHosts(listDedicatedHostsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListDedicatedHostsWithContext(ctx, listDedicatedHostsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["dedicated_host_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListDedicatedHosts successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListDedicatedHosts(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListDedicatedHostsOptions model
				listDedicatedHostsOptionsModel := new(vpcv1.ListDedicatedHostsOptions)
				listDedicatedHostsOptionsModel.DedicatedHostGroupID = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listDedicatedHostsOptionsModel.Name = core.StringPtr("my-name")
				listDedicatedHostsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListDedicatedHosts(listDedicatedHostsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListDedicatedHosts with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListDedicatedHostsOptions model
				listDedicatedHostsOptionsModel := new(vpcv1.ListDedicatedHostsOptions)
				listDedicatedHostsOptionsModel.DedicatedHostGroupID = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listDedicatedHostsOptionsModel.Name = core.StringPtr("my-name")
				listDedicatedHostsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListDedicatedHosts(listDedicatedHostsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListDedicatedHosts successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListDedicatedHostsOptions model
				listDedicatedHostsOptionsModel := new(vpcv1.ListDedicatedHostsOptions)
				listDedicatedHostsOptionsModel.DedicatedHostGroupID = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.Start = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listDedicatedHostsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listDedicatedHostsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listDedicatedHostsOptionsModel.Name = core.StringPtr("my-name")
				listDedicatedHostsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListDedicatedHosts(listDedicatedHostsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.DedicatedHostCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.DedicatedHostCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.DedicatedHostCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"available":9,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e","id":"0717-bd091a9e-b036-4c65-a79b-56d164911f6e","instance_disks":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-disk","resource_type":"instance_disk"}],"interface_type":"nvme","lifecycle_state":"stable","name":"my-dedicated-host-disk","provisionable":false,"resource_type":"dedicated_host_disk","size":4,"supported_instance_interface_types":["nvme"]}],"group":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_type":"dedicated_host_group"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","instance_placement_enabled":true,"instances":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"}],"lifecycle_state":"stable","memory":128,"name":"my-host","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"available":9,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e","id":"0717-bd091a9e-b036-4c65-a79b-56d164911f6e","instance_disks":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-disk","resource_type":"instance_disk"}],"interface_type":"nvme","lifecycle_state":"stable","name":"my-dedicated-host-disk","provisionable":false,"resource_type":"dedicated_host_disk","size":4,"supported_instance_interface_types":["nvme"]}],"group":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_type":"dedicated_host_group"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","instance_placement_enabled":true,"instances":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"}],"lifecycle_state":"stable","memory":128,"name":"my-host","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use DedicatedHostsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listDedicatedHostsOptionsModel := &vpcv1.ListDedicatedHostsOptions{
					DedicatedHostGroupID: core.StringPtr("testString"),
					Limit:                core.Int64Ptr(int64(10)),
					ResourceGroupID:      core.StringPtr("testString"),
					ZoneName:             core.StringPtr("us-south-1"),
					Name:                 core.StringPtr("my-name"),
				}

				pager, err := vpcService.NewDedicatedHostsPager(listDedicatedHostsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.DedicatedHost
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use DedicatedHostsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listDedicatedHostsOptionsModel := &vpcv1.ListDedicatedHostsOptions{
					DedicatedHostGroupID: core.StringPtr("testString"),
					Limit:                core.Int64Ptr(int64(10)),
					ResourceGroupID:      core.StringPtr("testString"),
					ZoneName:             core.StringPtr("us-south-1"),
					Name:                 core.StringPtr("my-name"),
				}

				pager, err := vpcService.NewDedicatedHostsPager(listDedicatedHostsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateDedicatedHost(createDedicatedHostOptions *CreateDedicatedHostOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createDedicatedHostPath := "/dedicated_hosts"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createDedicatedHostPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateDedicatedHost with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DedicatedHostProfileIdentityByName model
				dedicatedHostProfileIdentityModel := new(vpcv1.DedicatedHostProfileIdentityByName)
				dedicatedHostProfileIdentityModel.Name = core.StringPtr("mx2-host-152x1216")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the DedicatedHostGroupIdentityByID model
				dedicatedHostGroupIdentityModel := new(vpcv1.DedicatedHostGroupIdentityByID)
				dedicatedHostGroupIdentityModel.ID = core.StringPtr("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

				// Construct an instance of the DedicatedHostPrototypeDedicatedHostByGroup model
				dedicatedHostPrototypeModel := new(vpcv1.DedicatedHostPrototypeDedicatedHostByGroup)
				dedicatedHostPrototypeModel.InstancePlacementEnabled = core.BoolPtr(true)
				dedicatedHostPrototypeModel.Name = core.StringPtr("my-host")
				dedicatedHostPrototypeModel.Profile = dedicatedHostProfileIdentityModel
				dedicatedHostPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				dedicatedHostPrototypeModel.Group = dedicatedHostGroupIdentityModel

				// Construct an instance of the CreateDedicatedHostOptions model
				createDedicatedHostOptionsModel := new(vpcv1.CreateDedicatedHostOptions)
				createDedicatedHostOptionsModel.DedicatedHostPrototype = dedicatedHostPrototypeModel
				createDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateDedicatedHost(createDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateDedicatedHost(createDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateDedicatedHost(createDedicatedHostOptions *CreateDedicatedHostOptions)`, func() {
		version := "2024-06-23"
		createDedicatedHostPath := "/dedicated_hosts"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createDedicatedHostPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateDedicatedHost successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DedicatedHostProfileIdentityByName model
				dedicatedHostProfileIdentityModel := new(vpcv1.DedicatedHostProfileIdentityByName)
				dedicatedHostProfileIdentityModel.Name = core.StringPtr("mx2-host-152x1216")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the DedicatedHostGroupIdentityByID model
				dedicatedHostGroupIdentityModel := new(vpcv1.DedicatedHostGroupIdentityByID)
				dedicatedHostGroupIdentityModel.ID = core.StringPtr("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

				// Construct an instance of the DedicatedHostPrototypeDedicatedHostByGroup model
				dedicatedHostPrototypeModel := new(vpcv1.DedicatedHostPrototypeDedicatedHostByGroup)
				dedicatedHostPrototypeModel.InstancePlacementEnabled = core.BoolPtr(true)
				dedicatedHostPrototypeModel.Name = core.StringPtr("my-host")
				dedicatedHostPrototypeModel.Profile = dedicatedHostProfileIdentityModel
				dedicatedHostPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				dedicatedHostPrototypeModel.Group = dedicatedHostGroupIdentityModel

				// Construct an instance of the CreateDedicatedHostOptions model
				createDedicatedHostOptionsModel := new(vpcv1.CreateDedicatedHostOptions)
				createDedicatedHostOptionsModel.DedicatedHostPrototype = dedicatedHostPrototypeModel
				createDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateDedicatedHostWithContext(ctx, createDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateDedicatedHost(createDedicatedHostOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateDedicatedHostWithContext(ctx, createDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createDedicatedHostPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateDedicatedHost successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateDedicatedHost(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DedicatedHostProfileIdentityByName model
				dedicatedHostProfileIdentityModel := new(vpcv1.DedicatedHostProfileIdentityByName)
				dedicatedHostProfileIdentityModel.Name = core.StringPtr("mx2-host-152x1216")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the DedicatedHostGroupIdentityByID model
				dedicatedHostGroupIdentityModel := new(vpcv1.DedicatedHostGroupIdentityByID)
				dedicatedHostGroupIdentityModel.ID = core.StringPtr("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

				// Construct an instance of the DedicatedHostPrototypeDedicatedHostByGroup model
				dedicatedHostPrototypeModel := new(vpcv1.DedicatedHostPrototypeDedicatedHostByGroup)
				dedicatedHostPrototypeModel.InstancePlacementEnabled = core.BoolPtr(true)
				dedicatedHostPrototypeModel.Name = core.StringPtr("my-host")
				dedicatedHostPrototypeModel.Profile = dedicatedHostProfileIdentityModel
				dedicatedHostPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				dedicatedHostPrototypeModel.Group = dedicatedHostGroupIdentityModel

				// Construct an instance of the CreateDedicatedHostOptions model
				createDedicatedHostOptionsModel := new(vpcv1.CreateDedicatedHostOptions)
				createDedicatedHostOptionsModel.DedicatedHostPrototype = dedicatedHostPrototypeModel
				createDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateDedicatedHost(createDedicatedHostOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateDedicatedHost with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DedicatedHostProfileIdentityByName model
				dedicatedHostProfileIdentityModel := new(vpcv1.DedicatedHostProfileIdentityByName)
				dedicatedHostProfileIdentityModel.Name = core.StringPtr("mx2-host-152x1216")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the DedicatedHostGroupIdentityByID model
				dedicatedHostGroupIdentityModel := new(vpcv1.DedicatedHostGroupIdentityByID)
				dedicatedHostGroupIdentityModel.ID = core.StringPtr("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

				// Construct an instance of the DedicatedHostPrototypeDedicatedHostByGroup model
				dedicatedHostPrototypeModel := new(vpcv1.DedicatedHostPrototypeDedicatedHostByGroup)
				dedicatedHostPrototypeModel.InstancePlacementEnabled = core.BoolPtr(true)
				dedicatedHostPrototypeModel.Name = core.StringPtr("my-host")
				dedicatedHostPrototypeModel.Profile = dedicatedHostProfileIdentityModel
				dedicatedHostPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				dedicatedHostPrototypeModel.Group = dedicatedHostGroupIdentityModel

				// Construct an instance of the CreateDedicatedHostOptions model
				createDedicatedHostOptionsModel := new(vpcv1.CreateDedicatedHostOptions)
				createDedicatedHostOptionsModel.DedicatedHostPrototype = dedicatedHostPrototypeModel
				createDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateDedicatedHost(createDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateDedicatedHostOptions model with no property values
				createDedicatedHostOptionsModelNew := new(vpcv1.CreateDedicatedHostOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateDedicatedHost(createDedicatedHostOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateDedicatedHost successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DedicatedHostProfileIdentityByName model
				dedicatedHostProfileIdentityModel := new(vpcv1.DedicatedHostProfileIdentityByName)
				dedicatedHostProfileIdentityModel.Name = core.StringPtr("mx2-host-152x1216")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the DedicatedHostGroupIdentityByID model
				dedicatedHostGroupIdentityModel := new(vpcv1.DedicatedHostGroupIdentityByID)
				dedicatedHostGroupIdentityModel.ID = core.StringPtr("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

				// Construct an instance of the DedicatedHostPrototypeDedicatedHostByGroup model
				dedicatedHostPrototypeModel := new(vpcv1.DedicatedHostPrototypeDedicatedHostByGroup)
				dedicatedHostPrototypeModel.InstancePlacementEnabled = core.BoolPtr(true)
				dedicatedHostPrototypeModel.Name = core.StringPtr("my-host")
				dedicatedHostPrototypeModel.Profile = dedicatedHostProfileIdentityModel
				dedicatedHostPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				dedicatedHostPrototypeModel.Group = dedicatedHostGroupIdentityModel

				// Construct an instance of the CreateDedicatedHostOptions model
				createDedicatedHostOptionsModel := new(vpcv1.CreateDedicatedHostOptions)
				createDedicatedHostOptionsModel.DedicatedHostPrototype = dedicatedHostPrototypeModel
				createDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateDedicatedHost(createDedicatedHostOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListDedicatedHostDisks(listDedicatedHostDisksOptions *ListDedicatedHostDisksOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listDedicatedHostDisksPath := "/dedicated_hosts/testString/disks"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostDisksPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListDedicatedHostDisks with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListDedicatedHostDisksOptions model
				listDedicatedHostDisksOptionsModel := new(vpcv1.ListDedicatedHostDisksOptions)
				listDedicatedHostDisksOptionsModel.DedicatedHostID = core.StringPtr("testString")
				listDedicatedHostDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListDedicatedHostDisks(listDedicatedHostDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListDedicatedHostDisks(listDedicatedHostDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListDedicatedHostDisks(listDedicatedHostDisksOptions *ListDedicatedHostDisksOptions)`, func() {
		version := "2024-06-23"
		listDedicatedHostDisksPath := "/dedicated_hosts/testString/disks"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostDisksPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}]}`)
				}))
			})
			It(`Invoke ListDedicatedHostDisks successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListDedicatedHostDisksOptions model
				listDedicatedHostDisksOptionsModel := new(vpcv1.ListDedicatedHostDisksOptions)
				listDedicatedHostDisksOptionsModel.DedicatedHostID = core.StringPtr("testString")
				listDedicatedHostDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListDedicatedHostDisksWithContext(ctx, listDedicatedHostDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListDedicatedHostDisks(listDedicatedHostDisksOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListDedicatedHostDisksWithContext(ctx, listDedicatedHostDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listDedicatedHostDisksPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}]}`)
				}))
			})
			It(`Invoke ListDedicatedHostDisks successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListDedicatedHostDisks(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListDedicatedHostDisksOptions model
				listDedicatedHostDisksOptionsModel := new(vpcv1.ListDedicatedHostDisksOptions)
				listDedicatedHostDisksOptionsModel.DedicatedHostID = core.StringPtr("testString")
				listDedicatedHostDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListDedicatedHostDisks(listDedicatedHostDisksOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListDedicatedHostDisks with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListDedicatedHostDisksOptions model
				listDedicatedHostDisksOptionsModel := new(vpcv1.ListDedicatedHostDisksOptions)
				listDedicatedHostDisksOptionsModel.DedicatedHostID = core.StringPtr("testString")
				listDedicatedHostDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListDedicatedHostDisks(listDedicatedHostDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListDedicatedHostDisksOptions model with no property values
				listDedicatedHostDisksOptionsModelNew := new(vpcv1.ListDedicatedHostDisksOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListDedicatedHostDisks(listDedicatedHostDisksOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListDedicatedHostDisks successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListDedicatedHostDisksOptions model
				listDedicatedHostDisksOptionsModel := new(vpcv1.ListDedicatedHostDisksOptions)
				listDedicatedHostDisksOptionsModel.DedicatedHostID = core.StringPtr("testString")
				listDedicatedHostDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListDedicatedHostDisks(listDedicatedHostDisksOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetDedicatedHostDisk(getDedicatedHostDiskOptions *GetDedicatedHostDiskOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getDedicatedHostDiskPath := "/dedicated_hosts/testString/disks/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getDedicatedHostDiskPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetDedicatedHostDisk with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetDedicatedHostDiskOptions model
				getDedicatedHostDiskOptionsModel := new(vpcv1.GetDedicatedHostDiskOptions)
				getDedicatedHostDiskOptionsModel.DedicatedHostID = core.StringPtr("testString")
				getDedicatedHostDiskOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetDedicatedHostDisk(getDedicatedHostDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetDedicatedHostDisk(getDedicatedHostDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetDedicatedHostDisk(getDedicatedHostDiskOptions *GetDedicatedHostDiskOptions)`, func() {
		version := "2024-06-23"
		getDedicatedHostDiskPath := "/dedicated_hosts/testString/disks/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getDedicatedHostDiskPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}`)
				}))
			})
			It(`Invoke GetDedicatedHostDisk successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetDedicatedHostDiskOptions model
				getDedicatedHostDiskOptionsModel := new(vpcv1.GetDedicatedHostDiskOptions)
				getDedicatedHostDiskOptionsModel.DedicatedHostID = core.StringPtr("testString")
				getDedicatedHostDiskOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetDedicatedHostDiskWithContext(ctx, getDedicatedHostDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetDedicatedHostDisk(getDedicatedHostDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetDedicatedHostDiskWithContext(ctx, getDedicatedHostDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getDedicatedHostDiskPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}`)
				}))
			})
			It(`Invoke GetDedicatedHostDisk successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetDedicatedHostDisk(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetDedicatedHostDiskOptions model
				getDedicatedHostDiskOptionsModel := new(vpcv1.GetDedicatedHostDiskOptions)
				getDedicatedHostDiskOptionsModel.DedicatedHostID = core.StringPtr("testString")
				getDedicatedHostDiskOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetDedicatedHostDisk(getDedicatedHostDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetDedicatedHostDisk with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetDedicatedHostDiskOptions model
				getDedicatedHostDiskOptionsModel := new(vpcv1.GetDedicatedHostDiskOptions)
				getDedicatedHostDiskOptionsModel.DedicatedHostID = core.StringPtr("testString")
				getDedicatedHostDiskOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetDedicatedHostDisk(getDedicatedHostDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetDedicatedHostDiskOptions model with no property values
				getDedicatedHostDiskOptionsModelNew := new(vpcv1.GetDedicatedHostDiskOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetDedicatedHostDisk(getDedicatedHostDiskOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetDedicatedHostDisk successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetDedicatedHostDiskOptions model
				getDedicatedHostDiskOptionsModel := new(vpcv1.GetDedicatedHostDiskOptions)
				getDedicatedHostDiskOptionsModel.DedicatedHostID = core.StringPtr("testString")
				getDedicatedHostDiskOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetDedicatedHostDisk(getDedicatedHostDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateDedicatedHostDisk(updateDedicatedHostDiskOptions *UpdateDedicatedHostDiskOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateDedicatedHostDiskPath := "/dedicated_hosts/testString/disks/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateDedicatedHostDiskPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateDedicatedHostDisk with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DedicatedHostDiskPatch model
				dedicatedHostDiskPatchModel := new(vpcv1.DedicatedHostDiskPatch)
				dedicatedHostDiskPatchModel.Name = core.StringPtr("my-dedicated-host-disk-updated")
				dedicatedHostDiskPatchModelAsPatch, asPatchErr := dedicatedHostDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostDiskOptions model
				updateDedicatedHostDiskOptionsModel := new(vpcv1.UpdateDedicatedHostDiskOptions)
				updateDedicatedHostDiskOptionsModel.DedicatedHostID = core.StringPtr("testString")
				updateDedicatedHostDiskOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostDiskOptionsModel.DedicatedHostDiskPatch = dedicatedHostDiskPatchModelAsPatch
				updateDedicatedHostDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateDedicatedHostDisk(updateDedicatedHostDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateDedicatedHostDisk(updateDedicatedHostDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateDedicatedHostDisk(updateDedicatedHostDiskOptions *UpdateDedicatedHostDiskOptions)`, func() {
		version := "2024-06-23"
		updateDedicatedHostDiskPath := "/dedicated_hosts/testString/disks/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateDedicatedHostDiskPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}`)
				}))
			})
			It(`Invoke UpdateDedicatedHostDisk successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DedicatedHostDiskPatch model
				dedicatedHostDiskPatchModel := new(vpcv1.DedicatedHostDiskPatch)
				dedicatedHostDiskPatchModel.Name = core.StringPtr("my-dedicated-host-disk-updated")
				dedicatedHostDiskPatchModelAsPatch, asPatchErr := dedicatedHostDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostDiskOptions model
				updateDedicatedHostDiskOptionsModel := new(vpcv1.UpdateDedicatedHostDiskOptions)
				updateDedicatedHostDiskOptionsModel.DedicatedHostID = core.StringPtr("testString")
				updateDedicatedHostDiskOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostDiskOptionsModel.DedicatedHostDiskPatch = dedicatedHostDiskPatchModelAsPatch
				updateDedicatedHostDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateDedicatedHostDiskWithContext(ctx, updateDedicatedHostDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateDedicatedHostDisk(updateDedicatedHostDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateDedicatedHostDiskWithContext(ctx, updateDedicatedHostDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateDedicatedHostDiskPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}`)
				}))
			})
			It(`Invoke UpdateDedicatedHostDisk successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateDedicatedHostDisk(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DedicatedHostDiskPatch model
				dedicatedHostDiskPatchModel := new(vpcv1.DedicatedHostDiskPatch)
				dedicatedHostDiskPatchModel.Name = core.StringPtr("my-dedicated-host-disk-updated")
				dedicatedHostDiskPatchModelAsPatch, asPatchErr := dedicatedHostDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostDiskOptions model
				updateDedicatedHostDiskOptionsModel := new(vpcv1.UpdateDedicatedHostDiskOptions)
				updateDedicatedHostDiskOptionsModel.DedicatedHostID = core.StringPtr("testString")
				updateDedicatedHostDiskOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostDiskOptionsModel.DedicatedHostDiskPatch = dedicatedHostDiskPatchModelAsPatch
				updateDedicatedHostDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateDedicatedHostDisk(updateDedicatedHostDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateDedicatedHostDisk with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DedicatedHostDiskPatch model
				dedicatedHostDiskPatchModel := new(vpcv1.DedicatedHostDiskPatch)
				dedicatedHostDiskPatchModel.Name = core.StringPtr("my-dedicated-host-disk-updated")
				dedicatedHostDiskPatchModelAsPatch, asPatchErr := dedicatedHostDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostDiskOptions model
				updateDedicatedHostDiskOptionsModel := new(vpcv1.UpdateDedicatedHostDiskOptions)
				updateDedicatedHostDiskOptionsModel.DedicatedHostID = core.StringPtr("testString")
				updateDedicatedHostDiskOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostDiskOptionsModel.DedicatedHostDiskPatch = dedicatedHostDiskPatchModelAsPatch
				updateDedicatedHostDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateDedicatedHostDisk(updateDedicatedHostDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateDedicatedHostDiskOptions model with no property values
				updateDedicatedHostDiskOptionsModelNew := new(vpcv1.UpdateDedicatedHostDiskOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateDedicatedHostDisk(updateDedicatedHostDiskOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateDedicatedHostDisk successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DedicatedHostDiskPatch model
				dedicatedHostDiskPatchModel := new(vpcv1.DedicatedHostDiskPatch)
				dedicatedHostDiskPatchModel.Name = core.StringPtr("my-dedicated-host-disk-updated")
				dedicatedHostDiskPatchModelAsPatch, asPatchErr := dedicatedHostDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostDiskOptions model
				updateDedicatedHostDiskOptionsModel := new(vpcv1.UpdateDedicatedHostDiskOptions)
				updateDedicatedHostDiskOptionsModel.DedicatedHostID = core.StringPtr("testString")
				updateDedicatedHostDiskOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostDiskOptionsModel.DedicatedHostDiskPatch = dedicatedHostDiskPatchModelAsPatch
				updateDedicatedHostDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateDedicatedHostDisk(updateDedicatedHostDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteDedicatedHost(deleteDedicatedHostOptions *DeleteDedicatedHostOptions)`, func() {
		version := "2024-06-23"
		deleteDedicatedHostPath := "/dedicated_hosts/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteDedicatedHostPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteDedicatedHost successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteDedicatedHost(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteDedicatedHostOptions model
				deleteDedicatedHostOptionsModel := new(vpcv1.DeleteDedicatedHostOptions)
				deleteDedicatedHostOptionsModel.ID = core.StringPtr("testString")
				deleteDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteDedicatedHost(deleteDedicatedHostOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteDedicatedHost with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteDedicatedHostOptions model
				deleteDedicatedHostOptionsModel := new(vpcv1.DeleteDedicatedHostOptions)
				deleteDedicatedHostOptionsModel.ID = core.StringPtr("testString")
				deleteDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteDedicatedHost(deleteDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteDedicatedHostOptions model with no property values
				deleteDedicatedHostOptionsModelNew := new(vpcv1.DeleteDedicatedHostOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteDedicatedHost(deleteDedicatedHostOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetDedicatedHost(getDedicatedHostOptions *GetDedicatedHostOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getDedicatedHostPath := "/dedicated_hosts/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getDedicatedHostPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetDedicatedHost with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetDedicatedHostOptions model
				getDedicatedHostOptionsModel := new(vpcv1.GetDedicatedHostOptions)
				getDedicatedHostOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetDedicatedHost(getDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetDedicatedHost(getDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetDedicatedHost(getDedicatedHostOptions *GetDedicatedHostOptions)`, func() {
		version := "2024-06-23"
		getDedicatedHostPath := "/dedicated_hosts/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getDedicatedHostPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetDedicatedHost successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetDedicatedHostOptions model
				getDedicatedHostOptionsModel := new(vpcv1.GetDedicatedHostOptions)
				getDedicatedHostOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetDedicatedHostWithContext(ctx, getDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetDedicatedHost(getDedicatedHostOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetDedicatedHostWithContext(ctx, getDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getDedicatedHostPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetDedicatedHost successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetDedicatedHost(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetDedicatedHostOptions model
				getDedicatedHostOptionsModel := new(vpcv1.GetDedicatedHostOptions)
				getDedicatedHostOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetDedicatedHost(getDedicatedHostOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetDedicatedHost with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetDedicatedHostOptions model
				getDedicatedHostOptionsModel := new(vpcv1.GetDedicatedHostOptions)
				getDedicatedHostOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetDedicatedHost(getDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetDedicatedHostOptions model with no property values
				getDedicatedHostOptionsModelNew := new(vpcv1.GetDedicatedHostOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetDedicatedHost(getDedicatedHostOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetDedicatedHost successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetDedicatedHostOptions model
				getDedicatedHostOptionsModel := new(vpcv1.GetDedicatedHostOptions)
				getDedicatedHostOptionsModel.ID = core.StringPtr("testString")
				getDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetDedicatedHost(getDedicatedHostOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateDedicatedHost(updateDedicatedHostOptions *UpdateDedicatedHostOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateDedicatedHostPath := "/dedicated_hosts/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateDedicatedHostPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateDedicatedHost with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DedicatedHostPatch model
				dedicatedHostPatchModel := new(vpcv1.DedicatedHostPatch)
				dedicatedHostPatchModel.InstancePlacementEnabled = core.BoolPtr(false)
				dedicatedHostPatchModel.Name = core.StringPtr("my-host")
				dedicatedHostPatchModelAsPatch, asPatchErr := dedicatedHostPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostOptions model
				updateDedicatedHostOptionsModel := new(vpcv1.UpdateDedicatedHostOptions)
				updateDedicatedHostOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostOptionsModel.DedicatedHostPatch = dedicatedHostPatchModelAsPatch
				updateDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateDedicatedHost(updateDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateDedicatedHost(updateDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateDedicatedHost(updateDedicatedHostOptions *UpdateDedicatedHostOptions)`, func() {
		version := "2024-06-23"
		updateDedicatedHostPath := "/dedicated_hosts/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateDedicatedHostPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateDedicatedHost successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DedicatedHostPatch model
				dedicatedHostPatchModel := new(vpcv1.DedicatedHostPatch)
				dedicatedHostPatchModel.InstancePlacementEnabled = core.BoolPtr(false)
				dedicatedHostPatchModel.Name = core.StringPtr("my-host")
				dedicatedHostPatchModelAsPatch, asPatchErr := dedicatedHostPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostOptions model
				updateDedicatedHostOptionsModel := new(vpcv1.UpdateDedicatedHostOptions)
				updateDedicatedHostOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostOptionsModel.DedicatedHostPatch = dedicatedHostPatchModelAsPatch
				updateDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateDedicatedHostWithContext(ctx, updateDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateDedicatedHost(updateDedicatedHostOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateDedicatedHostWithContext(ctx, updateDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateDedicatedHostPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateDedicatedHost successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateDedicatedHost(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DedicatedHostPatch model
				dedicatedHostPatchModel := new(vpcv1.DedicatedHostPatch)
				dedicatedHostPatchModel.InstancePlacementEnabled = core.BoolPtr(false)
				dedicatedHostPatchModel.Name = core.StringPtr("my-host")
				dedicatedHostPatchModelAsPatch, asPatchErr := dedicatedHostPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostOptions model
				updateDedicatedHostOptionsModel := new(vpcv1.UpdateDedicatedHostOptions)
				updateDedicatedHostOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostOptionsModel.DedicatedHostPatch = dedicatedHostPatchModelAsPatch
				updateDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateDedicatedHost(updateDedicatedHostOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateDedicatedHost with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DedicatedHostPatch model
				dedicatedHostPatchModel := new(vpcv1.DedicatedHostPatch)
				dedicatedHostPatchModel.InstancePlacementEnabled = core.BoolPtr(false)
				dedicatedHostPatchModel.Name = core.StringPtr("my-host")
				dedicatedHostPatchModelAsPatch, asPatchErr := dedicatedHostPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostOptions model
				updateDedicatedHostOptionsModel := new(vpcv1.UpdateDedicatedHostOptions)
				updateDedicatedHostOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostOptionsModel.DedicatedHostPatch = dedicatedHostPatchModelAsPatch
				updateDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateDedicatedHost(updateDedicatedHostOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateDedicatedHostOptions model with no property values
				updateDedicatedHostOptionsModelNew := new(vpcv1.UpdateDedicatedHostOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateDedicatedHost(updateDedicatedHostOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateDedicatedHost successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DedicatedHostPatch model
				dedicatedHostPatchModel := new(vpcv1.DedicatedHostPatch)
				dedicatedHostPatchModel.InstancePlacementEnabled = core.BoolPtr(false)
				dedicatedHostPatchModel.Name = core.StringPtr("my-host")
				dedicatedHostPatchModelAsPatch, asPatchErr := dedicatedHostPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateDedicatedHostOptions model
				updateDedicatedHostOptionsModel := new(vpcv1.UpdateDedicatedHostOptions)
				updateDedicatedHostOptionsModel.ID = core.StringPtr("testString")
				updateDedicatedHostOptionsModel.DedicatedHostPatch = dedicatedHostPatchModelAsPatch
				updateDedicatedHostOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateDedicatedHost(updateDedicatedHostOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListEndpointGateways(listEndpointGatewaysOptions *ListEndpointGatewaysOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listEndpointGatewaysPath := "/endpoint_gateways"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listEndpointGatewaysPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// TODO: Add check for allow_resource_binding query parameter
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					// TODO: Add check for allow_dns_resolution_binding query parameter
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListEndpointGateways with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListEndpointGatewaysOptions model
				listEndpointGatewaysOptionsModel := new(vpcv1.ListEndpointGatewaysOptions)
				listEndpointGatewaysOptionsModel.AllowResourceBinding = core.BoolPtr(true)
				listEndpointGatewaysOptionsModel.Name = core.StringPtr("my-name")
				listEndpointGatewaysOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.LifecycleState = []string{"stable"}
				listEndpointGatewaysOptionsModel.VPCID = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listEndpointGatewaysOptionsModel.VPCName = core.StringPtr("my-vpc")
				listEndpointGatewaysOptionsModel.AllowDnsResolutionBinding = core.BoolPtr(true)
				listEndpointGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListEndpointGateways(listEndpointGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListEndpointGateways(listEndpointGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListEndpointGateways(listEndpointGatewaysOptions *ListEndpointGatewaysOptions)`, func() {
		version := "2024-06-23"
		listEndpointGatewaysPath := "/endpoint_gateways"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listEndpointGatewaysPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// TODO: Add check for allow_resource_binding query parameter
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					// TODO: Add check for allow_dns_resolution_binding query parameter
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"endpoint_gateways": [{"allow_dns_resolution_binding": false, "allow_resource_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListEndpointGateways successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListEndpointGatewaysOptions model
				listEndpointGatewaysOptionsModel := new(vpcv1.ListEndpointGatewaysOptions)
				listEndpointGatewaysOptionsModel.AllowResourceBinding = core.BoolPtr(true)
				listEndpointGatewaysOptionsModel.Name = core.StringPtr("my-name")
				listEndpointGatewaysOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.LifecycleState = []string{"stable"}
				listEndpointGatewaysOptionsModel.VPCID = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listEndpointGatewaysOptionsModel.VPCName = core.StringPtr("my-vpc")
				listEndpointGatewaysOptionsModel.AllowDnsResolutionBinding = core.BoolPtr(true)
				listEndpointGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListEndpointGatewaysWithContext(ctx, listEndpointGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListEndpointGateways(listEndpointGatewaysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListEndpointGatewaysWithContext(ctx, listEndpointGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listEndpointGatewaysPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// TODO: Add check for allow_resource_binding query parameter
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					// TODO: Add check for allow_dns_resolution_binding query parameter
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"endpoint_gateways": [{"allow_dns_resolution_binding": false, "allow_resource_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListEndpointGateways successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListEndpointGateways(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListEndpointGatewaysOptions model
				listEndpointGatewaysOptionsModel := new(vpcv1.ListEndpointGatewaysOptions)
				listEndpointGatewaysOptionsModel.AllowResourceBinding = core.BoolPtr(true)
				listEndpointGatewaysOptionsModel.Name = core.StringPtr("my-name")
				listEndpointGatewaysOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.LifecycleState = []string{"stable"}
				listEndpointGatewaysOptionsModel.VPCID = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listEndpointGatewaysOptionsModel.VPCName = core.StringPtr("my-vpc")
				listEndpointGatewaysOptionsModel.AllowDnsResolutionBinding = core.BoolPtr(true)
				listEndpointGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListEndpointGateways(listEndpointGatewaysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListEndpointGateways with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListEndpointGatewaysOptions model
				listEndpointGatewaysOptionsModel := new(vpcv1.ListEndpointGatewaysOptions)
				listEndpointGatewaysOptionsModel.AllowResourceBinding = core.BoolPtr(true)
				listEndpointGatewaysOptionsModel.Name = core.StringPtr("my-name")
				listEndpointGatewaysOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.LifecycleState = []string{"stable"}
				listEndpointGatewaysOptionsModel.VPCID = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listEndpointGatewaysOptionsModel.VPCName = core.StringPtr("my-vpc")
				listEndpointGatewaysOptionsModel.AllowDnsResolutionBinding = core.BoolPtr(true)
				listEndpointGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListEndpointGateways(listEndpointGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListEndpointGateways successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListEndpointGatewaysOptions model
				listEndpointGatewaysOptionsModel := new(vpcv1.ListEndpointGatewaysOptions)
				listEndpointGatewaysOptionsModel.AllowResourceBinding = core.BoolPtr(true)
				listEndpointGatewaysOptionsModel.Name = core.StringPtr("my-name")
				listEndpointGatewaysOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.LifecycleState = []string{"stable"}
				listEndpointGatewaysOptionsModel.VPCID = core.StringPtr("testString")
				listEndpointGatewaysOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listEndpointGatewaysOptionsModel.VPCName = core.StringPtr("my-vpc")
				listEndpointGatewaysOptionsModel.AllowDnsResolutionBinding = core.BoolPtr(true)
				listEndpointGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListEndpointGateways(listEndpointGatewaysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.EndpointGatewayCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.EndpointGatewayCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.EndpointGatewayCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listEndpointGatewaysPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"endpoint_gateways":[{"allow_dns_resolution_binding":false,"allow_resource_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","id":"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_reasons":[{"code":"dns_resolution_binding_pending","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5","id":"r006-7268d425-59b7-48fd-9735-81a7271657d5","name":"my-private-path-service-gateway","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"private_path_service_gateway"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"endpoint_gateways":[{"allow_dns_resolution_binding":false,"allow_resource_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","id":"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_reasons":[{"code":"dns_resolution_binding_pending","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5","id":"r006-7268d425-59b7-48fd-9735-81a7271657d5","name":"my-private-path-service-gateway","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"private_path_service_gateway"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use EndpointGatewaysPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listEndpointGatewaysOptionsModel := &vpcv1.ListEndpointGatewaysOptions{
					AllowResourceBinding:      core.BoolPtr(true),
					Name:                      core.StringPtr("my-name"),
					Limit:                     core.Int64Ptr(int64(10)),
					ResourceGroupID:           core.StringPtr("testString"),
					LifecycleState:            []string{"stable"},
					VPCID:                     core.StringPtr("testString"),
					VPCCRN:                    core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:                   core.StringPtr("my-vpc"),
					AllowDnsResolutionBinding: core.BoolPtr(true),
				}

				pager, err := vpcService.NewEndpointGatewaysPager(listEndpointGatewaysOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.EndpointGateway
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use EndpointGatewaysPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listEndpointGatewaysOptionsModel := &vpcv1.ListEndpointGatewaysOptions{
					AllowResourceBinding:      core.BoolPtr(true),
					Name:                      core.StringPtr("my-name"),
					Limit:                     core.Int64Ptr(int64(10)),
					ResourceGroupID:           core.StringPtr("testString"),
					LifecycleState:            []string{"stable"},
					VPCID:                     core.StringPtr("testString"),
					VPCCRN:                    core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:                   core.StringPtr("my-vpc"),
					AllowDnsResolutionBinding: core.BoolPtr(true),
				}

				pager, err := vpcService.NewEndpointGatewaysPager(listEndpointGatewaysOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateEndpointGateway(createEndpointGatewayOptions *CreateEndpointGatewayOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createEndpointGatewayPath := "/endpoint_gateways"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createEndpointGatewayPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateEndpointGateway with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype model
				endpointGatewayTargetPrototypeModel := new(vpcv1.EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype)
				endpointGatewayTargetPrototypeModel.Name = core.StringPtr("ibm-ntp-server")
				endpointGatewayTargetPrototypeModel.ResourceType = core.StringPtr("provider_infrastructure_service")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the EndpointGatewayReservedIPReservedIPIdentityByID model
				endpointGatewayReservedIPModel := new(vpcv1.EndpointGatewayReservedIPReservedIPIdentityByID)
				endpointGatewayReservedIPModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateEndpointGatewayOptions model
				createEndpointGatewayOptionsModel := new(vpcv1.CreateEndpointGatewayOptions)
				createEndpointGatewayOptionsModel.Target = endpointGatewayTargetPrototypeModel
				createEndpointGatewayOptionsModel.VPC = vpcIdentityModel
				createEndpointGatewayOptionsModel.AllowDnsResolutionBinding = core.BoolPtr(true)
				createEndpointGatewayOptionsModel.AllowResourceBinding = core.BoolPtr(false)
				createEndpointGatewayOptionsModel.Ips = []vpcv1.EndpointGatewayReservedIPIntf{endpointGatewayReservedIPModel}
				createEndpointGatewayOptionsModel.Name = core.StringPtr("testString")
				createEndpointGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createEndpointGatewayOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateEndpointGateway(createEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateEndpointGateway(createEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateEndpointGateway(createEndpointGatewayOptions *CreateEndpointGatewayOptions)`, func() {
		version := "2024-06-23"
		createEndpointGatewayPath := "/endpoint_gateways"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createEndpointGatewayPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"allow_dns_resolution_binding": false, "allow_resource_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateEndpointGateway successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype model
				endpointGatewayTargetPrototypeModel := new(vpcv1.EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype)
				endpointGatewayTargetPrototypeModel.Name = core.StringPtr("ibm-ntp-server")
				endpointGatewayTargetPrototypeModel.ResourceType = core.StringPtr("provider_infrastructure_service")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the EndpointGatewayReservedIPReservedIPIdentityByID model
				endpointGatewayReservedIPModel := new(vpcv1.EndpointGatewayReservedIPReservedIPIdentityByID)
				endpointGatewayReservedIPModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateEndpointGatewayOptions model
				createEndpointGatewayOptionsModel := new(vpcv1.CreateEndpointGatewayOptions)
				createEndpointGatewayOptionsModel.Target = endpointGatewayTargetPrototypeModel
				createEndpointGatewayOptionsModel.VPC = vpcIdentityModel
				createEndpointGatewayOptionsModel.AllowDnsResolutionBinding = core.BoolPtr(true)
				createEndpointGatewayOptionsModel.AllowResourceBinding = core.BoolPtr(false)
				createEndpointGatewayOptionsModel.Ips = []vpcv1.EndpointGatewayReservedIPIntf{endpointGatewayReservedIPModel}
				createEndpointGatewayOptionsModel.Name = core.StringPtr("testString")
				createEndpointGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createEndpointGatewayOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateEndpointGatewayWithContext(ctx, createEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateEndpointGateway(createEndpointGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateEndpointGatewayWithContext(ctx, createEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createEndpointGatewayPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"allow_dns_resolution_binding": false, "allow_resource_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateEndpointGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateEndpointGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype model
				endpointGatewayTargetPrototypeModel := new(vpcv1.EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype)
				endpointGatewayTargetPrototypeModel.Name = core.StringPtr("ibm-ntp-server")
				endpointGatewayTargetPrototypeModel.ResourceType = core.StringPtr("provider_infrastructure_service")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the EndpointGatewayReservedIPReservedIPIdentityByID model
				endpointGatewayReservedIPModel := new(vpcv1.EndpointGatewayReservedIPReservedIPIdentityByID)
				endpointGatewayReservedIPModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateEndpointGatewayOptions model
				createEndpointGatewayOptionsModel := new(vpcv1.CreateEndpointGatewayOptions)
				createEndpointGatewayOptionsModel.Target = endpointGatewayTargetPrototypeModel
				createEndpointGatewayOptionsModel.VPC = vpcIdentityModel
				createEndpointGatewayOptionsModel.AllowDnsResolutionBinding = core.BoolPtr(true)
				createEndpointGatewayOptionsModel.AllowResourceBinding = core.BoolPtr(false)
				createEndpointGatewayOptionsModel.Ips = []vpcv1.EndpointGatewayReservedIPIntf{endpointGatewayReservedIPModel}
				createEndpointGatewayOptionsModel.Name = core.StringPtr("testString")
				createEndpointGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createEndpointGatewayOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateEndpointGateway(createEndpointGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateEndpointGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype model
				endpointGatewayTargetPrototypeModel := new(vpcv1.EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype)
				endpointGatewayTargetPrototypeModel.Name = core.StringPtr("ibm-ntp-server")
				endpointGatewayTargetPrototypeModel.ResourceType = core.StringPtr("provider_infrastructure_service")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the EndpointGatewayReservedIPReservedIPIdentityByID model
				endpointGatewayReservedIPModel := new(vpcv1.EndpointGatewayReservedIPReservedIPIdentityByID)
				endpointGatewayReservedIPModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateEndpointGatewayOptions model
				createEndpointGatewayOptionsModel := new(vpcv1.CreateEndpointGatewayOptions)
				createEndpointGatewayOptionsModel.Target = endpointGatewayTargetPrototypeModel
				createEndpointGatewayOptionsModel.VPC = vpcIdentityModel
				createEndpointGatewayOptionsModel.AllowDnsResolutionBinding = core.BoolPtr(true)
				createEndpointGatewayOptionsModel.AllowResourceBinding = core.BoolPtr(false)
				createEndpointGatewayOptionsModel.Ips = []vpcv1.EndpointGatewayReservedIPIntf{endpointGatewayReservedIPModel}
				createEndpointGatewayOptionsModel.Name = core.StringPtr("testString")
				createEndpointGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createEndpointGatewayOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateEndpointGateway(createEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateEndpointGatewayOptions model with no property values
				createEndpointGatewayOptionsModelNew := new(vpcv1.CreateEndpointGatewayOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateEndpointGateway(createEndpointGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateEndpointGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype model
				endpointGatewayTargetPrototypeModel := new(vpcv1.EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype)
				endpointGatewayTargetPrototypeModel.Name = core.StringPtr("ibm-ntp-server")
				endpointGatewayTargetPrototypeModel.ResourceType = core.StringPtr("provider_infrastructure_service")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the EndpointGatewayReservedIPReservedIPIdentityByID model
				endpointGatewayReservedIPModel := new(vpcv1.EndpointGatewayReservedIPReservedIPIdentityByID)
				endpointGatewayReservedIPModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateEndpointGatewayOptions model
				createEndpointGatewayOptionsModel := new(vpcv1.CreateEndpointGatewayOptions)
				createEndpointGatewayOptionsModel.Target = endpointGatewayTargetPrototypeModel
				createEndpointGatewayOptionsModel.VPC = vpcIdentityModel
				createEndpointGatewayOptionsModel.AllowDnsResolutionBinding = core.BoolPtr(true)
				createEndpointGatewayOptionsModel.AllowResourceBinding = core.BoolPtr(false)
				createEndpointGatewayOptionsModel.Ips = []vpcv1.EndpointGatewayReservedIPIntf{endpointGatewayReservedIPModel}
				createEndpointGatewayOptionsModel.Name = core.StringPtr("testString")
				createEndpointGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createEndpointGatewayOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateEndpointGateway(createEndpointGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListEndpointGatewayIps(listEndpointGatewayIpsOptions *ListEndpointGatewayIpsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listEndpointGatewayIpsPath := "/endpoint_gateways/testString/ips"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listEndpointGatewayIpsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListEndpointGatewayIps with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListEndpointGatewayIpsOptions model
				listEndpointGatewayIpsOptionsModel := new(vpcv1.ListEndpointGatewayIpsOptions)
				listEndpointGatewayIpsOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				listEndpointGatewayIpsOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewayIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewayIpsOptionsModel.Sort = core.StringPtr("name")
				listEndpointGatewayIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListEndpointGatewayIps(listEndpointGatewayIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListEndpointGatewayIps(listEndpointGatewayIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListEndpointGatewayIps(listEndpointGatewayIpsOptions *ListEndpointGatewayIpsOptions)`, func() {
		version := "2024-06-23"
		listEndpointGatewayIpsPath := "/endpoint_gateways/testString/ips"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listEndpointGatewayIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListEndpointGatewayIps successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListEndpointGatewayIpsOptions model
				listEndpointGatewayIpsOptionsModel := new(vpcv1.ListEndpointGatewayIpsOptions)
				listEndpointGatewayIpsOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				listEndpointGatewayIpsOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewayIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewayIpsOptionsModel.Sort = core.StringPtr("name")
				listEndpointGatewayIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListEndpointGatewayIpsWithContext(ctx, listEndpointGatewayIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListEndpointGatewayIps(listEndpointGatewayIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListEndpointGatewayIpsWithContext(ctx, listEndpointGatewayIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listEndpointGatewayIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListEndpointGatewayIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListEndpointGatewayIps(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListEndpointGatewayIpsOptions model
				listEndpointGatewayIpsOptionsModel := new(vpcv1.ListEndpointGatewayIpsOptions)
				listEndpointGatewayIpsOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				listEndpointGatewayIpsOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewayIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewayIpsOptionsModel.Sort = core.StringPtr("name")
				listEndpointGatewayIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListEndpointGatewayIps(listEndpointGatewayIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListEndpointGatewayIps with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListEndpointGatewayIpsOptions model
				listEndpointGatewayIpsOptionsModel := new(vpcv1.ListEndpointGatewayIpsOptions)
				listEndpointGatewayIpsOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				listEndpointGatewayIpsOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewayIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewayIpsOptionsModel.Sort = core.StringPtr("name")
				listEndpointGatewayIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListEndpointGatewayIps(listEndpointGatewayIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListEndpointGatewayIpsOptions model with no property values
				listEndpointGatewayIpsOptionsModelNew := new(vpcv1.ListEndpointGatewayIpsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListEndpointGatewayIps(listEndpointGatewayIpsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListEndpointGatewayIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListEndpointGatewayIpsOptions model
				listEndpointGatewayIpsOptionsModel := new(vpcv1.ListEndpointGatewayIpsOptions)
				listEndpointGatewayIpsOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				listEndpointGatewayIpsOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewayIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewayIpsOptionsModel.Sort = core.StringPtr("name")
				listEndpointGatewayIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListEndpointGatewayIps(listEndpointGatewayIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ReservedIPCollectionEndpointGatewayContext)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ReservedIPCollectionEndpointGatewayContext)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ReservedIPCollectionEndpointGatewayContext)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listEndpointGatewayIpsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"provider","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","id":"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"provider","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","id":"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use EndpointGatewayIpsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listEndpointGatewayIpsOptionsModel := &vpcv1.ListEndpointGatewayIpsOptions{
					EndpointGatewayID: core.StringPtr("testString"),
					Limit:             core.Int64Ptr(int64(10)),
					Sort:              core.StringPtr("name"),
				}

				pager, err := vpcService.NewEndpointGatewayIpsPager(listEndpointGatewayIpsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.ReservedIP
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use EndpointGatewayIpsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listEndpointGatewayIpsOptionsModel := &vpcv1.ListEndpointGatewayIpsOptions{
					EndpointGatewayID: core.StringPtr("testString"),
					Limit:             core.Int64Ptr(int64(10)),
					Sort:              core.StringPtr("name"),
				}

				pager, err := vpcService.NewEndpointGatewayIpsPager(listEndpointGatewayIpsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`RemoveEndpointGatewayIP(removeEndpointGatewayIPOptions *RemoveEndpointGatewayIPOptions)`, func() {
		version := "2024-06-23"
		removeEndpointGatewayIPPath := "/endpoint_gateways/testString/ips/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(removeEndpointGatewayIPPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke RemoveEndpointGatewayIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.RemoveEndpointGatewayIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the RemoveEndpointGatewayIPOptions model
				removeEndpointGatewayIPOptionsModel := new(vpcv1.RemoveEndpointGatewayIPOptions)
				removeEndpointGatewayIPOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				removeEndpointGatewayIPOptionsModel.ID = core.StringPtr("testString")
				removeEndpointGatewayIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.RemoveEndpointGatewayIP(removeEndpointGatewayIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke RemoveEndpointGatewayIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RemoveEndpointGatewayIPOptions model
				removeEndpointGatewayIPOptionsModel := new(vpcv1.RemoveEndpointGatewayIPOptions)
				removeEndpointGatewayIPOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				removeEndpointGatewayIPOptionsModel.ID = core.StringPtr("testString")
				removeEndpointGatewayIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.RemoveEndpointGatewayIP(removeEndpointGatewayIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the RemoveEndpointGatewayIPOptions model with no property values
				removeEndpointGatewayIPOptionsModelNew := new(vpcv1.RemoveEndpointGatewayIPOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.RemoveEndpointGatewayIP(removeEndpointGatewayIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetEndpointGatewayIP(getEndpointGatewayIPOptions *GetEndpointGatewayIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getEndpointGatewayIPPath := "/endpoint_gateways/testString/ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getEndpointGatewayIPPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetEndpointGatewayIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetEndpointGatewayIPOptions model
				getEndpointGatewayIPOptionsModel := new(vpcv1.GetEndpointGatewayIPOptions)
				getEndpointGatewayIPOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				getEndpointGatewayIPOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetEndpointGatewayIP(getEndpointGatewayIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetEndpointGatewayIP(getEndpointGatewayIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetEndpointGatewayIP(getEndpointGatewayIPOptions *GetEndpointGatewayIPOptions)`, func() {
		version := "2024-06-23"
		getEndpointGatewayIPPath := "/endpoint_gateways/testString/ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getEndpointGatewayIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}`)
				}))
			})
			It(`Invoke GetEndpointGatewayIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetEndpointGatewayIPOptions model
				getEndpointGatewayIPOptionsModel := new(vpcv1.GetEndpointGatewayIPOptions)
				getEndpointGatewayIPOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				getEndpointGatewayIPOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetEndpointGatewayIPWithContext(ctx, getEndpointGatewayIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetEndpointGatewayIP(getEndpointGatewayIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetEndpointGatewayIPWithContext(ctx, getEndpointGatewayIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getEndpointGatewayIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}`)
				}))
			})
			It(`Invoke GetEndpointGatewayIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetEndpointGatewayIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetEndpointGatewayIPOptions model
				getEndpointGatewayIPOptionsModel := new(vpcv1.GetEndpointGatewayIPOptions)
				getEndpointGatewayIPOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				getEndpointGatewayIPOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetEndpointGatewayIP(getEndpointGatewayIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetEndpointGatewayIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetEndpointGatewayIPOptions model
				getEndpointGatewayIPOptionsModel := new(vpcv1.GetEndpointGatewayIPOptions)
				getEndpointGatewayIPOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				getEndpointGatewayIPOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetEndpointGatewayIP(getEndpointGatewayIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetEndpointGatewayIPOptions model with no property values
				getEndpointGatewayIPOptionsModelNew := new(vpcv1.GetEndpointGatewayIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetEndpointGatewayIP(getEndpointGatewayIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetEndpointGatewayIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetEndpointGatewayIPOptions model
				getEndpointGatewayIPOptionsModel := new(vpcv1.GetEndpointGatewayIPOptions)
				getEndpointGatewayIPOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				getEndpointGatewayIPOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetEndpointGatewayIP(getEndpointGatewayIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`AddEndpointGatewayIP(addEndpointGatewayIPOptions *AddEndpointGatewayIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		addEndpointGatewayIPPath := "/endpoint_gateways/testString/ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addEndpointGatewayIPPath))
					Expect(req.Method).To(Equal("PUT"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke AddEndpointGatewayIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddEndpointGatewayIPOptions model
				addEndpointGatewayIPOptionsModel := new(vpcv1.AddEndpointGatewayIPOptions)
				addEndpointGatewayIPOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				addEndpointGatewayIPOptionsModel.ID = core.StringPtr("testString")
				addEndpointGatewayIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.AddEndpointGatewayIP(addEndpointGatewayIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.AddEndpointGatewayIP(addEndpointGatewayIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`AddEndpointGatewayIP(addEndpointGatewayIPOptions *AddEndpointGatewayIPOptions)`, func() {
		version := "2024-06-23"
		addEndpointGatewayIPPath := "/endpoint_gateways/testString/ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addEndpointGatewayIPPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}`)
				}))
			})
			It(`Invoke AddEndpointGatewayIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the AddEndpointGatewayIPOptions model
				addEndpointGatewayIPOptionsModel := new(vpcv1.AddEndpointGatewayIPOptions)
				addEndpointGatewayIPOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				addEndpointGatewayIPOptionsModel.ID = core.StringPtr("testString")
				addEndpointGatewayIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.AddEndpointGatewayIPWithContext(ctx, addEndpointGatewayIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.AddEndpointGatewayIP(addEndpointGatewayIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.AddEndpointGatewayIPWithContext(ctx, addEndpointGatewayIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addEndpointGatewayIPPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}`)
				}))
			})
			It(`Invoke AddEndpointGatewayIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.AddEndpointGatewayIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the AddEndpointGatewayIPOptions model
				addEndpointGatewayIPOptionsModel := new(vpcv1.AddEndpointGatewayIPOptions)
				addEndpointGatewayIPOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				addEndpointGatewayIPOptionsModel.ID = core.StringPtr("testString")
				addEndpointGatewayIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.AddEndpointGatewayIP(addEndpointGatewayIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke AddEndpointGatewayIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddEndpointGatewayIPOptions model
				addEndpointGatewayIPOptionsModel := new(vpcv1.AddEndpointGatewayIPOptions)
				addEndpointGatewayIPOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				addEndpointGatewayIPOptionsModel.ID = core.StringPtr("testString")
				addEndpointGatewayIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.AddEndpointGatewayIP(addEndpointGatewayIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the AddEndpointGatewayIPOptions model with no property values
				addEndpointGatewayIPOptionsModelNew := new(vpcv1.AddEndpointGatewayIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.AddEndpointGatewayIP(addEndpointGatewayIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke AddEndpointGatewayIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddEndpointGatewayIPOptions model
				addEndpointGatewayIPOptionsModel := new(vpcv1.AddEndpointGatewayIPOptions)
				addEndpointGatewayIPOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				addEndpointGatewayIPOptionsModel.ID = core.StringPtr("testString")
				addEndpointGatewayIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.AddEndpointGatewayIP(addEndpointGatewayIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListEndpointGatewayResourceBindings(listEndpointGatewayResourceBindingsOptions *ListEndpointGatewayResourceBindingsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listEndpointGatewayResourceBindingsPath := "/endpoint_gateways/testString/resource_bindings"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listEndpointGatewayResourceBindingsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListEndpointGatewayResourceBindings with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListEndpointGatewayResourceBindingsOptions model
				listEndpointGatewayResourceBindingsOptionsModel := new(vpcv1.ListEndpointGatewayResourceBindingsOptions)
				listEndpointGatewayResourceBindingsOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				listEndpointGatewayResourceBindingsOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewayResourceBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewayResourceBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListEndpointGatewayResourceBindings(listEndpointGatewayResourceBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListEndpointGatewayResourceBindings(listEndpointGatewayResourceBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListEndpointGatewayResourceBindings(listEndpointGatewayResourceBindingsOptions *ListEndpointGatewayResourceBindingsOptions)`, func() {
		version := "2024-06-23"
		listEndpointGatewayResourceBindingsPath := "/endpoint_gateways/testString/resource_bindings"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listEndpointGatewayResourceBindingsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "resource_bindings": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373", "id": "r006-a7ba95b6-a254-47e4-b129-10593df8a373", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-resource-binding", "resource_type": "endpoint_gateway_resource_binding", "service_endpoint": "bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud", "target": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"}, "type": "weak"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListEndpointGatewayResourceBindings successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListEndpointGatewayResourceBindingsOptions model
				listEndpointGatewayResourceBindingsOptionsModel := new(vpcv1.ListEndpointGatewayResourceBindingsOptions)
				listEndpointGatewayResourceBindingsOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				listEndpointGatewayResourceBindingsOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewayResourceBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewayResourceBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListEndpointGatewayResourceBindingsWithContext(ctx, listEndpointGatewayResourceBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListEndpointGatewayResourceBindings(listEndpointGatewayResourceBindingsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListEndpointGatewayResourceBindingsWithContext(ctx, listEndpointGatewayResourceBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listEndpointGatewayResourceBindingsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "resource_bindings": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373", "id": "r006-a7ba95b6-a254-47e4-b129-10593df8a373", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-resource-binding", "resource_type": "endpoint_gateway_resource_binding", "service_endpoint": "bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud", "target": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"}, "type": "weak"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListEndpointGatewayResourceBindings successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListEndpointGatewayResourceBindings(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListEndpointGatewayResourceBindingsOptions model
				listEndpointGatewayResourceBindingsOptionsModel := new(vpcv1.ListEndpointGatewayResourceBindingsOptions)
				listEndpointGatewayResourceBindingsOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				listEndpointGatewayResourceBindingsOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewayResourceBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewayResourceBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListEndpointGatewayResourceBindings(listEndpointGatewayResourceBindingsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListEndpointGatewayResourceBindings with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListEndpointGatewayResourceBindingsOptions model
				listEndpointGatewayResourceBindingsOptionsModel := new(vpcv1.ListEndpointGatewayResourceBindingsOptions)
				listEndpointGatewayResourceBindingsOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				listEndpointGatewayResourceBindingsOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewayResourceBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewayResourceBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListEndpointGatewayResourceBindings(listEndpointGatewayResourceBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListEndpointGatewayResourceBindingsOptions model with no property values
				listEndpointGatewayResourceBindingsOptionsModelNew := new(vpcv1.ListEndpointGatewayResourceBindingsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListEndpointGatewayResourceBindings(listEndpointGatewayResourceBindingsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListEndpointGatewayResourceBindings successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListEndpointGatewayResourceBindingsOptions model
				listEndpointGatewayResourceBindingsOptionsModel := new(vpcv1.ListEndpointGatewayResourceBindingsOptions)
				listEndpointGatewayResourceBindingsOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				listEndpointGatewayResourceBindingsOptionsModel.Start = core.StringPtr("testString")
				listEndpointGatewayResourceBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listEndpointGatewayResourceBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListEndpointGatewayResourceBindings(listEndpointGatewayResourceBindingsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.EndpointGatewayResourceBindingCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.EndpointGatewayResourceBindingCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.EndpointGatewayResourceBindingCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listEndpointGatewayResourceBindingsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"resource_bindings":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373","id":"r006-a7ba95b6-a254-47e4-b129-10593df8a373","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-resource-binding","resource_type":"endpoint_gateway_resource_binding","service_endpoint":"bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud","target":{"crn":"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"},"type":"weak"}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resource_bindings":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373","id":"r006-a7ba95b6-a254-47e4-b129-10593df8a373","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-resource-binding","resource_type":"endpoint_gateway_resource_binding","service_endpoint":"bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud","target":{"crn":"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"},"type":"weak"}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use EndpointGatewayResourceBindingsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listEndpointGatewayResourceBindingsOptionsModel := &vpcv1.ListEndpointGatewayResourceBindingsOptions{
					EndpointGatewayID: core.StringPtr("testString"),
					Limit:             core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewEndpointGatewayResourceBindingsPager(listEndpointGatewayResourceBindingsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.EndpointGatewayResourceBinding
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use EndpointGatewayResourceBindingsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listEndpointGatewayResourceBindingsOptionsModel := &vpcv1.ListEndpointGatewayResourceBindingsOptions{
					EndpointGatewayID: core.StringPtr("testString"),
					Limit:             core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewEndpointGatewayResourceBindingsPager(listEndpointGatewayResourceBindingsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateEndpointGatewayResourceBinding(createEndpointGatewayResourceBindingOptions *CreateEndpointGatewayResourceBindingOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createEndpointGatewayResourceBindingPath := "/endpoint_gateways/testString/resource_bindings"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createEndpointGatewayResourceBindingPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateEndpointGatewayResourceBinding with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN model
				endpointGatewayResourceBindingTargetPrototypeModel := new(vpcv1.EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN)
				endpointGatewayResourceBindingTargetPrototypeModel.CRN = core.StringPtr("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue")

				// Construct an instance of the CreateEndpointGatewayResourceBindingOptions model
				createEndpointGatewayResourceBindingOptionsModel := new(vpcv1.CreateEndpointGatewayResourceBindingOptions)
				createEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				createEndpointGatewayResourceBindingOptionsModel.Target = endpointGatewayResourceBindingTargetPrototypeModel
				createEndpointGatewayResourceBindingOptionsModel.Name = core.StringPtr("my-resource-binding")
				createEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateEndpointGatewayResourceBinding(createEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateEndpointGatewayResourceBinding(createEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateEndpointGatewayResourceBinding(createEndpointGatewayResourceBindingOptions *CreateEndpointGatewayResourceBindingOptions)`, func() {
		version := "2024-06-23"
		createEndpointGatewayResourceBindingPath := "/endpoint_gateways/testString/resource_bindings"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createEndpointGatewayResourceBindingPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373", "id": "r006-a7ba95b6-a254-47e4-b129-10593df8a373", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-resource-binding", "resource_type": "endpoint_gateway_resource_binding", "service_endpoint": "bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud", "target": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"}, "type": "weak"}`)
				}))
			})
			It(`Invoke CreateEndpointGatewayResourceBinding successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN model
				endpointGatewayResourceBindingTargetPrototypeModel := new(vpcv1.EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN)
				endpointGatewayResourceBindingTargetPrototypeModel.CRN = core.StringPtr("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue")

				// Construct an instance of the CreateEndpointGatewayResourceBindingOptions model
				createEndpointGatewayResourceBindingOptionsModel := new(vpcv1.CreateEndpointGatewayResourceBindingOptions)
				createEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				createEndpointGatewayResourceBindingOptionsModel.Target = endpointGatewayResourceBindingTargetPrototypeModel
				createEndpointGatewayResourceBindingOptionsModel.Name = core.StringPtr("my-resource-binding")
				createEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateEndpointGatewayResourceBindingWithContext(ctx, createEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateEndpointGatewayResourceBinding(createEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateEndpointGatewayResourceBindingWithContext(ctx, createEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createEndpointGatewayResourceBindingPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373", "id": "r006-a7ba95b6-a254-47e4-b129-10593df8a373", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-resource-binding", "resource_type": "endpoint_gateway_resource_binding", "service_endpoint": "bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud", "target": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"}, "type": "weak"}`)
				}))
			})
			It(`Invoke CreateEndpointGatewayResourceBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateEndpointGatewayResourceBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN model
				endpointGatewayResourceBindingTargetPrototypeModel := new(vpcv1.EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN)
				endpointGatewayResourceBindingTargetPrototypeModel.CRN = core.StringPtr("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue")

				// Construct an instance of the CreateEndpointGatewayResourceBindingOptions model
				createEndpointGatewayResourceBindingOptionsModel := new(vpcv1.CreateEndpointGatewayResourceBindingOptions)
				createEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				createEndpointGatewayResourceBindingOptionsModel.Target = endpointGatewayResourceBindingTargetPrototypeModel
				createEndpointGatewayResourceBindingOptionsModel.Name = core.StringPtr("my-resource-binding")
				createEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateEndpointGatewayResourceBinding(createEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateEndpointGatewayResourceBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN model
				endpointGatewayResourceBindingTargetPrototypeModel := new(vpcv1.EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN)
				endpointGatewayResourceBindingTargetPrototypeModel.CRN = core.StringPtr("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue")

				// Construct an instance of the CreateEndpointGatewayResourceBindingOptions model
				createEndpointGatewayResourceBindingOptionsModel := new(vpcv1.CreateEndpointGatewayResourceBindingOptions)
				createEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				createEndpointGatewayResourceBindingOptionsModel.Target = endpointGatewayResourceBindingTargetPrototypeModel
				createEndpointGatewayResourceBindingOptionsModel.Name = core.StringPtr("my-resource-binding")
				createEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateEndpointGatewayResourceBinding(createEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateEndpointGatewayResourceBindingOptions model with no property values
				createEndpointGatewayResourceBindingOptionsModelNew := new(vpcv1.CreateEndpointGatewayResourceBindingOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateEndpointGatewayResourceBinding(createEndpointGatewayResourceBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateEndpointGatewayResourceBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN model
				endpointGatewayResourceBindingTargetPrototypeModel := new(vpcv1.EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN)
				endpointGatewayResourceBindingTargetPrototypeModel.CRN = core.StringPtr("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue")

				// Construct an instance of the CreateEndpointGatewayResourceBindingOptions model
				createEndpointGatewayResourceBindingOptionsModel := new(vpcv1.CreateEndpointGatewayResourceBindingOptions)
				createEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				createEndpointGatewayResourceBindingOptionsModel.Target = endpointGatewayResourceBindingTargetPrototypeModel
				createEndpointGatewayResourceBindingOptionsModel.Name = core.StringPtr("my-resource-binding")
				createEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateEndpointGatewayResourceBinding(createEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteEndpointGatewayResourceBinding(deleteEndpointGatewayResourceBindingOptions *DeleteEndpointGatewayResourceBindingOptions)`, func() {
		version := "2024-06-23"
		deleteEndpointGatewayResourceBindingPath := "/endpoint_gateways/testString/resource_bindings/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteEndpointGatewayResourceBindingPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteEndpointGatewayResourceBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteEndpointGatewayResourceBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteEndpointGatewayResourceBindingOptions model
				deleteEndpointGatewayResourceBindingOptionsModel := new(vpcv1.DeleteEndpointGatewayResourceBindingOptions)
				deleteEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				deleteEndpointGatewayResourceBindingOptionsModel.ID = core.StringPtr("testString")
				deleteEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteEndpointGatewayResourceBinding(deleteEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteEndpointGatewayResourceBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteEndpointGatewayResourceBindingOptions model
				deleteEndpointGatewayResourceBindingOptionsModel := new(vpcv1.DeleteEndpointGatewayResourceBindingOptions)
				deleteEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				deleteEndpointGatewayResourceBindingOptionsModel.ID = core.StringPtr("testString")
				deleteEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteEndpointGatewayResourceBinding(deleteEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteEndpointGatewayResourceBindingOptions model with no property values
				deleteEndpointGatewayResourceBindingOptionsModelNew := new(vpcv1.DeleteEndpointGatewayResourceBindingOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteEndpointGatewayResourceBinding(deleteEndpointGatewayResourceBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetEndpointGatewayResourceBinding(getEndpointGatewayResourceBindingOptions *GetEndpointGatewayResourceBindingOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getEndpointGatewayResourceBindingPath := "/endpoint_gateways/testString/resource_bindings/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getEndpointGatewayResourceBindingPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetEndpointGatewayResourceBinding with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetEndpointGatewayResourceBindingOptions model
				getEndpointGatewayResourceBindingOptionsModel := new(vpcv1.GetEndpointGatewayResourceBindingOptions)
				getEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				getEndpointGatewayResourceBindingOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetEndpointGatewayResourceBinding(getEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetEndpointGatewayResourceBinding(getEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetEndpointGatewayResourceBinding(getEndpointGatewayResourceBindingOptions *GetEndpointGatewayResourceBindingOptions)`, func() {
		version := "2024-06-23"
		getEndpointGatewayResourceBindingPath := "/endpoint_gateways/testString/resource_bindings/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getEndpointGatewayResourceBindingPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373", "id": "r006-a7ba95b6-a254-47e4-b129-10593df8a373", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-resource-binding", "resource_type": "endpoint_gateway_resource_binding", "service_endpoint": "bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud", "target": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"}, "type": "weak"}`)
				}))
			})
			It(`Invoke GetEndpointGatewayResourceBinding successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetEndpointGatewayResourceBindingOptions model
				getEndpointGatewayResourceBindingOptionsModel := new(vpcv1.GetEndpointGatewayResourceBindingOptions)
				getEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				getEndpointGatewayResourceBindingOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetEndpointGatewayResourceBindingWithContext(ctx, getEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetEndpointGatewayResourceBinding(getEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetEndpointGatewayResourceBindingWithContext(ctx, getEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getEndpointGatewayResourceBindingPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373", "id": "r006-a7ba95b6-a254-47e4-b129-10593df8a373", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-resource-binding", "resource_type": "endpoint_gateway_resource_binding", "service_endpoint": "bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud", "target": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"}, "type": "weak"}`)
				}))
			})
			It(`Invoke GetEndpointGatewayResourceBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetEndpointGatewayResourceBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetEndpointGatewayResourceBindingOptions model
				getEndpointGatewayResourceBindingOptionsModel := new(vpcv1.GetEndpointGatewayResourceBindingOptions)
				getEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				getEndpointGatewayResourceBindingOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetEndpointGatewayResourceBinding(getEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetEndpointGatewayResourceBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetEndpointGatewayResourceBindingOptions model
				getEndpointGatewayResourceBindingOptionsModel := new(vpcv1.GetEndpointGatewayResourceBindingOptions)
				getEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				getEndpointGatewayResourceBindingOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetEndpointGatewayResourceBinding(getEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetEndpointGatewayResourceBindingOptions model with no property values
				getEndpointGatewayResourceBindingOptionsModelNew := new(vpcv1.GetEndpointGatewayResourceBindingOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetEndpointGatewayResourceBinding(getEndpointGatewayResourceBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetEndpointGatewayResourceBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetEndpointGatewayResourceBindingOptions model
				getEndpointGatewayResourceBindingOptionsModel := new(vpcv1.GetEndpointGatewayResourceBindingOptions)
				getEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				getEndpointGatewayResourceBindingOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetEndpointGatewayResourceBinding(getEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateEndpointGatewayResourceBinding(updateEndpointGatewayResourceBindingOptions *UpdateEndpointGatewayResourceBindingOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateEndpointGatewayResourceBindingPath := "/endpoint_gateways/testString/resource_bindings/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateEndpointGatewayResourceBindingPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateEndpointGatewayResourceBinding with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the EndpointGatewayResourceBindingPatch model
				endpointGatewayResourceBindingPatchModel := new(vpcv1.EndpointGatewayResourceBindingPatch)
				endpointGatewayResourceBindingPatchModel.Name = core.StringPtr("my-resource-binding-updated")
				endpointGatewayResourceBindingPatchModelAsPatch, asPatchErr := endpointGatewayResourceBindingPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateEndpointGatewayResourceBindingOptions model
				updateEndpointGatewayResourceBindingOptionsModel := new(vpcv1.UpdateEndpointGatewayResourceBindingOptions)
				updateEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				updateEndpointGatewayResourceBindingOptionsModel.ID = core.StringPtr("testString")
				updateEndpointGatewayResourceBindingOptionsModel.EndpointGatewayResourceBindingPatch = endpointGatewayResourceBindingPatchModelAsPatch
				updateEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateEndpointGatewayResourceBinding(updateEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateEndpointGatewayResourceBinding(updateEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateEndpointGatewayResourceBinding(updateEndpointGatewayResourceBindingOptions *UpdateEndpointGatewayResourceBindingOptions)`, func() {
		version := "2024-06-23"
		updateEndpointGatewayResourceBindingPath := "/endpoint_gateways/testString/resource_bindings/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateEndpointGatewayResourceBindingPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373", "id": "r006-a7ba95b6-a254-47e4-b129-10593df8a373", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-resource-binding", "resource_type": "endpoint_gateway_resource_binding", "service_endpoint": "bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud", "target": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"}, "type": "weak"}`)
				}))
			})
			It(`Invoke UpdateEndpointGatewayResourceBinding successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the EndpointGatewayResourceBindingPatch model
				endpointGatewayResourceBindingPatchModel := new(vpcv1.EndpointGatewayResourceBindingPatch)
				endpointGatewayResourceBindingPatchModel.Name = core.StringPtr("my-resource-binding-updated")
				endpointGatewayResourceBindingPatchModelAsPatch, asPatchErr := endpointGatewayResourceBindingPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateEndpointGatewayResourceBindingOptions model
				updateEndpointGatewayResourceBindingOptionsModel := new(vpcv1.UpdateEndpointGatewayResourceBindingOptions)
				updateEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				updateEndpointGatewayResourceBindingOptionsModel.ID = core.StringPtr("testString")
				updateEndpointGatewayResourceBindingOptionsModel.EndpointGatewayResourceBindingPatch = endpointGatewayResourceBindingPatchModelAsPatch
				updateEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateEndpointGatewayResourceBindingWithContext(ctx, updateEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateEndpointGatewayResourceBinding(updateEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateEndpointGatewayResourceBindingWithContext(ctx, updateEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateEndpointGatewayResourceBindingPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373", "id": "r006-a7ba95b6-a254-47e4-b129-10593df8a373", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-resource-binding", "resource_type": "endpoint_gateway_resource_binding", "service_endpoint": "bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud", "target": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"}, "type": "weak"}`)
				}))
			})
			It(`Invoke UpdateEndpointGatewayResourceBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateEndpointGatewayResourceBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the EndpointGatewayResourceBindingPatch model
				endpointGatewayResourceBindingPatchModel := new(vpcv1.EndpointGatewayResourceBindingPatch)
				endpointGatewayResourceBindingPatchModel.Name = core.StringPtr("my-resource-binding-updated")
				endpointGatewayResourceBindingPatchModelAsPatch, asPatchErr := endpointGatewayResourceBindingPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateEndpointGatewayResourceBindingOptions model
				updateEndpointGatewayResourceBindingOptionsModel := new(vpcv1.UpdateEndpointGatewayResourceBindingOptions)
				updateEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				updateEndpointGatewayResourceBindingOptionsModel.ID = core.StringPtr("testString")
				updateEndpointGatewayResourceBindingOptionsModel.EndpointGatewayResourceBindingPatch = endpointGatewayResourceBindingPatchModelAsPatch
				updateEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateEndpointGatewayResourceBinding(updateEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateEndpointGatewayResourceBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the EndpointGatewayResourceBindingPatch model
				endpointGatewayResourceBindingPatchModel := new(vpcv1.EndpointGatewayResourceBindingPatch)
				endpointGatewayResourceBindingPatchModel.Name = core.StringPtr("my-resource-binding-updated")
				endpointGatewayResourceBindingPatchModelAsPatch, asPatchErr := endpointGatewayResourceBindingPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateEndpointGatewayResourceBindingOptions model
				updateEndpointGatewayResourceBindingOptionsModel := new(vpcv1.UpdateEndpointGatewayResourceBindingOptions)
				updateEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				updateEndpointGatewayResourceBindingOptionsModel.ID = core.StringPtr("testString")
				updateEndpointGatewayResourceBindingOptionsModel.EndpointGatewayResourceBindingPatch = endpointGatewayResourceBindingPatchModelAsPatch
				updateEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateEndpointGatewayResourceBinding(updateEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateEndpointGatewayResourceBindingOptions model with no property values
				updateEndpointGatewayResourceBindingOptionsModelNew := new(vpcv1.UpdateEndpointGatewayResourceBindingOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateEndpointGatewayResourceBinding(updateEndpointGatewayResourceBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateEndpointGatewayResourceBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the EndpointGatewayResourceBindingPatch model
				endpointGatewayResourceBindingPatchModel := new(vpcv1.EndpointGatewayResourceBindingPatch)
				endpointGatewayResourceBindingPatchModel.Name = core.StringPtr("my-resource-binding-updated")
				endpointGatewayResourceBindingPatchModelAsPatch, asPatchErr := endpointGatewayResourceBindingPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateEndpointGatewayResourceBindingOptions model
				updateEndpointGatewayResourceBindingOptionsModel := new(vpcv1.UpdateEndpointGatewayResourceBindingOptions)
				updateEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID = core.StringPtr("testString")
				updateEndpointGatewayResourceBindingOptionsModel.ID = core.StringPtr("testString")
				updateEndpointGatewayResourceBindingOptionsModel.EndpointGatewayResourceBindingPatch = endpointGatewayResourceBindingPatchModelAsPatch
				updateEndpointGatewayResourceBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateEndpointGatewayResourceBinding(updateEndpointGatewayResourceBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteEndpointGateway(deleteEndpointGatewayOptions *DeleteEndpointGatewayOptions)`, func() {
		version := "2024-06-23"
		deleteEndpointGatewayPath := "/endpoint_gateways/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteEndpointGatewayPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteEndpointGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteEndpointGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteEndpointGatewayOptions model
				deleteEndpointGatewayOptionsModel := new(vpcv1.DeleteEndpointGatewayOptions)
				deleteEndpointGatewayOptionsModel.ID = core.StringPtr("testString")
				deleteEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteEndpointGateway(deleteEndpointGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteEndpointGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteEndpointGatewayOptions model
				deleteEndpointGatewayOptionsModel := new(vpcv1.DeleteEndpointGatewayOptions)
				deleteEndpointGatewayOptionsModel.ID = core.StringPtr("testString")
				deleteEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteEndpointGateway(deleteEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteEndpointGatewayOptions model with no property values
				deleteEndpointGatewayOptionsModelNew := new(vpcv1.DeleteEndpointGatewayOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteEndpointGateway(deleteEndpointGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetEndpointGateway(getEndpointGatewayOptions *GetEndpointGatewayOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getEndpointGatewayPath := "/endpoint_gateways/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getEndpointGatewayPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetEndpointGateway with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetEndpointGatewayOptions model
				getEndpointGatewayOptionsModel := new(vpcv1.GetEndpointGatewayOptions)
				getEndpointGatewayOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetEndpointGateway(getEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetEndpointGateway(getEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetEndpointGateway(getEndpointGatewayOptions *GetEndpointGatewayOptions)`, func() {
		version := "2024-06-23"
		getEndpointGatewayPath := "/endpoint_gateways/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getEndpointGatewayPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_dns_resolution_binding": false, "allow_resource_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetEndpointGateway successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetEndpointGatewayOptions model
				getEndpointGatewayOptionsModel := new(vpcv1.GetEndpointGatewayOptions)
				getEndpointGatewayOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetEndpointGatewayWithContext(ctx, getEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetEndpointGateway(getEndpointGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetEndpointGatewayWithContext(ctx, getEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getEndpointGatewayPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_dns_resolution_binding": false, "allow_resource_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetEndpointGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetEndpointGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetEndpointGatewayOptions model
				getEndpointGatewayOptionsModel := new(vpcv1.GetEndpointGatewayOptions)
				getEndpointGatewayOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetEndpointGateway(getEndpointGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetEndpointGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetEndpointGatewayOptions model
				getEndpointGatewayOptionsModel := new(vpcv1.GetEndpointGatewayOptions)
				getEndpointGatewayOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetEndpointGateway(getEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetEndpointGatewayOptions model with no property values
				getEndpointGatewayOptionsModelNew := new(vpcv1.GetEndpointGatewayOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetEndpointGateway(getEndpointGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetEndpointGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetEndpointGatewayOptions model
				getEndpointGatewayOptionsModel := new(vpcv1.GetEndpointGatewayOptions)
				getEndpointGatewayOptionsModel.ID = core.StringPtr("testString")
				getEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetEndpointGateway(getEndpointGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateEndpointGateway(updateEndpointGatewayOptions *UpdateEndpointGatewayOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateEndpointGatewayPath := "/endpoint_gateways/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateEndpointGatewayPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateEndpointGateway with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the EndpointGatewayPatch model
				endpointGatewayPatchModel := new(vpcv1.EndpointGatewayPatch)
				endpointGatewayPatchModel.AllowDnsResolutionBinding = core.BoolPtr(false)
				endpointGatewayPatchModel.AllowResourceBinding = core.BoolPtr(true)
				endpointGatewayPatchModel.Name = core.StringPtr("my-endpoint-gateway")
				endpointGatewayPatchModelAsPatch, asPatchErr := endpointGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateEndpointGatewayOptions model
				updateEndpointGatewayOptionsModel := new(vpcv1.UpdateEndpointGatewayOptions)
				updateEndpointGatewayOptionsModel.ID = core.StringPtr("testString")
				updateEndpointGatewayOptionsModel.EndpointGatewayPatch = endpointGatewayPatchModelAsPatch
				updateEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateEndpointGateway(updateEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateEndpointGateway(updateEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateEndpointGateway(updateEndpointGatewayOptions *UpdateEndpointGatewayOptions)`, func() {
		version := "2024-06-23"
		updateEndpointGatewayPath := "/endpoint_gateways/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateEndpointGatewayPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_dns_resolution_binding": false, "allow_resource_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateEndpointGateway successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the EndpointGatewayPatch model
				endpointGatewayPatchModel := new(vpcv1.EndpointGatewayPatch)
				endpointGatewayPatchModel.AllowDnsResolutionBinding = core.BoolPtr(false)
				endpointGatewayPatchModel.AllowResourceBinding = core.BoolPtr(true)
				endpointGatewayPatchModel.Name = core.StringPtr("my-endpoint-gateway")
				endpointGatewayPatchModelAsPatch, asPatchErr := endpointGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateEndpointGatewayOptions model
				updateEndpointGatewayOptionsModel := new(vpcv1.UpdateEndpointGatewayOptions)
				updateEndpointGatewayOptionsModel.ID = core.StringPtr("testString")
				updateEndpointGatewayOptionsModel.EndpointGatewayPatch = endpointGatewayPatchModelAsPatch
				updateEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateEndpointGatewayWithContext(ctx, updateEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateEndpointGateway(updateEndpointGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateEndpointGatewayWithContext(ctx, updateEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateEndpointGatewayPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_dns_resolution_binding": false, "allow_resource_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateEndpointGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateEndpointGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the EndpointGatewayPatch model
				endpointGatewayPatchModel := new(vpcv1.EndpointGatewayPatch)
				endpointGatewayPatchModel.AllowDnsResolutionBinding = core.BoolPtr(false)
				endpointGatewayPatchModel.AllowResourceBinding = core.BoolPtr(true)
				endpointGatewayPatchModel.Name = core.StringPtr("my-endpoint-gateway")
				endpointGatewayPatchModelAsPatch, asPatchErr := endpointGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateEndpointGatewayOptions model
				updateEndpointGatewayOptionsModel := new(vpcv1.UpdateEndpointGatewayOptions)
				updateEndpointGatewayOptionsModel.ID = core.StringPtr("testString")
				updateEndpointGatewayOptionsModel.EndpointGatewayPatch = endpointGatewayPatchModelAsPatch
				updateEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateEndpointGateway(updateEndpointGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateEndpointGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the EndpointGatewayPatch model
				endpointGatewayPatchModel := new(vpcv1.EndpointGatewayPatch)
				endpointGatewayPatchModel.AllowDnsResolutionBinding = core.BoolPtr(false)
				endpointGatewayPatchModel.AllowResourceBinding = core.BoolPtr(true)
				endpointGatewayPatchModel.Name = core.StringPtr("my-endpoint-gateway")
				endpointGatewayPatchModelAsPatch, asPatchErr := endpointGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateEndpointGatewayOptions model
				updateEndpointGatewayOptionsModel := new(vpcv1.UpdateEndpointGatewayOptions)
				updateEndpointGatewayOptionsModel.ID = core.StringPtr("testString")
				updateEndpointGatewayOptionsModel.EndpointGatewayPatch = endpointGatewayPatchModelAsPatch
				updateEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateEndpointGateway(updateEndpointGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateEndpointGatewayOptions model with no property values
				updateEndpointGatewayOptionsModelNew := new(vpcv1.UpdateEndpointGatewayOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateEndpointGateway(updateEndpointGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateEndpointGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the EndpointGatewayPatch model
				endpointGatewayPatchModel := new(vpcv1.EndpointGatewayPatch)
				endpointGatewayPatchModel.AllowDnsResolutionBinding = core.BoolPtr(false)
				endpointGatewayPatchModel.AllowResourceBinding = core.BoolPtr(true)
				endpointGatewayPatchModel.Name = core.StringPtr("my-endpoint-gateway")
				endpointGatewayPatchModelAsPatch, asPatchErr := endpointGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateEndpointGatewayOptions model
				updateEndpointGatewayOptionsModel := new(vpcv1.UpdateEndpointGatewayOptions)
				updateEndpointGatewayOptionsModel.ID = core.StringPtr("testString")
				updateEndpointGatewayOptionsModel.EndpointGatewayPatch = endpointGatewayPatchModelAsPatch
				updateEndpointGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateEndpointGateway(updateEndpointGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListFloatingIps(listFloatingIpsOptions *ListFloatingIpsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listFloatingIpsPath := "/floating_ips"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listFloatingIpsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["target.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"}))
					Expect(req.URL.Query()["target.name"]).To(Equal([]string{"my-resource"}))
					Expect(req.URL.Query()["target.resource_type"]).To(Equal([]string{"testString"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListFloatingIps with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListFloatingIpsOptions model
				listFloatingIpsOptionsModel := new(vpcv1.ListFloatingIpsOptions)
				listFloatingIpsOptionsModel.Start = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listFloatingIpsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Sort = core.StringPtr("name")
				listFloatingIpsOptionsModel.TargetID = core.StringPtr("testString")
				listFloatingIpsOptionsModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
				listFloatingIpsOptionsModel.TargetName = core.StringPtr("my-resource")
				listFloatingIpsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListFloatingIps(listFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListFloatingIps(listFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListFloatingIps(listFloatingIpsOptions *ListFloatingIpsOptions)`, func() {
		version := "2024-06-23"
		listFloatingIpsPath := "/floating_ips"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listFloatingIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["target.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"}))
					Expect(req.URL.Query()["target.name"]).To(Equal([]string{"my-resource"}))
					Expect(req.URL.Query()["target.resource_type"]).To(Equal([]string{"testString"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListFloatingIps successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListFloatingIpsOptions model
				listFloatingIpsOptionsModel := new(vpcv1.ListFloatingIpsOptions)
				listFloatingIpsOptionsModel.Start = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listFloatingIpsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Sort = core.StringPtr("name")
				listFloatingIpsOptionsModel.TargetID = core.StringPtr("testString")
				listFloatingIpsOptionsModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
				listFloatingIpsOptionsModel.TargetName = core.StringPtr("my-resource")
				listFloatingIpsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListFloatingIpsWithContext(ctx, listFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListFloatingIps(listFloatingIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListFloatingIpsWithContext(ctx, listFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listFloatingIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["target.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"}))
					Expect(req.URL.Query()["target.name"]).To(Equal([]string{"my-resource"}))
					Expect(req.URL.Query()["target.resource_type"]).To(Equal([]string{"testString"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListFloatingIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListFloatingIps(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListFloatingIpsOptions model
				listFloatingIpsOptionsModel := new(vpcv1.ListFloatingIpsOptions)
				listFloatingIpsOptionsModel.Start = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listFloatingIpsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Sort = core.StringPtr("name")
				listFloatingIpsOptionsModel.TargetID = core.StringPtr("testString")
				listFloatingIpsOptionsModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
				listFloatingIpsOptionsModel.TargetName = core.StringPtr("my-resource")
				listFloatingIpsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListFloatingIps(listFloatingIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListFloatingIps with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListFloatingIpsOptions model
				listFloatingIpsOptionsModel := new(vpcv1.ListFloatingIpsOptions)
				listFloatingIpsOptionsModel.Start = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listFloatingIpsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Sort = core.StringPtr("name")
				listFloatingIpsOptionsModel.TargetID = core.StringPtr("testString")
				listFloatingIpsOptionsModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
				listFloatingIpsOptionsModel.TargetName = core.StringPtr("my-resource")
				listFloatingIpsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListFloatingIps(listFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListFloatingIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListFloatingIpsOptions model
				listFloatingIpsOptionsModel := new(vpcv1.ListFloatingIpsOptions)
				listFloatingIpsOptionsModel.Start = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listFloatingIpsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Sort = core.StringPtr("name")
				listFloatingIpsOptionsModel.TargetID = core.StringPtr("testString")
				listFloatingIpsOptionsModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
				listFloatingIpsOptionsModel.TargetName = core.StringPtr("my-resource")
				listFloatingIpsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListFloatingIps(listFloatingIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.FloatingIPCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.FloatingIPCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.FloatingIPCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listFloatingIpsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use FloatingIpsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listFloatingIpsOptionsModel := &vpcv1.ListFloatingIpsOptions{
					Limit:              core.Int64Ptr(int64(10)),
					ResourceGroupID:    core.StringPtr("testString"),
					Sort:               core.StringPtr("name"),
					TargetID:           core.StringPtr("testString"),
					TargetCRN:          core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"),
					TargetName:         core.StringPtr("my-resource"),
					TargetResourceType: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewFloatingIpsPager(listFloatingIpsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.FloatingIP
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use FloatingIpsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listFloatingIpsOptionsModel := &vpcv1.ListFloatingIpsOptions{
					Limit:              core.Int64Ptr(int64(10)),
					ResourceGroupID:    core.StringPtr("testString"),
					Sort:               core.StringPtr("name"),
					TargetID:           core.StringPtr("testString"),
					TargetCRN:          core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"),
					TargetName:         core.StringPtr("my-resource"),
					TargetResourceType: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewFloatingIpsPager(listFloatingIpsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateFloatingIP(createFloatingIPOptions *CreateFloatingIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createFloatingIPPath := "/floating_ips"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createFloatingIPPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateFloatingIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID model
				floatingIPTargetPrototypeModel := new(vpcv1.FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID)
				floatingIPTargetPrototypeModel.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

				// Construct an instance of the FloatingIPPrototypeFloatingIPByTarget model
				floatingIPPrototypeModel := new(vpcv1.FloatingIPPrototypeFloatingIPByTarget)
				floatingIPPrototypeModel.Name = core.StringPtr("my-floating-ip")
				floatingIPPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				floatingIPPrototypeModel.Target = floatingIPTargetPrototypeModel

				// Construct an instance of the CreateFloatingIPOptions model
				createFloatingIPOptionsModel := new(vpcv1.CreateFloatingIPOptions)
				createFloatingIPOptionsModel.FloatingIPPrototype = floatingIPPrototypeModel
				createFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateFloatingIP(createFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateFloatingIP(createFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateFloatingIP(createFloatingIPOptions *CreateFloatingIPOptions)`, func() {
		version := "2024-06-23"
		createFloatingIPPath := "/floating_ips"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createFloatingIPPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateFloatingIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID model
				floatingIPTargetPrototypeModel := new(vpcv1.FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID)
				floatingIPTargetPrototypeModel.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

				// Construct an instance of the FloatingIPPrototypeFloatingIPByTarget model
				floatingIPPrototypeModel := new(vpcv1.FloatingIPPrototypeFloatingIPByTarget)
				floatingIPPrototypeModel.Name = core.StringPtr("my-floating-ip")
				floatingIPPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				floatingIPPrototypeModel.Target = floatingIPTargetPrototypeModel

				// Construct an instance of the CreateFloatingIPOptions model
				createFloatingIPOptionsModel := new(vpcv1.CreateFloatingIPOptions)
				createFloatingIPOptionsModel.FloatingIPPrototype = floatingIPPrototypeModel
				createFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateFloatingIPWithContext(ctx, createFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateFloatingIP(createFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateFloatingIPWithContext(ctx, createFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createFloatingIPPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateFloatingIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID model
				floatingIPTargetPrototypeModel := new(vpcv1.FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID)
				floatingIPTargetPrototypeModel.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

				// Construct an instance of the FloatingIPPrototypeFloatingIPByTarget model
				floatingIPPrototypeModel := new(vpcv1.FloatingIPPrototypeFloatingIPByTarget)
				floatingIPPrototypeModel.Name = core.StringPtr("my-floating-ip")
				floatingIPPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				floatingIPPrototypeModel.Target = floatingIPTargetPrototypeModel

				// Construct an instance of the CreateFloatingIPOptions model
				createFloatingIPOptionsModel := new(vpcv1.CreateFloatingIPOptions)
				createFloatingIPOptionsModel.FloatingIPPrototype = floatingIPPrototypeModel
				createFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateFloatingIP(createFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateFloatingIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID model
				floatingIPTargetPrototypeModel := new(vpcv1.FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID)
				floatingIPTargetPrototypeModel.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

				// Construct an instance of the FloatingIPPrototypeFloatingIPByTarget model
				floatingIPPrototypeModel := new(vpcv1.FloatingIPPrototypeFloatingIPByTarget)
				floatingIPPrototypeModel.Name = core.StringPtr("my-floating-ip")
				floatingIPPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				floatingIPPrototypeModel.Target = floatingIPTargetPrototypeModel

				// Construct an instance of the CreateFloatingIPOptions model
				createFloatingIPOptionsModel := new(vpcv1.CreateFloatingIPOptions)
				createFloatingIPOptionsModel.FloatingIPPrototype = floatingIPPrototypeModel
				createFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateFloatingIP(createFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateFloatingIPOptions model with no property values
				createFloatingIPOptionsModelNew := new(vpcv1.CreateFloatingIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateFloatingIP(createFloatingIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID model
				floatingIPTargetPrototypeModel := new(vpcv1.FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID)
				floatingIPTargetPrototypeModel.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

				// Construct an instance of the FloatingIPPrototypeFloatingIPByTarget model
				floatingIPPrototypeModel := new(vpcv1.FloatingIPPrototypeFloatingIPByTarget)
				floatingIPPrototypeModel.Name = core.StringPtr("my-floating-ip")
				floatingIPPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				floatingIPPrototypeModel.Target = floatingIPTargetPrototypeModel

				// Construct an instance of the CreateFloatingIPOptions model
				createFloatingIPOptionsModel := new(vpcv1.CreateFloatingIPOptions)
				createFloatingIPOptionsModel.FloatingIPPrototype = floatingIPPrototypeModel
				createFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateFloatingIP(createFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteFloatingIP(deleteFloatingIPOptions *DeleteFloatingIPOptions)`, func() {
		version := "2024-06-23"
		deleteFloatingIPPath := "/floating_ips/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteFloatingIPPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteFloatingIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteFloatingIPOptions model
				deleteFloatingIPOptionsModel := new(vpcv1.DeleteFloatingIPOptions)
				deleteFloatingIPOptionsModel.ID = core.StringPtr("testString")
				deleteFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteFloatingIP(deleteFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteFloatingIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteFloatingIPOptions model
				deleteFloatingIPOptionsModel := new(vpcv1.DeleteFloatingIPOptions)
				deleteFloatingIPOptionsModel.ID = core.StringPtr("testString")
				deleteFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteFloatingIP(deleteFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteFloatingIPOptions model with no property values
				deleteFloatingIPOptionsModelNew := new(vpcv1.DeleteFloatingIPOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteFloatingIP(deleteFloatingIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetFloatingIP(getFloatingIPOptions *GetFloatingIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getFloatingIPPath := "/floating_ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getFloatingIPPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetFloatingIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetFloatingIPOptions model
				getFloatingIPOptionsModel := new(vpcv1.GetFloatingIPOptions)
				getFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetFloatingIP(getFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetFloatingIP(getFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetFloatingIP(getFloatingIPOptions *GetFloatingIPOptions)`, func() {
		version := "2024-06-23"
		getFloatingIPPath := "/floating_ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getFloatingIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetFloatingIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetFloatingIPOptions model
				getFloatingIPOptionsModel := new(vpcv1.GetFloatingIPOptions)
				getFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetFloatingIPWithContext(ctx, getFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetFloatingIP(getFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetFloatingIPWithContext(ctx, getFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getFloatingIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetFloatingIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetFloatingIPOptions model
				getFloatingIPOptionsModel := new(vpcv1.GetFloatingIPOptions)
				getFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetFloatingIP(getFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetFloatingIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetFloatingIPOptions model
				getFloatingIPOptionsModel := new(vpcv1.GetFloatingIPOptions)
				getFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetFloatingIP(getFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetFloatingIPOptions model with no property values
				getFloatingIPOptionsModelNew := new(vpcv1.GetFloatingIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetFloatingIP(getFloatingIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetFloatingIPOptions model
				getFloatingIPOptionsModel := new(vpcv1.GetFloatingIPOptions)
				getFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetFloatingIP(getFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateFloatingIP(updateFloatingIPOptions *UpdateFloatingIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateFloatingIPPath := "/floating_ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateFloatingIPPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateFloatingIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID model
				floatingIPTargetPatchModel := new(vpcv1.FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID)
				floatingIPTargetPatchModel.ID = core.StringPtr("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")

				// Construct an instance of the FloatingIPPatch model
				floatingIPPatchModel := new(vpcv1.FloatingIPPatch)
				floatingIPPatchModel.Name = core.StringPtr("my-floating-ip")
				floatingIPPatchModel.Target = floatingIPTargetPatchModel
				floatingIPPatchModelAsPatch, asPatchErr := floatingIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateFloatingIPOptions model
				updateFloatingIPOptionsModel := new(vpcv1.UpdateFloatingIPOptions)
				updateFloatingIPOptionsModel.ID = core.StringPtr("testString")
				updateFloatingIPOptionsModel.FloatingIPPatch = floatingIPPatchModelAsPatch
				updateFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateFloatingIP(updateFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateFloatingIP(updateFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateFloatingIP(updateFloatingIPOptions *UpdateFloatingIPOptions)`, func() {
		version := "2024-06-23"
		updateFloatingIPPath := "/floating_ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateFloatingIPPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateFloatingIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID model
				floatingIPTargetPatchModel := new(vpcv1.FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID)
				floatingIPTargetPatchModel.ID = core.StringPtr("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")

				// Construct an instance of the FloatingIPPatch model
				floatingIPPatchModel := new(vpcv1.FloatingIPPatch)
				floatingIPPatchModel.Name = core.StringPtr("my-floating-ip")
				floatingIPPatchModel.Target = floatingIPTargetPatchModel
				floatingIPPatchModelAsPatch, asPatchErr := floatingIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateFloatingIPOptions model
				updateFloatingIPOptionsModel := new(vpcv1.UpdateFloatingIPOptions)
				updateFloatingIPOptionsModel.ID = core.StringPtr("testString")
				updateFloatingIPOptionsModel.FloatingIPPatch = floatingIPPatchModelAsPatch
				updateFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateFloatingIPWithContext(ctx, updateFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateFloatingIP(updateFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateFloatingIPWithContext(ctx, updateFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateFloatingIPPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateFloatingIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID model
				floatingIPTargetPatchModel := new(vpcv1.FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID)
				floatingIPTargetPatchModel.ID = core.StringPtr("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")

				// Construct an instance of the FloatingIPPatch model
				floatingIPPatchModel := new(vpcv1.FloatingIPPatch)
				floatingIPPatchModel.Name = core.StringPtr("my-floating-ip")
				floatingIPPatchModel.Target = floatingIPTargetPatchModel
				floatingIPPatchModelAsPatch, asPatchErr := floatingIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateFloatingIPOptions model
				updateFloatingIPOptionsModel := new(vpcv1.UpdateFloatingIPOptions)
				updateFloatingIPOptionsModel.ID = core.StringPtr("testString")
				updateFloatingIPOptionsModel.FloatingIPPatch = floatingIPPatchModelAsPatch
				updateFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateFloatingIP(updateFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateFloatingIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID model
				floatingIPTargetPatchModel := new(vpcv1.FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID)
				floatingIPTargetPatchModel.ID = core.StringPtr("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")

				// Construct an instance of the FloatingIPPatch model
				floatingIPPatchModel := new(vpcv1.FloatingIPPatch)
				floatingIPPatchModel.Name = core.StringPtr("my-floating-ip")
				floatingIPPatchModel.Target = floatingIPTargetPatchModel
				floatingIPPatchModelAsPatch, asPatchErr := floatingIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateFloatingIPOptions model
				updateFloatingIPOptionsModel := new(vpcv1.UpdateFloatingIPOptions)
				updateFloatingIPOptionsModel.ID = core.StringPtr("testString")
				updateFloatingIPOptionsModel.FloatingIPPatch = floatingIPPatchModelAsPatch
				updateFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateFloatingIP(updateFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateFloatingIPOptions model with no property values
				updateFloatingIPOptionsModelNew := new(vpcv1.UpdateFloatingIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateFloatingIP(updateFloatingIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID model
				floatingIPTargetPatchModel := new(vpcv1.FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID)
				floatingIPTargetPatchModel.ID = core.StringPtr("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")

				// Construct an instance of the FloatingIPPatch model
				floatingIPPatchModel := new(vpcv1.FloatingIPPatch)
				floatingIPPatchModel.Name = core.StringPtr("my-floating-ip")
				floatingIPPatchModel.Target = floatingIPTargetPatchModel
				floatingIPPatchModelAsPatch, asPatchErr := floatingIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateFloatingIPOptions model
				updateFloatingIPOptionsModel := new(vpcv1.UpdateFloatingIPOptions)
				updateFloatingIPOptionsModel.ID = core.StringPtr("testString")
				updateFloatingIPOptionsModel.FloatingIPPatch = floatingIPPatchModelAsPatch
				updateFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateFloatingIP(updateFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListFlowLogCollectors(listFlowLogCollectorsOptions *ListFlowLogCollectorsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listFlowLogCollectorsPath := "/flow_log_collectors"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listFlowLogCollectorsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					Expect(req.URL.Query()["target.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target.resource_type"]).To(Equal([]string{"testString"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListFlowLogCollectors with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListFlowLogCollectorsOptions model
				listFlowLogCollectorsOptionsModel := new(vpcv1.ListFlowLogCollectorsOptions)
				listFlowLogCollectorsOptionsModel.Start = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listFlowLogCollectorsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Name = core.StringPtr("my-name")
				listFlowLogCollectorsOptionsModel.VPCID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listFlowLogCollectorsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listFlowLogCollectorsOptionsModel.TargetID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListFlowLogCollectors(listFlowLogCollectorsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListFlowLogCollectors(listFlowLogCollectorsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListFlowLogCollectors(listFlowLogCollectorsOptions *ListFlowLogCollectorsOptions)`, func() {
		version := "2024-06-23"
		listFlowLogCollectorsPath := "/flow_log_collectors"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listFlowLogCollectorsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					Expect(req.URL.Query()["target.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target.resource_type"]).To(Equal([]string{"testString"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "id": "r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListFlowLogCollectors successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListFlowLogCollectorsOptions model
				listFlowLogCollectorsOptionsModel := new(vpcv1.ListFlowLogCollectorsOptions)
				listFlowLogCollectorsOptionsModel.Start = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listFlowLogCollectorsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Name = core.StringPtr("my-name")
				listFlowLogCollectorsOptionsModel.VPCID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listFlowLogCollectorsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listFlowLogCollectorsOptionsModel.TargetID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListFlowLogCollectorsWithContext(ctx, listFlowLogCollectorsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListFlowLogCollectors(listFlowLogCollectorsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListFlowLogCollectorsWithContext(ctx, listFlowLogCollectorsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listFlowLogCollectorsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					Expect(req.URL.Query()["target.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target.resource_type"]).To(Equal([]string{"testString"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "id": "r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListFlowLogCollectors successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListFlowLogCollectors(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListFlowLogCollectorsOptions model
				listFlowLogCollectorsOptionsModel := new(vpcv1.ListFlowLogCollectorsOptions)
				listFlowLogCollectorsOptionsModel.Start = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listFlowLogCollectorsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Name = core.StringPtr("my-name")
				listFlowLogCollectorsOptionsModel.VPCID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listFlowLogCollectorsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listFlowLogCollectorsOptionsModel.TargetID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListFlowLogCollectors(listFlowLogCollectorsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListFlowLogCollectors with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListFlowLogCollectorsOptions model
				listFlowLogCollectorsOptionsModel := new(vpcv1.ListFlowLogCollectorsOptions)
				listFlowLogCollectorsOptionsModel.Start = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listFlowLogCollectorsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Name = core.StringPtr("my-name")
				listFlowLogCollectorsOptionsModel.VPCID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listFlowLogCollectorsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listFlowLogCollectorsOptionsModel.TargetID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListFlowLogCollectors(listFlowLogCollectorsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListFlowLogCollectors successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListFlowLogCollectorsOptions model
				listFlowLogCollectorsOptionsModel := new(vpcv1.ListFlowLogCollectorsOptions)
				listFlowLogCollectorsOptionsModel.Start = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listFlowLogCollectorsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Name = core.StringPtr("my-name")
				listFlowLogCollectorsOptionsModel.VPCID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listFlowLogCollectorsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listFlowLogCollectorsOptionsModel.TargetID = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listFlowLogCollectorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListFlowLogCollectors(listFlowLogCollectorsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.FlowLogCollectorCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.FlowLogCollectorCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.FlowLogCollectorCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listFlowLogCollectorsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80","id":"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80","id":"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use FlowLogCollectorsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listFlowLogCollectorsOptionsModel := &vpcv1.ListFlowLogCollectorsOptions{
					Limit:              core.Int64Ptr(int64(10)),
					ResourceGroupID:    core.StringPtr("testString"),
					Name:               core.StringPtr("my-name"),
					VPCID:              core.StringPtr("testString"),
					VPCCRN:             core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:            core.StringPtr("my-vpc"),
					TargetID:           core.StringPtr("testString"),
					TargetResourceType: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewFlowLogCollectorsPager(listFlowLogCollectorsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.FlowLogCollector
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use FlowLogCollectorsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listFlowLogCollectorsOptionsModel := &vpcv1.ListFlowLogCollectorsOptions{
					Limit:              core.Int64Ptr(int64(10)),
					ResourceGroupID:    core.StringPtr("testString"),
					Name:               core.StringPtr("my-name"),
					VPCID:              core.StringPtr("testString"),
					VPCCRN:             core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:            core.StringPtr("my-vpc"),
					TargetID:           core.StringPtr("testString"),
					TargetResourceType: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewFlowLogCollectorsPager(listFlowLogCollectorsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateFlowLogCollector(createFlowLogCollectorOptions *CreateFlowLogCollectorOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createFlowLogCollectorPath := "/flow_log_collectors"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createFlowLogCollectorPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateFlowLogCollector with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
				legacyCloudObjectStorageBucketIdentityModel := new(vpcv1.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName)
				legacyCloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue")

				// Construct an instance of the FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID model
				flowLogCollectorTargetPrototypeModel := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID)
				flowLogCollectorTargetPrototypeModel.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateFlowLogCollectorOptions model
				createFlowLogCollectorOptionsModel := new(vpcv1.CreateFlowLogCollectorOptions)
				createFlowLogCollectorOptionsModel.StorageBucket = legacyCloudObjectStorageBucketIdentityModel
				createFlowLogCollectorOptionsModel.Target = flowLogCollectorTargetPrototypeModel
				createFlowLogCollectorOptionsModel.Active = core.BoolPtr(false)
				createFlowLogCollectorOptionsModel.Name = core.StringPtr("my-flow-log-collector")
				createFlowLogCollectorOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateFlowLogCollector(createFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateFlowLogCollector(createFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateFlowLogCollector(createFlowLogCollectorOptions *CreateFlowLogCollectorOptions)`, func() {
		version := "2024-06-23"
		createFlowLogCollectorPath := "/flow_log_collectors"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createFlowLogCollectorPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "id": "r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateFlowLogCollector successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
				legacyCloudObjectStorageBucketIdentityModel := new(vpcv1.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName)
				legacyCloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue")

				// Construct an instance of the FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID model
				flowLogCollectorTargetPrototypeModel := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID)
				flowLogCollectorTargetPrototypeModel.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateFlowLogCollectorOptions model
				createFlowLogCollectorOptionsModel := new(vpcv1.CreateFlowLogCollectorOptions)
				createFlowLogCollectorOptionsModel.StorageBucket = legacyCloudObjectStorageBucketIdentityModel
				createFlowLogCollectorOptionsModel.Target = flowLogCollectorTargetPrototypeModel
				createFlowLogCollectorOptionsModel.Active = core.BoolPtr(false)
				createFlowLogCollectorOptionsModel.Name = core.StringPtr("my-flow-log-collector")
				createFlowLogCollectorOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateFlowLogCollectorWithContext(ctx, createFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateFlowLogCollector(createFlowLogCollectorOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateFlowLogCollectorWithContext(ctx, createFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createFlowLogCollectorPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "id": "r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateFlowLogCollector successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateFlowLogCollector(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
				legacyCloudObjectStorageBucketIdentityModel := new(vpcv1.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName)
				legacyCloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue")

				// Construct an instance of the FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID model
				flowLogCollectorTargetPrototypeModel := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID)
				flowLogCollectorTargetPrototypeModel.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateFlowLogCollectorOptions model
				createFlowLogCollectorOptionsModel := new(vpcv1.CreateFlowLogCollectorOptions)
				createFlowLogCollectorOptionsModel.StorageBucket = legacyCloudObjectStorageBucketIdentityModel
				createFlowLogCollectorOptionsModel.Target = flowLogCollectorTargetPrototypeModel
				createFlowLogCollectorOptionsModel.Active = core.BoolPtr(false)
				createFlowLogCollectorOptionsModel.Name = core.StringPtr("my-flow-log-collector")
				createFlowLogCollectorOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateFlowLogCollector(createFlowLogCollectorOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateFlowLogCollector with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
				legacyCloudObjectStorageBucketIdentityModel := new(vpcv1.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName)
				legacyCloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue")

				// Construct an instance of the FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID model
				flowLogCollectorTargetPrototypeModel := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID)
				flowLogCollectorTargetPrototypeModel.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateFlowLogCollectorOptions model
				createFlowLogCollectorOptionsModel := new(vpcv1.CreateFlowLogCollectorOptions)
				createFlowLogCollectorOptionsModel.StorageBucket = legacyCloudObjectStorageBucketIdentityModel
				createFlowLogCollectorOptionsModel.Target = flowLogCollectorTargetPrototypeModel
				createFlowLogCollectorOptionsModel.Active = core.BoolPtr(false)
				createFlowLogCollectorOptionsModel.Name = core.StringPtr("my-flow-log-collector")
				createFlowLogCollectorOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateFlowLogCollector(createFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateFlowLogCollectorOptions model with no property values
				createFlowLogCollectorOptionsModelNew := new(vpcv1.CreateFlowLogCollectorOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateFlowLogCollector(createFlowLogCollectorOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateFlowLogCollector successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
				legacyCloudObjectStorageBucketIdentityModel := new(vpcv1.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName)
				legacyCloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue")

				// Construct an instance of the FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID model
				flowLogCollectorTargetPrototypeModel := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID)
				flowLogCollectorTargetPrototypeModel.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateFlowLogCollectorOptions model
				createFlowLogCollectorOptionsModel := new(vpcv1.CreateFlowLogCollectorOptions)
				createFlowLogCollectorOptionsModel.StorageBucket = legacyCloudObjectStorageBucketIdentityModel
				createFlowLogCollectorOptionsModel.Target = flowLogCollectorTargetPrototypeModel
				createFlowLogCollectorOptionsModel.Active = core.BoolPtr(false)
				createFlowLogCollectorOptionsModel.Name = core.StringPtr("my-flow-log-collector")
				createFlowLogCollectorOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateFlowLogCollector(createFlowLogCollectorOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteFlowLogCollector(deleteFlowLogCollectorOptions *DeleteFlowLogCollectorOptions)`, func() {
		version := "2024-06-23"
		deleteFlowLogCollectorPath := "/flow_log_collectors/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteFlowLogCollectorPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteFlowLogCollector successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteFlowLogCollector(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteFlowLogCollectorOptions model
				deleteFlowLogCollectorOptionsModel := new(vpcv1.DeleteFlowLogCollectorOptions)
				deleteFlowLogCollectorOptionsModel.ID = core.StringPtr("testString")
				deleteFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteFlowLogCollector(deleteFlowLogCollectorOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteFlowLogCollector with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteFlowLogCollectorOptions model
				deleteFlowLogCollectorOptionsModel := new(vpcv1.DeleteFlowLogCollectorOptions)
				deleteFlowLogCollectorOptionsModel.ID = core.StringPtr("testString")
				deleteFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteFlowLogCollector(deleteFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteFlowLogCollectorOptions model with no property values
				deleteFlowLogCollectorOptionsModelNew := new(vpcv1.DeleteFlowLogCollectorOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteFlowLogCollector(deleteFlowLogCollectorOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetFlowLogCollector(getFlowLogCollectorOptions *GetFlowLogCollectorOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getFlowLogCollectorPath := "/flow_log_collectors/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getFlowLogCollectorPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetFlowLogCollector with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetFlowLogCollectorOptions model
				getFlowLogCollectorOptionsModel := new(vpcv1.GetFlowLogCollectorOptions)
				getFlowLogCollectorOptionsModel.ID = core.StringPtr("testString")
				getFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetFlowLogCollector(getFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetFlowLogCollector(getFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetFlowLogCollector(getFlowLogCollectorOptions *GetFlowLogCollectorOptions)`, func() {
		version := "2024-06-23"
		getFlowLogCollectorPath := "/flow_log_collectors/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getFlowLogCollectorPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "id": "r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetFlowLogCollector successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetFlowLogCollectorOptions model
				getFlowLogCollectorOptionsModel := new(vpcv1.GetFlowLogCollectorOptions)
				getFlowLogCollectorOptionsModel.ID = core.StringPtr("testString")
				getFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetFlowLogCollectorWithContext(ctx, getFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetFlowLogCollector(getFlowLogCollectorOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetFlowLogCollectorWithContext(ctx, getFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getFlowLogCollectorPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "id": "r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetFlowLogCollector successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetFlowLogCollector(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetFlowLogCollectorOptions model
				getFlowLogCollectorOptionsModel := new(vpcv1.GetFlowLogCollectorOptions)
				getFlowLogCollectorOptionsModel.ID = core.StringPtr("testString")
				getFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetFlowLogCollector(getFlowLogCollectorOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetFlowLogCollector with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetFlowLogCollectorOptions model
				getFlowLogCollectorOptionsModel := new(vpcv1.GetFlowLogCollectorOptions)
				getFlowLogCollectorOptionsModel.ID = core.StringPtr("testString")
				getFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetFlowLogCollector(getFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetFlowLogCollectorOptions model with no property values
				getFlowLogCollectorOptionsModelNew := new(vpcv1.GetFlowLogCollectorOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetFlowLogCollector(getFlowLogCollectorOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetFlowLogCollector successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetFlowLogCollectorOptions model
				getFlowLogCollectorOptionsModel := new(vpcv1.GetFlowLogCollectorOptions)
				getFlowLogCollectorOptionsModel.ID = core.StringPtr("testString")
				getFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetFlowLogCollector(getFlowLogCollectorOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateFlowLogCollector(updateFlowLogCollectorOptions *UpdateFlowLogCollectorOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateFlowLogCollectorPath := "/flow_log_collectors/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateFlowLogCollectorPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateFlowLogCollector with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the FlowLogCollectorPatch model
				flowLogCollectorPatchModel := new(vpcv1.FlowLogCollectorPatch)
				flowLogCollectorPatchModel.Active = core.BoolPtr(false)
				flowLogCollectorPatchModel.Name = core.StringPtr("my-flow-log-collector")
				flowLogCollectorPatchModelAsPatch, asPatchErr := flowLogCollectorPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateFlowLogCollectorOptions model
				updateFlowLogCollectorOptionsModel := new(vpcv1.UpdateFlowLogCollectorOptions)
				updateFlowLogCollectorOptionsModel.ID = core.StringPtr("testString")
				updateFlowLogCollectorOptionsModel.FlowLogCollectorPatch = flowLogCollectorPatchModelAsPatch
				updateFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateFlowLogCollector(updateFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateFlowLogCollector(updateFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateFlowLogCollector(updateFlowLogCollectorOptions *UpdateFlowLogCollectorOptions)`, func() {
		version := "2024-06-23"
		updateFlowLogCollectorPath := "/flow_log_collectors/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateFlowLogCollectorPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "id": "r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateFlowLogCollector successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the FlowLogCollectorPatch model
				flowLogCollectorPatchModel := new(vpcv1.FlowLogCollectorPatch)
				flowLogCollectorPatchModel.Active = core.BoolPtr(false)
				flowLogCollectorPatchModel.Name = core.StringPtr("my-flow-log-collector")
				flowLogCollectorPatchModelAsPatch, asPatchErr := flowLogCollectorPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateFlowLogCollectorOptions model
				updateFlowLogCollectorOptionsModel := new(vpcv1.UpdateFlowLogCollectorOptions)
				updateFlowLogCollectorOptionsModel.ID = core.StringPtr("testString")
				updateFlowLogCollectorOptionsModel.FlowLogCollectorPatch = flowLogCollectorPatchModelAsPatch
				updateFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateFlowLogCollectorWithContext(ctx, updateFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateFlowLogCollector(updateFlowLogCollectorOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateFlowLogCollectorWithContext(ctx, updateFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateFlowLogCollectorPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "id": "r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateFlowLogCollector successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateFlowLogCollector(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the FlowLogCollectorPatch model
				flowLogCollectorPatchModel := new(vpcv1.FlowLogCollectorPatch)
				flowLogCollectorPatchModel.Active = core.BoolPtr(false)
				flowLogCollectorPatchModel.Name = core.StringPtr("my-flow-log-collector")
				flowLogCollectorPatchModelAsPatch, asPatchErr := flowLogCollectorPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateFlowLogCollectorOptions model
				updateFlowLogCollectorOptionsModel := new(vpcv1.UpdateFlowLogCollectorOptions)
				updateFlowLogCollectorOptionsModel.ID = core.StringPtr("testString")
				updateFlowLogCollectorOptionsModel.FlowLogCollectorPatch = flowLogCollectorPatchModelAsPatch
				updateFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateFlowLogCollector(updateFlowLogCollectorOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateFlowLogCollector with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the FlowLogCollectorPatch model
				flowLogCollectorPatchModel := new(vpcv1.FlowLogCollectorPatch)
				flowLogCollectorPatchModel.Active = core.BoolPtr(false)
				flowLogCollectorPatchModel.Name = core.StringPtr("my-flow-log-collector")
				flowLogCollectorPatchModelAsPatch, asPatchErr := flowLogCollectorPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateFlowLogCollectorOptions model
				updateFlowLogCollectorOptionsModel := new(vpcv1.UpdateFlowLogCollectorOptions)
				updateFlowLogCollectorOptionsModel.ID = core.StringPtr("testString")
				updateFlowLogCollectorOptionsModel.FlowLogCollectorPatch = flowLogCollectorPatchModelAsPatch
				updateFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateFlowLogCollector(updateFlowLogCollectorOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateFlowLogCollectorOptions model with no property values
				updateFlowLogCollectorOptionsModelNew := new(vpcv1.UpdateFlowLogCollectorOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateFlowLogCollector(updateFlowLogCollectorOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateFlowLogCollector successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the FlowLogCollectorPatch model
				flowLogCollectorPatchModel := new(vpcv1.FlowLogCollectorPatch)
				flowLogCollectorPatchModel.Active = core.BoolPtr(false)
				flowLogCollectorPatchModel.Name = core.StringPtr("my-flow-log-collector")
				flowLogCollectorPatchModelAsPatch, asPatchErr := flowLogCollectorPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateFlowLogCollectorOptions model
				updateFlowLogCollectorOptionsModel := new(vpcv1.UpdateFlowLogCollectorOptions)
				updateFlowLogCollectorOptionsModel.ID = core.StringPtr("testString")
				updateFlowLogCollectorOptionsModel.FlowLogCollectorPatch = flowLogCollectorPatchModelAsPatch
				updateFlowLogCollectorOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateFlowLogCollector(updateFlowLogCollectorOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListRegions(listRegionsOptions *ListRegionsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listRegionsPath := "/regions"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listRegionsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListRegions with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListRegionsOptions model
				listRegionsOptionsModel := new(vpcv1.ListRegionsOptions)
				listRegionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListRegions(listRegionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListRegions(listRegionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListRegions(listRegionsOptions *ListRegionsOptions)`, func() {
		version := "2024-06-23"
		listRegionsPath := "/regions"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listRegionsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"regions": [{"endpoint": "https://us-south.iaas.cloud.ibm.com", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}]}`)
				}))
			})
			It(`Invoke ListRegions successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListRegionsOptions model
				listRegionsOptionsModel := new(vpcv1.ListRegionsOptions)
				listRegionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListRegionsWithContext(ctx, listRegionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListRegions(listRegionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListRegionsWithContext(ctx, listRegionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listRegionsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"regions": [{"endpoint": "https://us-south.iaas.cloud.ibm.com", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}]}`)
				}))
			})
			It(`Invoke ListRegions successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListRegions(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListRegionsOptions model
				listRegionsOptionsModel := new(vpcv1.ListRegionsOptions)
				listRegionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListRegions(listRegionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListRegions with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListRegionsOptions model
				listRegionsOptionsModel := new(vpcv1.ListRegionsOptions)
				listRegionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListRegions(listRegionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListRegions successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListRegionsOptions model
				listRegionsOptionsModel := new(vpcv1.ListRegionsOptions)
				listRegionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListRegions(listRegionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetRegion(getRegionOptions *GetRegionOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getRegionPath := "/regions/us-south"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getRegionPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetRegion with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetRegionOptions model
				getRegionOptionsModel := new(vpcv1.GetRegionOptions)
				getRegionOptionsModel.Name = core.StringPtr("us-south")
				getRegionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetRegion(getRegionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetRegion(getRegionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetRegion(getRegionOptions *GetRegionOptions)`, func() {
		version := "2024-06-23"
		getRegionPath := "/regions/us-south"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getRegionPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"endpoint": "https://us-south.iaas.cloud.ibm.com", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}`)
				}))
			})
			It(`Invoke GetRegion successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetRegionOptions model
				getRegionOptionsModel := new(vpcv1.GetRegionOptions)
				getRegionOptionsModel.Name = core.StringPtr("us-south")
				getRegionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetRegionWithContext(ctx, getRegionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetRegion(getRegionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetRegionWithContext(ctx, getRegionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getRegionPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"endpoint": "https://us-south.iaas.cloud.ibm.com", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}`)
				}))
			})
			It(`Invoke GetRegion successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetRegion(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetRegionOptions model
				getRegionOptionsModel := new(vpcv1.GetRegionOptions)
				getRegionOptionsModel.Name = core.StringPtr("us-south")
				getRegionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetRegion(getRegionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetRegion with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetRegionOptions model
				getRegionOptionsModel := new(vpcv1.GetRegionOptions)
				getRegionOptionsModel.Name = core.StringPtr("us-south")
				getRegionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetRegion(getRegionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetRegionOptions model with no property values
				getRegionOptionsModelNew := new(vpcv1.GetRegionOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetRegion(getRegionOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetRegion successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetRegionOptions model
				getRegionOptionsModel := new(vpcv1.GetRegionOptions)
				getRegionOptionsModel.Name = core.StringPtr("us-south")
				getRegionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetRegion(getRegionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListRegionZones(listRegionZonesOptions *ListRegionZonesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listRegionZonesPath := "/regions/us-south/zones"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listRegionZonesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListRegionZones with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListRegionZonesOptions model
				listRegionZonesOptionsModel := new(vpcv1.ListRegionZonesOptions)
				listRegionZonesOptionsModel.RegionName = core.StringPtr("us-south")
				listRegionZonesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListRegionZones(listRegionZonesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListRegionZones(listRegionZonesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListRegionZones(listRegionZonesOptions *ListRegionZonesOptions)`, func() {
		version := "2024-06-23"
		listRegionZonesPath := "/regions/us-south/zones"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listRegionZonesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"zones": [{"data_center": "DAL12", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available", "universal_name": "us-south-dal10-a"}]}`)
				}))
			})
			It(`Invoke ListRegionZones successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListRegionZonesOptions model
				listRegionZonesOptionsModel := new(vpcv1.ListRegionZonesOptions)
				listRegionZonesOptionsModel.RegionName = core.StringPtr("us-south")
				listRegionZonesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListRegionZonesWithContext(ctx, listRegionZonesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListRegionZones(listRegionZonesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListRegionZonesWithContext(ctx, listRegionZonesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listRegionZonesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"zones": [{"data_center": "DAL12", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available", "universal_name": "us-south-dal10-a"}]}`)
				}))
			})
			It(`Invoke ListRegionZones successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListRegionZones(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListRegionZonesOptions model
				listRegionZonesOptionsModel := new(vpcv1.ListRegionZonesOptions)
				listRegionZonesOptionsModel.RegionName = core.StringPtr("us-south")
				listRegionZonesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListRegionZones(listRegionZonesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListRegionZones with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListRegionZonesOptions model
				listRegionZonesOptionsModel := new(vpcv1.ListRegionZonesOptions)
				listRegionZonesOptionsModel.RegionName = core.StringPtr("us-south")
				listRegionZonesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListRegionZones(listRegionZonesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListRegionZonesOptions model with no property values
				listRegionZonesOptionsModelNew := new(vpcv1.ListRegionZonesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListRegionZones(listRegionZonesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListRegionZones successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListRegionZonesOptions model
				listRegionZonesOptionsModel := new(vpcv1.ListRegionZonesOptions)
				listRegionZonesOptionsModel.RegionName = core.StringPtr("us-south")
				listRegionZonesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListRegionZones(listRegionZonesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetRegionZone(getRegionZoneOptions *GetRegionZoneOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getRegionZonePath := "/regions/us-south/zones/us-south-1"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getRegionZonePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetRegionZone with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetRegionZoneOptions model
				getRegionZoneOptionsModel := new(vpcv1.GetRegionZoneOptions)
				getRegionZoneOptionsModel.RegionName = core.StringPtr("us-south")
				getRegionZoneOptionsModel.Name = core.StringPtr("us-south-1")
				getRegionZoneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetRegionZone(getRegionZoneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetRegionZone(getRegionZoneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetRegionZone(getRegionZoneOptions *GetRegionZoneOptions)`, func() {
		version := "2024-06-23"
		getRegionZonePath := "/regions/us-south/zones/us-south-1"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getRegionZonePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"data_center": "DAL12", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available", "universal_name": "us-south-dal10-a"}`)
				}))
			})
			It(`Invoke GetRegionZone successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetRegionZoneOptions model
				getRegionZoneOptionsModel := new(vpcv1.GetRegionZoneOptions)
				getRegionZoneOptionsModel.RegionName = core.StringPtr("us-south")
				getRegionZoneOptionsModel.Name = core.StringPtr("us-south-1")
				getRegionZoneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetRegionZoneWithContext(ctx, getRegionZoneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetRegionZone(getRegionZoneOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetRegionZoneWithContext(ctx, getRegionZoneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getRegionZonePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"data_center": "DAL12", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available", "universal_name": "us-south-dal10-a"}`)
				}))
			})
			It(`Invoke GetRegionZone successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetRegionZone(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetRegionZoneOptions model
				getRegionZoneOptionsModel := new(vpcv1.GetRegionZoneOptions)
				getRegionZoneOptionsModel.RegionName = core.StringPtr("us-south")
				getRegionZoneOptionsModel.Name = core.StringPtr("us-south-1")
				getRegionZoneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetRegionZone(getRegionZoneOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetRegionZone with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetRegionZoneOptions model
				getRegionZoneOptionsModel := new(vpcv1.GetRegionZoneOptions)
				getRegionZoneOptionsModel.RegionName = core.StringPtr("us-south")
				getRegionZoneOptionsModel.Name = core.StringPtr("us-south-1")
				getRegionZoneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetRegionZone(getRegionZoneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetRegionZoneOptions model with no property values
				getRegionZoneOptionsModelNew := new(vpcv1.GetRegionZoneOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetRegionZone(getRegionZoneOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetRegionZone successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetRegionZoneOptions model
				getRegionZoneOptionsModel := new(vpcv1.GetRegionZoneOptions)
				getRegionZoneOptionsModel.RegionName = core.StringPtr("us-south")
				getRegionZoneOptionsModel.Name = core.StringPtr("us-south-1")
				getRegionZoneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetRegionZone(getRegionZoneOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListImages(listImagesOptions *ListImagesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listImagesPath := "/images"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImagesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["visibility"]).To(Equal([]string{"private"}))
					Expect(req.URL.Query()["remote.account.id"]).To(Equal([]string{"bb1b52262f7441a586f49068482f1e60"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListImages with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListImagesOptions model
				listImagesOptionsModel := new(vpcv1.ListImagesOptions)
				listImagesOptionsModel.Start = core.StringPtr("testString")
				listImagesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImagesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listImagesOptionsModel.Name = core.StringPtr("my-name")
				listImagesOptionsModel.Status = []string{"available"}
				listImagesOptionsModel.Visibility = core.StringPtr("private")
				listImagesOptionsModel.UserDataFormat = []string{"cloud_init"}
				listImagesOptionsModel.RemoteAccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listImagesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListImages(listImagesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListImages(listImagesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListImages(listImagesOptions *ListImagesOptions)`, func() {
		version := "2024-06-23"
		listImagesPath := "/images"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImagesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["visibility"]).To(Equal([]string{"private"}))
					Expect(req.URL.Query()["remote.account.id"]).To(Equal([]string{"bb1b52262f7441a586f49068482f1e60"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "images": [{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 22, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_data_format": "cloud_init", "visibility": "private"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListImages successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListImagesOptions model
				listImagesOptionsModel := new(vpcv1.ListImagesOptions)
				listImagesOptionsModel.Start = core.StringPtr("testString")
				listImagesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImagesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listImagesOptionsModel.Name = core.StringPtr("my-name")
				listImagesOptionsModel.Status = []string{"available"}
				listImagesOptionsModel.Visibility = core.StringPtr("private")
				listImagesOptionsModel.UserDataFormat = []string{"cloud_init"}
				listImagesOptionsModel.RemoteAccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listImagesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListImagesWithContext(ctx, listImagesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListImages(listImagesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListImagesWithContext(ctx, listImagesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImagesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["visibility"]).To(Equal([]string{"private"}))
					Expect(req.URL.Query()["remote.account.id"]).To(Equal([]string{"bb1b52262f7441a586f49068482f1e60"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "images": [{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 22, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_data_format": "cloud_init", "visibility": "private"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListImages successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListImages(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListImagesOptions model
				listImagesOptionsModel := new(vpcv1.ListImagesOptions)
				listImagesOptionsModel.Start = core.StringPtr("testString")
				listImagesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImagesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listImagesOptionsModel.Name = core.StringPtr("my-name")
				listImagesOptionsModel.Status = []string{"available"}
				listImagesOptionsModel.Visibility = core.StringPtr("private")
				listImagesOptionsModel.UserDataFormat = []string{"cloud_init"}
				listImagesOptionsModel.RemoteAccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listImagesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListImages(listImagesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListImages with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListImagesOptions model
				listImagesOptionsModel := new(vpcv1.ListImagesOptions)
				listImagesOptionsModel.Start = core.StringPtr("testString")
				listImagesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImagesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listImagesOptionsModel.Name = core.StringPtr("my-name")
				listImagesOptionsModel.Status = []string{"available"}
				listImagesOptionsModel.Visibility = core.StringPtr("private")
				listImagesOptionsModel.UserDataFormat = []string{"cloud_init"}
				listImagesOptionsModel.RemoteAccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listImagesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListImages(listImagesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListImages successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListImagesOptions model
				listImagesOptionsModel := new(vpcv1.ListImagesOptions)
				listImagesOptionsModel.Start = core.StringPtr("testString")
				listImagesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImagesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listImagesOptionsModel.Name = core.StringPtr("my-name")
				listImagesOptionsModel.Status = []string{"available"}
				listImagesOptionsModel.Visibility = core.StringPtr("private")
				listImagesOptionsModel.UserDataFormat = []string{"cloud_init"}
				listImagesOptionsModel.RemoteAccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listImagesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListImages(listImagesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ImageCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ImageCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ImageCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImagesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"images":[{"allowed_use":{"api_version":"2024-06-23","bare_metal_server":"enable_secure_boot == true","instance":"gpu.count > 0 && enable_secure_boot == true"},"catalog_offering":{"managed":false,"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deprecation_at":"2019-01-01T12:00:00.000Z","encryption":"user_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"file":{"checksums":{"sha256":"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"},"size":1},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","minimum_provisioned_size":22,"name":"my-image","obsolescence_at":"2019-01-01T12:00:00.000Z","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"}},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"image","source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"Message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_data_format":"cloud_init","visibility":"private"}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"images":[{"allowed_use":{"api_version":"2024-06-23","bare_metal_server":"enable_secure_boot == true","instance":"gpu.count > 0 && enable_secure_boot == true"},"catalog_offering":{"managed":false,"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deprecation_at":"2019-01-01T12:00:00.000Z","encryption":"user_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"file":{"checksums":{"sha256":"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"},"size":1},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","minimum_provisioned_size":22,"name":"my-image","obsolescence_at":"2019-01-01T12:00:00.000Z","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"}},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"image","source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"Message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_data_format":"cloud_init","visibility":"private"}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use ImagesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listImagesOptionsModel := &vpcv1.ListImagesOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					Name:            core.StringPtr("my-name"),
					Status:          []string{"available"},
					Visibility:      core.StringPtr("private"),
					UserDataFormat:  []string{"cloud_init"},
					RemoteAccountID: core.StringPtr("bb1b52262f7441a586f49068482f1e60"),
				}

				pager, err := vpcService.NewImagesPager(listImagesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.Image
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use ImagesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listImagesOptionsModel := &vpcv1.ListImagesOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					Name:            core.StringPtr("my-name"),
					Status:          []string{"available"},
					Visibility:      core.StringPtr("private"),
					UserDataFormat:  []string{"cloud_init"},
					RemoteAccountID: core.StringPtr("bb1b52262f7441a586f49068482f1e60"),
				}

				pager, err := vpcService.NewImagesPager(listImagesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateImage(createImageOptions *CreateImageOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createImagePath := "/images"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createImagePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateImage with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ImageAllowedUsePrototype model
				imageAllowedUsePrototypeModel := new(vpcv1.ImageAllowedUsePrototype)
				imageAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				imageAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				imageAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the ImageFilePrototype model
				imageFilePrototypeModel := new(vpcv1.ImageFilePrototype)
				imageFilePrototypeModel.Href = core.StringPtr("cos://us-south/my-bucket/my-image.qcow2")

				// Construct an instance of the OperatingSystemIdentityByName model
				operatingSystemIdentityModel := new(vpcv1.OperatingSystemIdentityByName)
				operatingSystemIdentityModel.Name = core.StringPtr("debian-9-amd64")

				// Construct an instance of the ImagePrototypeImageByFile model
				imagePrototypeModel := new(vpcv1.ImagePrototypeImageByFile)
				imagePrototypeModel.AllowedUse = imageAllowedUsePrototypeModel
				imagePrototypeModel.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePrototypeModel.Name = core.StringPtr("my-image")
				imagePrototypeModel.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				imagePrototypeModel.EncryptedDataKey = core.StringPtr("testString")
				imagePrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				imagePrototypeModel.File = imageFilePrototypeModel
				imagePrototypeModel.OperatingSystem = operatingSystemIdentityModel

				// Construct an instance of the CreateImageOptions model
				createImageOptionsModel := new(vpcv1.CreateImageOptions)
				createImageOptionsModel.ImagePrototype = imagePrototypeModel
				createImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateImage(createImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateImage(createImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateImage(createImageOptions *CreateImageOptions)`, func() {
		version := "2024-06-23"
		createImagePath := "/images"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createImagePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 22, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_data_format": "cloud_init", "visibility": "private"}`)
				}))
			})
			It(`Invoke CreateImage successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ImageAllowedUsePrototype model
				imageAllowedUsePrototypeModel := new(vpcv1.ImageAllowedUsePrototype)
				imageAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				imageAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				imageAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the ImageFilePrototype model
				imageFilePrototypeModel := new(vpcv1.ImageFilePrototype)
				imageFilePrototypeModel.Href = core.StringPtr("cos://us-south/my-bucket/my-image.qcow2")

				// Construct an instance of the OperatingSystemIdentityByName model
				operatingSystemIdentityModel := new(vpcv1.OperatingSystemIdentityByName)
				operatingSystemIdentityModel.Name = core.StringPtr("debian-9-amd64")

				// Construct an instance of the ImagePrototypeImageByFile model
				imagePrototypeModel := new(vpcv1.ImagePrototypeImageByFile)
				imagePrototypeModel.AllowedUse = imageAllowedUsePrototypeModel
				imagePrototypeModel.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePrototypeModel.Name = core.StringPtr("my-image")
				imagePrototypeModel.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				imagePrototypeModel.EncryptedDataKey = core.StringPtr("testString")
				imagePrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				imagePrototypeModel.File = imageFilePrototypeModel
				imagePrototypeModel.OperatingSystem = operatingSystemIdentityModel

				// Construct an instance of the CreateImageOptions model
				createImageOptionsModel := new(vpcv1.CreateImageOptions)
				createImageOptionsModel.ImagePrototype = imagePrototypeModel
				createImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateImageWithContext(ctx, createImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateImage(createImageOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateImageWithContext(ctx, createImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createImagePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 22, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_data_format": "cloud_init", "visibility": "private"}`)
				}))
			})
			It(`Invoke CreateImage successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateImage(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ImageAllowedUsePrototype model
				imageAllowedUsePrototypeModel := new(vpcv1.ImageAllowedUsePrototype)
				imageAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				imageAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				imageAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the ImageFilePrototype model
				imageFilePrototypeModel := new(vpcv1.ImageFilePrototype)
				imageFilePrototypeModel.Href = core.StringPtr("cos://us-south/my-bucket/my-image.qcow2")

				// Construct an instance of the OperatingSystemIdentityByName model
				operatingSystemIdentityModel := new(vpcv1.OperatingSystemIdentityByName)
				operatingSystemIdentityModel.Name = core.StringPtr("debian-9-amd64")

				// Construct an instance of the ImagePrototypeImageByFile model
				imagePrototypeModel := new(vpcv1.ImagePrototypeImageByFile)
				imagePrototypeModel.AllowedUse = imageAllowedUsePrototypeModel
				imagePrototypeModel.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePrototypeModel.Name = core.StringPtr("my-image")
				imagePrototypeModel.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				imagePrototypeModel.EncryptedDataKey = core.StringPtr("testString")
				imagePrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				imagePrototypeModel.File = imageFilePrototypeModel
				imagePrototypeModel.OperatingSystem = operatingSystemIdentityModel

				// Construct an instance of the CreateImageOptions model
				createImageOptionsModel := new(vpcv1.CreateImageOptions)
				createImageOptionsModel.ImagePrototype = imagePrototypeModel
				createImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateImage(createImageOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateImage with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ImageAllowedUsePrototype model
				imageAllowedUsePrototypeModel := new(vpcv1.ImageAllowedUsePrototype)
				imageAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				imageAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				imageAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the ImageFilePrototype model
				imageFilePrototypeModel := new(vpcv1.ImageFilePrototype)
				imageFilePrototypeModel.Href = core.StringPtr("cos://us-south/my-bucket/my-image.qcow2")

				// Construct an instance of the OperatingSystemIdentityByName model
				operatingSystemIdentityModel := new(vpcv1.OperatingSystemIdentityByName)
				operatingSystemIdentityModel.Name = core.StringPtr("debian-9-amd64")

				// Construct an instance of the ImagePrototypeImageByFile model
				imagePrototypeModel := new(vpcv1.ImagePrototypeImageByFile)
				imagePrototypeModel.AllowedUse = imageAllowedUsePrototypeModel
				imagePrototypeModel.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePrototypeModel.Name = core.StringPtr("my-image")
				imagePrototypeModel.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				imagePrototypeModel.EncryptedDataKey = core.StringPtr("testString")
				imagePrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				imagePrototypeModel.File = imageFilePrototypeModel
				imagePrototypeModel.OperatingSystem = operatingSystemIdentityModel

				// Construct an instance of the CreateImageOptions model
				createImageOptionsModel := new(vpcv1.CreateImageOptions)
				createImageOptionsModel.ImagePrototype = imagePrototypeModel
				createImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateImage(createImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateImageOptions model with no property values
				createImageOptionsModelNew := new(vpcv1.CreateImageOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateImage(createImageOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateImage successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ImageAllowedUsePrototype model
				imageAllowedUsePrototypeModel := new(vpcv1.ImageAllowedUsePrototype)
				imageAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				imageAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				imageAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the ImageFilePrototype model
				imageFilePrototypeModel := new(vpcv1.ImageFilePrototype)
				imageFilePrototypeModel.Href = core.StringPtr("cos://us-south/my-bucket/my-image.qcow2")

				// Construct an instance of the OperatingSystemIdentityByName model
				operatingSystemIdentityModel := new(vpcv1.OperatingSystemIdentityByName)
				operatingSystemIdentityModel.Name = core.StringPtr("debian-9-amd64")

				// Construct an instance of the ImagePrototypeImageByFile model
				imagePrototypeModel := new(vpcv1.ImagePrototypeImageByFile)
				imagePrototypeModel.AllowedUse = imageAllowedUsePrototypeModel
				imagePrototypeModel.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePrototypeModel.Name = core.StringPtr("my-image")
				imagePrototypeModel.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				imagePrototypeModel.EncryptedDataKey = core.StringPtr("testString")
				imagePrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				imagePrototypeModel.File = imageFilePrototypeModel
				imagePrototypeModel.OperatingSystem = operatingSystemIdentityModel

				// Construct an instance of the CreateImageOptions model
				createImageOptionsModel := new(vpcv1.CreateImageOptions)
				createImageOptionsModel.ImagePrototype = imagePrototypeModel
				createImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateImage(createImageOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteImage(deleteImageOptions *DeleteImageOptions)`, func() {
		version := "2024-06-23"
		deleteImagePath := "/images/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteImagePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteImage successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteImage(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteImageOptions model
				deleteImageOptionsModel := new(vpcv1.DeleteImageOptions)
				deleteImageOptionsModel.ID = core.StringPtr("testString")
				deleteImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteImage(deleteImageOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteImage with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteImageOptions model
				deleteImageOptionsModel := new(vpcv1.DeleteImageOptions)
				deleteImageOptionsModel.ID = core.StringPtr("testString")
				deleteImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteImage(deleteImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteImageOptions model with no property values
				deleteImageOptionsModelNew := new(vpcv1.DeleteImageOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteImage(deleteImageOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetImage(getImageOptions *GetImageOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getImagePath := "/images/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getImagePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetImage with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetImageOptions model
				getImageOptionsModel := new(vpcv1.GetImageOptions)
				getImageOptionsModel.ID = core.StringPtr("testString")
				getImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetImage(getImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetImage(getImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetImage(getImageOptions *GetImageOptions)`, func() {
		version := "2024-06-23"
		getImagePath := "/images/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getImagePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 22, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_data_format": "cloud_init", "visibility": "private"}`)
				}))
			})
			It(`Invoke GetImage successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetImageOptions model
				getImageOptionsModel := new(vpcv1.GetImageOptions)
				getImageOptionsModel.ID = core.StringPtr("testString")
				getImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetImageWithContext(ctx, getImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetImage(getImageOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetImageWithContext(ctx, getImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getImagePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 22, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_data_format": "cloud_init", "visibility": "private"}`)
				}))
			})
			It(`Invoke GetImage successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetImage(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetImageOptions model
				getImageOptionsModel := new(vpcv1.GetImageOptions)
				getImageOptionsModel.ID = core.StringPtr("testString")
				getImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetImage(getImageOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetImage with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetImageOptions model
				getImageOptionsModel := new(vpcv1.GetImageOptions)
				getImageOptionsModel.ID = core.StringPtr("testString")
				getImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetImage(getImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetImageOptions model with no property values
				getImageOptionsModelNew := new(vpcv1.GetImageOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetImage(getImageOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetImage successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetImageOptions model
				getImageOptionsModel := new(vpcv1.GetImageOptions)
				getImageOptionsModel.ID = core.StringPtr("testString")
				getImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetImage(getImageOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateImage(updateImageOptions *UpdateImageOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateImagePath := "/images/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateImagePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateImage with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ImageAllowedUsePatch model
				imageAllowedUsePatchModel := new(vpcv1.ImageAllowedUsePatch)
				imageAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				imageAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				imageAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ImagePatch model
				imagePatchModel := new(vpcv1.ImagePatch)
				imagePatchModel.AllowedUse = imageAllowedUsePatchModel
				imagePatchModel.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePatchModel.Name = core.StringPtr("my-image")
				imagePatchModel.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePatchModelAsPatch, asPatchErr := imagePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateImageOptions model
				updateImageOptionsModel := new(vpcv1.UpdateImageOptions)
				updateImageOptionsModel.ID = core.StringPtr("testString")
				updateImageOptionsModel.ImagePatch = imagePatchModelAsPatch
				updateImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateImage(updateImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateImage(updateImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateImage(updateImageOptions *UpdateImageOptions)`, func() {
		version := "2024-06-23"
		updateImagePath := "/images/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateImagePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 22, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_data_format": "cloud_init", "visibility": "private"}`)
				}))
			})
			It(`Invoke UpdateImage successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ImageAllowedUsePatch model
				imageAllowedUsePatchModel := new(vpcv1.ImageAllowedUsePatch)
				imageAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				imageAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				imageAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ImagePatch model
				imagePatchModel := new(vpcv1.ImagePatch)
				imagePatchModel.AllowedUse = imageAllowedUsePatchModel
				imagePatchModel.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePatchModel.Name = core.StringPtr("my-image")
				imagePatchModel.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePatchModelAsPatch, asPatchErr := imagePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateImageOptions model
				updateImageOptionsModel := new(vpcv1.UpdateImageOptions)
				updateImageOptionsModel.ID = core.StringPtr("testString")
				updateImageOptionsModel.ImagePatch = imagePatchModelAsPatch
				updateImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateImageWithContext(ctx, updateImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateImage(updateImageOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateImageWithContext(ctx, updateImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateImagePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 22, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_data_format": "cloud_init", "visibility": "private"}`)
				}))
			})
			It(`Invoke UpdateImage successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateImage(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ImageAllowedUsePatch model
				imageAllowedUsePatchModel := new(vpcv1.ImageAllowedUsePatch)
				imageAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				imageAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				imageAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ImagePatch model
				imagePatchModel := new(vpcv1.ImagePatch)
				imagePatchModel.AllowedUse = imageAllowedUsePatchModel
				imagePatchModel.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePatchModel.Name = core.StringPtr("my-image")
				imagePatchModel.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePatchModelAsPatch, asPatchErr := imagePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateImageOptions model
				updateImageOptionsModel := new(vpcv1.UpdateImageOptions)
				updateImageOptionsModel.ID = core.StringPtr("testString")
				updateImageOptionsModel.ImagePatch = imagePatchModelAsPatch
				updateImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateImage(updateImageOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateImage with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ImageAllowedUsePatch model
				imageAllowedUsePatchModel := new(vpcv1.ImageAllowedUsePatch)
				imageAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				imageAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				imageAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ImagePatch model
				imagePatchModel := new(vpcv1.ImagePatch)
				imagePatchModel.AllowedUse = imageAllowedUsePatchModel
				imagePatchModel.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePatchModel.Name = core.StringPtr("my-image")
				imagePatchModel.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePatchModelAsPatch, asPatchErr := imagePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateImageOptions model
				updateImageOptionsModel := new(vpcv1.UpdateImageOptions)
				updateImageOptionsModel.ID = core.StringPtr("testString")
				updateImageOptionsModel.ImagePatch = imagePatchModelAsPatch
				updateImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateImage(updateImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateImageOptions model with no property values
				updateImageOptionsModelNew := new(vpcv1.UpdateImageOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateImage(updateImageOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateImage successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ImageAllowedUsePatch model
				imageAllowedUsePatchModel := new(vpcv1.ImageAllowedUsePatch)
				imageAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				imageAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				imageAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ImagePatch model
				imagePatchModel := new(vpcv1.ImagePatch)
				imagePatchModel.AllowedUse = imageAllowedUsePatchModel
				imagePatchModel.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePatchModel.Name = core.StringPtr("my-image")
				imagePatchModel.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePatchModelAsPatch, asPatchErr := imagePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateImageOptions model
				updateImageOptionsModel := new(vpcv1.UpdateImageOptions)
				updateImageOptionsModel.ID = core.StringPtr("testString")
				updateImageOptionsModel.ImagePatch = imagePatchModelAsPatch
				updateImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateImage(updateImageOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListImageBareMetalServerProfiles(listImageBareMetalServerProfilesOptions *ListImageBareMetalServerProfilesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listImageBareMetalServerProfilesPath := "/images/testString/bare_metal_server_profiles"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImageBareMetalServerProfilesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListImageBareMetalServerProfiles with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListImageBareMetalServerProfilesOptions model
				listImageBareMetalServerProfilesOptionsModel := new(vpcv1.ListImageBareMetalServerProfilesOptions)
				listImageBareMetalServerProfilesOptionsModel.ID = core.StringPtr("testString")
				listImageBareMetalServerProfilesOptionsModel.Start = core.StringPtr("testString")
				listImageBareMetalServerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImageBareMetalServerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListImageBareMetalServerProfiles(listImageBareMetalServerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListImageBareMetalServerProfiles(listImageBareMetalServerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListImageBareMetalServerProfiles(listImageBareMetalServerProfilesOptions *ListImageBareMetalServerProfilesOptions)`, func() {
		version := "2024-06-23"
		listImageBareMetalServerProfilesPath := "/images/testString/bare_metal_server_profiles"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImageBareMetalServerProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bare_metal_server_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListImageBareMetalServerProfiles successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListImageBareMetalServerProfilesOptions model
				listImageBareMetalServerProfilesOptionsModel := new(vpcv1.ListImageBareMetalServerProfilesOptions)
				listImageBareMetalServerProfilesOptionsModel.ID = core.StringPtr("testString")
				listImageBareMetalServerProfilesOptionsModel.Start = core.StringPtr("testString")
				listImageBareMetalServerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImageBareMetalServerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListImageBareMetalServerProfilesWithContext(ctx, listImageBareMetalServerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListImageBareMetalServerProfiles(listImageBareMetalServerProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListImageBareMetalServerProfilesWithContext(ctx, listImageBareMetalServerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImageBareMetalServerProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bare_metal_server_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListImageBareMetalServerProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListImageBareMetalServerProfiles(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListImageBareMetalServerProfilesOptions model
				listImageBareMetalServerProfilesOptionsModel := new(vpcv1.ListImageBareMetalServerProfilesOptions)
				listImageBareMetalServerProfilesOptionsModel.ID = core.StringPtr("testString")
				listImageBareMetalServerProfilesOptionsModel.Start = core.StringPtr("testString")
				listImageBareMetalServerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImageBareMetalServerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListImageBareMetalServerProfiles(listImageBareMetalServerProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListImageBareMetalServerProfiles with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListImageBareMetalServerProfilesOptions model
				listImageBareMetalServerProfilesOptionsModel := new(vpcv1.ListImageBareMetalServerProfilesOptions)
				listImageBareMetalServerProfilesOptionsModel.ID = core.StringPtr("testString")
				listImageBareMetalServerProfilesOptionsModel.Start = core.StringPtr("testString")
				listImageBareMetalServerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImageBareMetalServerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListImageBareMetalServerProfiles(listImageBareMetalServerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListImageBareMetalServerProfilesOptions model with no property values
				listImageBareMetalServerProfilesOptionsModelNew := new(vpcv1.ListImageBareMetalServerProfilesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListImageBareMetalServerProfiles(listImageBareMetalServerProfilesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListImageBareMetalServerProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListImageBareMetalServerProfilesOptions model
				listImageBareMetalServerProfilesOptionsModel := new(vpcv1.ListImageBareMetalServerProfilesOptions)
				listImageBareMetalServerProfilesOptionsModel.ID = core.StringPtr("testString")
				listImageBareMetalServerProfilesOptionsModel.Start = core.StringPtr("testString")
				listImageBareMetalServerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImageBareMetalServerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListImageBareMetalServerProfiles(listImageBareMetalServerProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ImageBareMetalServerProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ImageBareMetalServerProfileCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ImageBareMetalServerProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImageBareMetalServerProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"bare_metal_server_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"bare_metal_server_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use ImageBareMetalServerProfilesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listImageBareMetalServerProfilesOptionsModel := &vpcv1.ListImageBareMetalServerProfilesOptions{
					ID:    core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewImageBareMetalServerProfilesPager(listImageBareMetalServerProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.BareMetalServerProfileReference
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use ImageBareMetalServerProfilesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listImageBareMetalServerProfilesOptionsModel := &vpcv1.ListImageBareMetalServerProfilesOptions{
					ID:    core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewImageBareMetalServerProfilesPager(listImageBareMetalServerProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`DeprecateImage(deprecateImageOptions *DeprecateImageOptions)`, func() {
		version := "2024-06-23"
		deprecateImagePath := "/images/testString/deprecate"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deprecateImagePath))
					Expect(req.Method).To(Equal("POST"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeprecateImage successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeprecateImage(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeprecateImageOptions model
				deprecateImageOptionsModel := new(vpcv1.DeprecateImageOptions)
				deprecateImageOptionsModel.ID = core.StringPtr("testString")
				deprecateImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeprecateImage(deprecateImageOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeprecateImage with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeprecateImageOptions model
				deprecateImageOptionsModel := new(vpcv1.DeprecateImageOptions)
				deprecateImageOptionsModel.ID = core.StringPtr("testString")
				deprecateImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeprecateImage(deprecateImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeprecateImageOptions model with no property values
				deprecateImageOptionsModelNew := new(vpcv1.DeprecateImageOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeprecateImage(deprecateImageOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListImageInstanceProfiles(listImageInstanceProfilesOptions *ListImageInstanceProfilesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listImageInstanceProfilesPath := "/images/testString/instance_profiles"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImageInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListImageInstanceProfiles with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListImageInstanceProfilesOptions model
				listImageInstanceProfilesOptionsModel := new(vpcv1.ListImageInstanceProfilesOptions)
				listImageInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listImageInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listImageInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImageInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListImageInstanceProfiles(listImageInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListImageInstanceProfiles(listImageInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListImageInstanceProfiles(listImageInstanceProfilesOptions *ListImageInstanceProfilesOptions)`, func() {
		version := "2024-06-23"
		listImageInstanceProfilesPath := "/images/testString/instance_profiles"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImageInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListImageInstanceProfiles successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListImageInstanceProfilesOptions model
				listImageInstanceProfilesOptionsModel := new(vpcv1.ListImageInstanceProfilesOptions)
				listImageInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listImageInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listImageInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImageInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListImageInstanceProfilesWithContext(ctx, listImageInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListImageInstanceProfiles(listImageInstanceProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListImageInstanceProfilesWithContext(ctx, listImageInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImageInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListImageInstanceProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListImageInstanceProfiles(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListImageInstanceProfilesOptions model
				listImageInstanceProfilesOptionsModel := new(vpcv1.ListImageInstanceProfilesOptions)
				listImageInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listImageInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listImageInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImageInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListImageInstanceProfiles(listImageInstanceProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListImageInstanceProfiles with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListImageInstanceProfilesOptions model
				listImageInstanceProfilesOptionsModel := new(vpcv1.ListImageInstanceProfilesOptions)
				listImageInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listImageInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listImageInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImageInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListImageInstanceProfiles(listImageInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListImageInstanceProfilesOptions model with no property values
				listImageInstanceProfilesOptionsModelNew := new(vpcv1.ListImageInstanceProfilesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListImageInstanceProfiles(listImageInstanceProfilesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListImageInstanceProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListImageInstanceProfilesOptions model
				listImageInstanceProfilesOptionsModel := new(vpcv1.ListImageInstanceProfilesOptions)
				listImageInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listImageInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listImageInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listImageInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListImageInstanceProfiles(listImageInstanceProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ImageInstanceProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ImageInstanceProfileCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ImageInstanceProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImageInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use ImageInstanceProfilesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listImageInstanceProfilesOptionsModel := &vpcv1.ListImageInstanceProfilesOptions{
					ID:    core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewImageInstanceProfilesPager(listImageInstanceProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.InstanceProfileReference
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use ImageInstanceProfilesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listImageInstanceProfilesOptionsModel := &vpcv1.ListImageInstanceProfilesOptions{
					ID:    core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewImageInstanceProfilesPager(listImageInstanceProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`ObsoleteImage(obsoleteImageOptions *ObsoleteImageOptions)`, func() {
		version := "2024-06-23"
		obsoleteImagePath := "/images/testString/obsolete"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(obsoleteImagePath))
					Expect(req.Method).To(Equal("POST"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke ObsoleteImage successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.ObsoleteImage(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the ObsoleteImageOptions model
				obsoleteImageOptionsModel := new(vpcv1.ObsoleteImageOptions)
				obsoleteImageOptionsModel.ID = core.StringPtr("testString")
				obsoleteImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.ObsoleteImage(obsoleteImageOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke ObsoleteImage with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ObsoleteImageOptions model
				obsoleteImageOptionsModel := new(vpcv1.ObsoleteImageOptions)
				obsoleteImageOptionsModel.ID = core.StringPtr("testString")
				obsoleteImageOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.ObsoleteImage(obsoleteImageOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the ObsoleteImageOptions model with no property values
				obsoleteImageOptionsModelNew := new(vpcv1.ObsoleteImageOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.ObsoleteImage(obsoleteImageOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListImageExportJobs(listImageExportJobsOptions *ListImageExportJobsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listImageExportJobsPath := "/images/testString/export_jobs"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImageExportJobsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListImageExportJobs with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListImageExportJobsOptions model
				listImageExportJobsOptionsModel := new(vpcv1.ListImageExportJobsOptions)
				listImageExportJobsOptionsModel.ImageID = core.StringPtr("testString")
				listImageExportJobsOptionsModel.Name = core.StringPtr("my-name")
				listImageExportJobsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListImageExportJobs(listImageExportJobsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListImageExportJobs(listImageExportJobsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListImageExportJobs(listImageExportJobsOptions *ListImageExportJobsOptions)`, func() {
		version := "2024-06-23"
		listImageExportJobsPath := "/images/testString/export_jobs"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImageExportJobsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"export_jobs": [{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "encrypted_data_key": "VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=", "format": "qcow2", "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a", "id": "r006-095e9baf-01d4-4e29-986e-20d26606b82a", "name": "my-image-export-job", "resource_type": "image_export_job", "started_at": "2019-01-01T12:00:00.000Z", "status": "deleting", "status_reasons": [{"code": "cannot_access_storage_bucket", "message": "Message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq"}], "storage_bucket": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue", "name": "bucket-27200-lwx4cfvcue"}, "storage_href": "cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2", "storage_object": {"name": "my-object"}}]}`)
				}))
			})
			It(`Invoke ListImageExportJobs successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListImageExportJobsOptions model
				listImageExportJobsOptionsModel := new(vpcv1.ListImageExportJobsOptions)
				listImageExportJobsOptionsModel.ImageID = core.StringPtr("testString")
				listImageExportJobsOptionsModel.Name = core.StringPtr("my-name")
				listImageExportJobsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListImageExportJobsWithContext(ctx, listImageExportJobsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListImageExportJobs(listImageExportJobsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListImageExportJobsWithContext(ctx, listImageExportJobsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listImageExportJobsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"export_jobs": [{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "encrypted_data_key": "VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=", "format": "qcow2", "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a", "id": "r006-095e9baf-01d4-4e29-986e-20d26606b82a", "name": "my-image-export-job", "resource_type": "image_export_job", "started_at": "2019-01-01T12:00:00.000Z", "status": "deleting", "status_reasons": [{"code": "cannot_access_storage_bucket", "message": "Message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq"}], "storage_bucket": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue", "name": "bucket-27200-lwx4cfvcue"}, "storage_href": "cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2", "storage_object": {"name": "my-object"}}]}`)
				}))
			})
			It(`Invoke ListImageExportJobs successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListImageExportJobs(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListImageExportJobsOptions model
				listImageExportJobsOptionsModel := new(vpcv1.ListImageExportJobsOptions)
				listImageExportJobsOptionsModel.ImageID = core.StringPtr("testString")
				listImageExportJobsOptionsModel.Name = core.StringPtr("my-name")
				listImageExportJobsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListImageExportJobs(listImageExportJobsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListImageExportJobs with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListImageExportJobsOptions model
				listImageExportJobsOptionsModel := new(vpcv1.ListImageExportJobsOptions)
				listImageExportJobsOptionsModel.ImageID = core.StringPtr("testString")
				listImageExportJobsOptionsModel.Name = core.StringPtr("my-name")
				listImageExportJobsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListImageExportJobs(listImageExportJobsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListImageExportJobsOptions model with no property values
				listImageExportJobsOptionsModelNew := new(vpcv1.ListImageExportJobsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListImageExportJobs(listImageExportJobsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListImageExportJobs successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListImageExportJobsOptions model
				listImageExportJobsOptionsModel := new(vpcv1.ListImageExportJobsOptions)
				listImageExportJobsOptionsModel.ImageID = core.StringPtr("testString")
				listImageExportJobsOptionsModel.Name = core.StringPtr("my-name")
				listImageExportJobsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListImageExportJobs(listImageExportJobsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateImageExportJob(createImageExportJobOptions *CreateImageExportJobOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createImageExportJobPath := "/images/testString/export_jobs"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createImageExportJobPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateImageExportJob with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
				cloudObjectStorageBucketIdentityModel := new(vpcv1.CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName)
				cloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue")

				// Construct an instance of the CreateImageExportJobOptions model
				createImageExportJobOptionsModel := new(vpcv1.CreateImageExportJobOptions)
				createImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				createImageExportJobOptionsModel.StorageBucket = cloudObjectStorageBucketIdentityModel
				createImageExportJobOptionsModel.Format = core.StringPtr("qcow2")
				createImageExportJobOptionsModel.Name = core.StringPtr("my-image-export")
				createImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateImageExportJob(createImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateImageExportJob(createImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateImageExportJob(createImageExportJobOptions *CreateImageExportJobOptions)`, func() {
		version := "2024-06-23"
		createImageExportJobPath := "/images/testString/export_jobs"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createImageExportJobPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "encrypted_data_key": "VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=", "format": "qcow2", "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a", "id": "r006-095e9baf-01d4-4e29-986e-20d26606b82a", "name": "my-image-export-job", "resource_type": "image_export_job", "started_at": "2019-01-01T12:00:00.000Z", "status": "deleting", "status_reasons": [{"code": "cannot_access_storage_bucket", "message": "Message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq"}], "storage_bucket": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue", "name": "bucket-27200-lwx4cfvcue"}, "storage_href": "cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2", "storage_object": {"name": "my-object"}}`)
				}))
			})
			It(`Invoke CreateImageExportJob successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
				cloudObjectStorageBucketIdentityModel := new(vpcv1.CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName)
				cloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue")

				// Construct an instance of the CreateImageExportJobOptions model
				createImageExportJobOptionsModel := new(vpcv1.CreateImageExportJobOptions)
				createImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				createImageExportJobOptionsModel.StorageBucket = cloudObjectStorageBucketIdentityModel
				createImageExportJobOptionsModel.Format = core.StringPtr("qcow2")
				createImageExportJobOptionsModel.Name = core.StringPtr("my-image-export")
				createImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateImageExportJobWithContext(ctx, createImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateImageExportJob(createImageExportJobOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateImageExportJobWithContext(ctx, createImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createImageExportJobPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "encrypted_data_key": "VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=", "format": "qcow2", "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a", "id": "r006-095e9baf-01d4-4e29-986e-20d26606b82a", "name": "my-image-export-job", "resource_type": "image_export_job", "started_at": "2019-01-01T12:00:00.000Z", "status": "deleting", "status_reasons": [{"code": "cannot_access_storage_bucket", "message": "Message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq"}], "storage_bucket": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue", "name": "bucket-27200-lwx4cfvcue"}, "storage_href": "cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2", "storage_object": {"name": "my-object"}}`)
				}))
			})
			It(`Invoke CreateImageExportJob successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateImageExportJob(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
				cloudObjectStorageBucketIdentityModel := new(vpcv1.CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName)
				cloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue")

				// Construct an instance of the CreateImageExportJobOptions model
				createImageExportJobOptionsModel := new(vpcv1.CreateImageExportJobOptions)
				createImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				createImageExportJobOptionsModel.StorageBucket = cloudObjectStorageBucketIdentityModel
				createImageExportJobOptionsModel.Format = core.StringPtr("qcow2")
				createImageExportJobOptionsModel.Name = core.StringPtr("my-image-export")
				createImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateImageExportJob(createImageExportJobOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateImageExportJob with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
				cloudObjectStorageBucketIdentityModel := new(vpcv1.CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName)
				cloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue")

				// Construct an instance of the CreateImageExportJobOptions model
				createImageExportJobOptionsModel := new(vpcv1.CreateImageExportJobOptions)
				createImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				createImageExportJobOptionsModel.StorageBucket = cloudObjectStorageBucketIdentityModel
				createImageExportJobOptionsModel.Format = core.StringPtr("qcow2")
				createImageExportJobOptionsModel.Name = core.StringPtr("my-image-export")
				createImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateImageExportJob(createImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateImageExportJobOptions model with no property values
				createImageExportJobOptionsModelNew := new(vpcv1.CreateImageExportJobOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateImageExportJob(createImageExportJobOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateImageExportJob successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
				cloudObjectStorageBucketIdentityModel := new(vpcv1.CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName)
				cloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue")

				// Construct an instance of the CreateImageExportJobOptions model
				createImageExportJobOptionsModel := new(vpcv1.CreateImageExportJobOptions)
				createImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				createImageExportJobOptionsModel.StorageBucket = cloudObjectStorageBucketIdentityModel
				createImageExportJobOptionsModel.Format = core.StringPtr("qcow2")
				createImageExportJobOptionsModel.Name = core.StringPtr("my-image-export")
				createImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateImageExportJob(createImageExportJobOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteImageExportJob(deleteImageExportJobOptions *DeleteImageExportJobOptions)`, func() {
		version := "2024-06-23"
		deleteImageExportJobPath := "/images/testString/export_jobs/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteImageExportJobPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteImageExportJob successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteImageExportJob(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteImageExportJobOptions model
				deleteImageExportJobOptionsModel := new(vpcv1.DeleteImageExportJobOptions)
				deleteImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				deleteImageExportJobOptionsModel.ID = core.StringPtr("testString")
				deleteImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteImageExportJob(deleteImageExportJobOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteImageExportJob with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteImageExportJobOptions model
				deleteImageExportJobOptionsModel := new(vpcv1.DeleteImageExportJobOptions)
				deleteImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				deleteImageExportJobOptionsModel.ID = core.StringPtr("testString")
				deleteImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteImageExportJob(deleteImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteImageExportJobOptions model with no property values
				deleteImageExportJobOptionsModelNew := new(vpcv1.DeleteImageExportJobOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteImageExportJob(deleteImageExportJobOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetImageExportJob(getImageExportJobOptions *GetImageExportJobOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getImageExportJobPath := "/images/testString/export_jobs/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getImageExportJobPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetImageExportJob with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetImageExportJobOptions model
				getImageExportJobOptionsModel := new(vpcv1.GetImageExportJobOptions)
				getImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				getImageExportJobOptionsModel.ID = core.StringPtr("testString")
				getImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetImageExportJob(getImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetImageExportJob(getImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetImageExportJob(getImageExportJobOptions *GetImageExportJobOptions)`, func() {
		version := "2024-06-23"
		getImageExportJobPath := "/images/testString/export_jobs/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getImageExportJobPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "encrypted_data_key": "VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=", "format": "qcow2", "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a", "id": "r006-095e9baf-01d4-4e29-986e-20d26606b82a", "name": "my-image-export-job", "resource_type": "image_export_job", "started_at": "2019-01-01T12:00:00.000Z", "status": "deleting", "status_reasons": [{"code": "cannot_access_storage_bucket", "message": "Message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq"}], "storage_bucket": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue", "name": "bucket-27200-lwx4cfvcue"}, "storage_href": "cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2", "storage_object": {"name": "my-object"}}`)
				}))
			})
			It(`Invoke GetImageExportJob successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetImageExportJobOptions model
				getImageExportJobOptionsModel := new(vpcv1.GetImageExportJobOptions)
				getImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				getImageExportJobOptionsModel.ID = core.StringPtr("testString")
				getImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetImageExportJobWithContext(ctx, getImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetImageExportJob(getImageExportJobOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetImageExportJobWithContext(ctx, getImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getImageExportJobPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "encrypted_data_key": "VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=", "format": "qcow2", "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a", "id": "r006-095e9baf-01d4-4e29-986e-20d26606b82a", "name": "my-image-export-job", "resource_type": "image_export_job", "started_at": "2019-01-01T12:00:00.000Z", "status": "deleting", "status_reasons": [{"code": "cannot_access_storage_bucket", "message": "Message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq"}], "storage_bucket": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue", "name": "bucket-27200-lwx4cfvcue"}, "storage_href": "cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2", "storage_object": {"name": "my-object"}}`)
				}))
			})
			It(`Invoke GetImageExportJob successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetImageExportJob(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetImageExportJobOptions model
				getImageExportJobOptionsModel := new(vpcv1.GetImageExportJobOptions)
				getImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				getImageExportJobOptionsModel.ID = core.StringPtr("testString")
				getImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetImageExportJob(getImageExportJobOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetImageExportJob with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetImageExportJobOptions model
				getImageExportJobOptionsModel := new(vpcv1.GetImageExportJobOptions)
				getImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				getImageExportJobOptionsModel.ID = core.StringPtr("testString")
				getImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetImageExportJob(getImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetImageExportJobOptions model with no property values
				getImageExportJobOptionsModelNew := new(vpcv1.GetImageExportJobOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetImageExportJob(getImageExportJobOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetImageExportJob successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetImageExportJobOptions model
				getImageExportJobOptionsModel := new(vpcv1.GetImageExportJobOptions)
				getImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				getImageExportJobOptionsModel.ID = core.StringPtr("testString")
				getImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetImageExportJob(getImageExportJobOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateImageExportJob(updateImageExportJobOptions *UpdateImageExportJobOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateImageExportJobPath := "/images/testString/export_jobs/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateImageExportJobPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateImageExportJob with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ImageExportJobPatch model
				imageExportJobPatchModel := new(vpcv1.ImageExportJobPatch)
				imageExportJobPatchModel.Name = core.StringPtr("my-image-export-job-updated")
				imageExportJobPatchModelAsPatch, asPatchErr := imageExportJobPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateImageExportJobOptions model
				updateImageExportJobOptionsModel := new(vpcv1.UpdateImageExportJobOptions)
				updateImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				updateImageExportJobOptionsModel.ID = core.StringPtr("testString")
				updateImageExportJobOptionsModel.ImageExportJobPatch = imageExportJobPatchModelAsPatch
				updateImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateImageExportJob(updateImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateImageExportJob(updateImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateImageExportJob(updateImageExportJobOptions *UpdateImageExportJobOptions)`, func() {
		version := "2024-06-23"
		updateImageExportJobPath := "/images/testString/export_jobs/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateImageExportJobPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "encrypted_data_key": "VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=", "format": "qcow2", "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a", "id": "r006-095e9baf-01d4-4e29-986e-20d26606b82a", "name": "my-image-export-job", "resource_type": "image_export_job", "started_at": "2019-01-01T12:00:00.000Z", "status": "deleting", "status_reasons": [{"code": "cannot_access_storage_bucket", "message": "Message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq"}], "storage_bucket": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue", "name": "bucket-27200-lwx4cfvcue"}, "storage_href": "cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2", "storage_object": {"name": "my-object"}}`)
				}))
			})
			It(`Invoke UpdateImageExportJob successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ImageExportJobPatch model
				imageExportJobPatchModel := new(vpcv1.ImageExportJobPatch)
				imageExportJobPatchModel.Name = core.StringPtr("my-image-export-job-updated")
				imageExportJobPatchModelAsPatch, asPatchErr := imageExportJobPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateImageExportJobOptions model
				updateImageExportJobOptionsModel := new(vpcv1.UpdateImageExportJobOptions)
				updateImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				updateImageExportJobOptionsModel.ID = core.StringPtr("testString")
				updateImageExportJobOptionsModel.ImageExportJobPatch = imageExportJobPatchModelAsPatch
				updateImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateImageExportJobWithContext(ctx, updateImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateImageExportJob(updateImageExportJobOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateImageExportJobWithContext(ctx, updateImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateImageExportJobPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "encrypted_data_key": "VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=", "format": "qcow2", "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a", "id": "r006-095e9baf-01d4-4e29-986e-20d26606b82a", "name": "my-image-export-job", "resource_type": "image_export_job", "started_at": "2019-01-01T12:00:00.000Z", "status": "deleting", "status_reasons": [{"code": "cannot_access_storage_bucket", "message": "Message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq"}], "storage_bucket": {"crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue", "name": "bucket-27200-lwx4cfvcue"}, "storage_href": "cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2", "storage_object": {"name": "my-object"}}`)
				}))
			})
			It(`Invoke UpdateImageExportJob successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateImageExportJob(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ImageExportJobPatch model
				imageExportJobPatchModel := new(vpcv1.ImageExportJobPatch)
				imageExportJobPatchModel.Name = core.StringPtr("my-image-export-job-updated")
				imageExportJobPatchModelAsPatch, asPatchErr := imageExportJobPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateImageExportJobOptions model
				updateImageExportJobOptionsModel := new(vpcv1.UpdateImageExportJobOptions)
				updateImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				updateImageExportJobOptionsModel.ID = core.StringPtr("testString")
				updateImageExportJobOptionsModel.ImageExportJobPatch = imageExportJobPatchModelAsPatch
				updateImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateImageExportJob(updateImageExportJobOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateImageExportJob with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ImageExportJobPatch model
				imageExportJobPatchModel := new(vpcv1.ImageExportJobPatch)
				imageExportJobPatchModel.Name = core.StringPtr("my-image-export-job-updated")
				imageExportJobPatchModelAsPatch, asPatchErr := imageExportJobPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateImageExportJobOptions model
				updateImageExportJobOptionsModel := new(vpcv1.UpdateImageExportJobOptions)
				updateImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				updateImageExportJobOptionsModel.ID = core.StringPtr("testString")
				updateImageExportJobOptionsModel.ImageExportJobPatch = imageExportJobPatchModelAsPatch
				updateImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateImageExportJob(updateImageExportJobOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateImageExportJobOptions model with no property values
				updateImageExportJobOptionsModelNew := new(vpcv1.UpdateImageExportJobOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateImageExportJob(updateImageExportJobOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateImageExportJob successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ImageExportJobPatch model
				imageExportJobPatchModel := new(vpcv1.ImageExportJobPatch)
				imageExportJobPatchModel.Name = core.StringPtr("my-image-export-job-updated")
				imageExportJobPatchModelAsPatch, asPatchErr := imageExportJobPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateImageExportJobOptions model
				updateImageExportJobOptionsModel := new(vpcv1.UpdateImageExportJobOptions)
				updateImageExportJobOptionsModel.ImageID = core.StringPtr("testString")
				updateImageExportJobOptionsModel.ID = core.StringPtr("testString")
				updateImageExportJobOptionsModel.ImageExportJobPatch = imageExportJobPatchModelAsPatch
				updateImageExportJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateImageExportJob(updateImageExportJobOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListOperatingSystems(listOperatingSystemsOptions *ListOperatingSystemsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listOperatingSystemsPath := "/operating_systems"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listOperatingSystemsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListOperatingSystems with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListOperatingSystemsOptions model
				listOperatingSystemsOptionsModel := new(vpcv1.ListOperatingSystemsOptions)
				listOperatingSystemsOptionsModel.Start = core.StringPtr("testString")
				listOperatingSystemsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listOperatingSystemsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListOperatingSystems(listOperatingSystemsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListOperatingSystems(listOperatingSystemsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListOperatingSystems(listOperatingSystemsOptions *ListOperatingSystemsOptions)`, func() {
		version := "2024-06-23"
		listOperatingSystemsPath := "/operating_systems"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listOperatingSystemsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "operating_systems": [{"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListOperatingSystems successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListOperatingSystemsOptions model
				listOperatingSystemsOptionsModel := new(vpcv1.ListOperatingSystemsOptions)
				listOperatingSystemsOptionsModel.Start = core.StringPtr("testString")
				listOperatingSystemsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listOperatingSystemsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListOperatingSystemsWithContext(ctx, listOperatingSystemsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListOperatingSystems(listOperatingSystemsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListOperatingSystemsWithContext(ctx, listOperatingSystemsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listOperatingSystemsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "operating_systems": [{"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListOperatingSystems successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListOperatingSystems(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListOperatingSystemsOptions model
				listOperatingSystemsOptionsModel := new(vpcv1.ListOperatingSystemsOptions)
				listOperatingSystemsOptionsModel.Start = core.StringPtr("testString")
				listOperatingSystemsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listOperatingSystemsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListOperatingSystems(listOperatingSystemsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListOperatingSystems with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListOperatingSystemsOptions model
				listOperatingSystemsOptionsModel := new(vpcv1.ListOperatingSystemsOptions)
				listOperatingSystemsOptionsModel.Start = core.StringPtr("testString")
				listOperatingSystemsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listOperatingSystemsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListOperatingSystems(listOperatingSystemsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListOperatingSystems successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListOperatingSystemsOptions model
				listOperatingSystemsOptionsModel := new(vpcv1.ListOperatingSystemsOptions)
				listOperatingSystemsOptionsModel.Start = core.StringPtr("testString")
				listOperatingSystemsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listOperatingSystemsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListOperatingSystems(listOperatingSystemsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.OperatingSystemCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.OperatingSystemCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.OperatingSystemCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listOperatingSystemsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"operating_systems":[{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"operating_systems":[{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use OperatingSystemsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listOperatingSystemsOptionsModel := &vpcv1.ListOperatingSystemsOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewOperatingSystemsPager(listOperatingSystemsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.OperatingSystem
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use OperatingSystemsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listOperatingSystemsOptionsModel := &vpcv1.ListOperatingSystemsOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewOperatingSystemsPager(listOperatingSystemsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`GetOperatingSystem(getOperatingSystemOptions *GetOperatingSystemOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getOperatingSystemPath := "/operating_systems/red-7-amd64"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getOperatingSystemPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetOperatingSystem with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetOperatingSystemOptions model
				getOperatingSystemOptionsModel := new(vpcv1.GetOperatingSystemOptions)
				getOperatingSystemOptionsModel.Name = core.StringPtr("red-7-amd64")
				getOperatingSystemOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetOperatingSystem(getOperatingSystemOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetOperatingSystem(getOperatingSystemOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetOperatingSystem(getOperatingSystemOptions *GetOperatingSystemOptions)`, func() {
		version := "2024-06-23"
		getOperatingSystemPath := "/operating_systems/red-7-amd64"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getOperatingSystemPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}`)
				}))
			})
			It(`Invoke GetOperatingSystem successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetOperatingSystemOptions model
				getOperatingSystemOptionsModel := new(vpcv1.GetOperatingSystemOptions)
				getOperatingSystemOptionsModel.Name = core.StringPtr("red-7-amd64")
				getOperatingSystemOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetOperatingSystemWithContext(ctx, getOperatingSystemOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetOperatingSystem(getOperatingSystemOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetOperatingSystemWithContext(ctx, getOperatingSystemOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getOperatingSystemPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}`)
				}))
			})
			It(`Invoke GetOperatingSystem successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetOperatingSystem(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetOperatingSystemOptions model
				getOperatingSystemOptionsModel := new(vpcv1.GetOperatingSystemOptions)
				getOperatingSystemOptionsModel.Name = core.StringPtr("red-7-amd64")
				getOperatingSystemOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetOperatingSystem(getOperatingSystemOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetOperatingSystem with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetOperatingSystemOptions model
				getOperatingSystemOptionsModel := new(vpcv1.GetOperatingSystemOptions)
				getOperatingSystemOptionsModel.Name = core.StringPtr("red-7-amd64")
				getOperatingSystemOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetOperatingSystem(getOperatingSystemOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetOperatingSystemOptions model with no property values
				getOperatingSystemOptionsModelNew := new(vpcv1.GetOperatingSystemOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetOperatingSystem(getOperatingSystemOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetOperatingSystem successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetOperatingSystemOptions model
				getOperatingSystemOptionsModel := new(vpcv1.GetOperatingSystemOptions)
				getOperatingSystemOptionsModel.Name = core.StringPtr("red-7-amd64")
				getOperatingSystemOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetOperatingSystem(getOperatingSystemOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceGroups(listInstanceGroupsOptions *ListInstanceGroupsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstanceGroupsPath := "/instance_groups"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstanceGroups with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupsOptions model
				listInstanceGroupsOptionsModel := new(vpcv1.ListInstanceGroupsOptions)
				listInstanceGroupsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstanceGroups(listInstanceGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstanceGroups(listInstanceGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceGroups(listInstanceGroupsOptions *ListInstanceGroupsOptions)`, func() {
		version := "2024-06-23"
		listInstanceGroupsPath := "/instance_groups"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "name": "my-instance-template"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceGroups successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstanceGroupsOptions model
				listInstanceGroupsOptionsModel := new(vpcv1.ListInstanceGroupsOptions)
				listInstanceGroupsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstanceGroupsWithContext(ctx, listInstanceGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstanceGroups(listInstanceGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstanceGroupsWithContext(ctx, listInstanceGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "name": "my-instance-template"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceGroups successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstanceGroups(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstanceGroupsOptions model
				listInstanceGroupsOptionsModel := new(vpcv1.ListInstanceGroupsOptions)
				listInstanceGroupsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstanceGroups(listInstanceGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstanceGroups with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupsOptions model
				listInstanceGroupsOptionsModel := new(vpcv1.ListInstanceGroupsOptions)
				listInstanceGroupsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstanceGroups(listInstanceGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstanceGroups successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupsOptions model
				listInstanceGroupsOptionsModel := new(vpcv1.ListInstanceGroupsOptions)
				listInstanceGroupsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstanceGroups(listInstanceGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.InstanceGroupCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.InstanceGroupCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.InstanceGroupCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"instance_groups":[{"application_port":22,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60","id":"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60","instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2","id":"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2","name":"my-instance-template"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","load_balancer_pool":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004","id":"r006-70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"},"managers":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea","id":"r006-bd21f31f-8a05-4451-836d-ab0347e91fea","name":"my-instance-group-manager"}],"membership_count":10,"name":"my-instance-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"deleting","subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"updated_at":"2019-01-01T12:00:00.000Z","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"instance_groups":[{"application_port":22,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60","id":"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60","instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2","id":"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2","name":"my-instance-template"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","load_balancer_pool":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004","id":"r006-70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"},"managers":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea","id":"r006-bd21f31f-8a05-4451-836d-ab0347e91fea","name":"my-instance-group-manager"}],"membership_count":10,"name":"my-instance-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"deleting","subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"updated_at":"2019-01-01T12:00:00.000Z","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use InstanceGroupsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstanceGroupsOptionsModel := &vpcv1.ListInstanceGroupsOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewInstanceGroupsPager(listInstanceGroupsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.InstanceGroup
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use InstanceGroupsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstanceGroupsOptionsModel := &vpcv1.ListInstanceGroupsOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewInstanceGroupsPager(listInstanceGroupsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateInstanceGroup(createInstanceGroupOptions *CreateInstanceGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createInstanceGroupPath := "/instance_groups"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceGroupPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateInstanceGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceTemplateIdentityByID model
				instanceTemplateIdentityModel := new(vpcv1.InstanceTemplateIdentityByID)
				instanceTemplateIdentityModel.ID = core.StringPtr("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateInstanceGroupOptions model
				createInstanceGroupOptionsModel := new(vpcv1.CreateInstanceGroupOptions)
				createInstanceGroupOptionsModel.InstanceTemplate = instanceTemplateIdentityModel
				createInstanceGroupOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createInstanceGroupOptionsModel.ApplicationPort = core.Int64Ptr(int64(22))
				createInstanceGroupOptionsModel.LoadBalancer = loadBalancerIdentityModel
				createInstanceGroupOptionsModel.LoadBalancerPool = loadBalancerPoolIdentityModel
				createInstanceGroupOptionsModel.MembershipCount = core.Int64Ptr(int64(10))
				createInstanceGroupOptionsModel.Name = core.StringPtr("my-instance-group")
				createInstanceGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateInstanceGroup(createInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateInstanceGroup(createInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceGroup(createInstanceGroupOptions *CreateInstanceGroupOptions)`, func() {
		version := "2024-06-23"
		createInstanceGroupPath := "/instance_groups"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceGroupPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "name": "my-instance-template"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateInstanceGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceTemplateIdentityByID model
				instanceTemplateIdentityModel := new(vpcv1.InstanceTemplateIdentityByID)
				instanceTemplateIdentityModel.ID = core.StringPtr("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateInstanceGroupOptions model
				createInstanceGroupOptionsModel := new(vpcv1.CreateInstanceGroupOptions)
				createInstanceGroupOptionsModel.InstanceTemplate = instanceTemplateIdentityModel
				createInstanceGroupOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createInstanceGroupOptionsModel.ApplicationPort = core.Int64Ptr(int64(22))
				createInstanceGroupOptionsModel.LoadBalancer = loadBalancerIdentityModel
				createInstanceGroupOptionsModel.LoadBalancerPool = loadBalancerPoolIdentityModel
				createInstanceGroupOptionsModel.MembershipCount = core.Int64Ptr(int64(10))
				createInstanceGroupOptionsModel.Name = core.StringPtr("my-instance-group")
				createInstanceGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateInstanceGroupWithContext(ctx, createInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateInstanceGroup(createInstanceGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateInstanceGroupWithContext(ctx, createInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceGroupPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "name": "my-instance-template"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateInstanceGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateInstanceGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceTemplateIdentityByID model
				instanceTemplateIdentityModel := new(vpcv1.InstanceTemplateIdentityByID)
				instanceTemplateIdentityModel.ID = core.StringPtr("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateInstanceGroupOptions model
				createInstanceGroupOptionsModel := new(vpcv1.CreateInstanceGroupOptions)
				createInstanceGroupOptionsModel.InstanceTemplate = instanceTemplateIdentityModel
				createInstanceGroupOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createInstanceGroupOptionsModel.ApplicationPort = core.Int64Ptr(int64(22))
				createInstanceGroupOptionsModel.LoadBalancer = loadBalancerIdentityModel
				createInstanceGroupOptionsModel.LoadBalancerPool = loadBalancerPoolIdentityModel
				createInstanceGroupOptionsModel.MembershipCount = core.Int64Ptr(int64(10))
				createInstanceGroupOptionsModel.Name = core.StringPtr("my-instance-group")
				createInstanceGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateInstanceGroup(createInstanceGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateInstanceGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceTemplateIdentityByID model
				instanceTemplateIdentityModel := new(vpcv1.InstanceTemplateIdentityByID)
				instanceTemplateIdentityModel.ID = core.StringPtr("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateInstanceGroupOptions model
				createInstanceGroupOptionsModel := new(vpcv1.CreateInstanceGroupOptions)
				createInstanceGroupOptionsModel.InstanceTemplate = instanceTemplateIdentityModel
				createInstanceGroupOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createInstanceGroupOptionsModel.ApplicationPort = core.Int64Ptr(int64(22))
				createInstanceGroupOptionsModel.LoadBalancer = loadBalancerIdentityModel
				createInstanceGroupOptionsModel.LoadBalancerPool = loadBalancerPoolIdentityModel
				createInstanceGroupOptionsModel.MembershipCount = core.Int64Ptr(int64(10))
				createInstanceGroupOptionsModel.Name = core.StringPtr("my-instance-group")
				createInstanceGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateInstanceGroup(createInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateInstanceGroupOptions model with no property values
				createInstanceGroupOptionsModelNew := new(vpcv1.CreateInstanceGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateInstanceGroup(createInstanceGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateInstanceGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceTemplateIdentityByID model
				instanceTemplateIdentityModel := new(vpcv1.InstanceTemplateIdentityByID)
				instanceTemplateIdentityModel.ID = core.StringPtr("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateInstanceGroupOptions model
				createInstanceGroupOptionsModel := new(vpcv1.CreateInstanceGroupOptions)
				createInstanceGroupOptionsModel.InstanceTemplate = instanceTemplateIdentityModel
				createInstanceGroupOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createInstanceGroupOptionsModel.ApplicationPort = core.Int64Ptr(int64(22))
				createInstanceGroupOptionsModel.LoadBalancer = loadBalancerIdentityModel
				createInstanceGroupOptionsModel.LoadBalancerPool = loadBalancerPoolIdentityModel
				createInstanceGroupOptionsModel.MembershipCount = core.Int64Ptr(int64(10))
				createInstanceGroupOptionsModel.Name = core.StringPtr("my-instance-group")
				createInstanceGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateInstanceGroup(createInstanceGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteInstanceGroup(deleteInstanceGroupOptions *DeleteInstanceGroupOptions)`, func() {
		version := "2024-06-23"
		deleteInstanceGroupPath := "/instance_groups/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstanceGroupPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteInstanceGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteInstanceGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteInstanceGroupOptions model
				deleteInstanceGroupOptionsModel := new(vpcv1.DeleteInstanceGroupOptions)
				deleteInstanceGroupOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteInstanceGroup(deleteInstanceGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteInstanceGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceGroupOptions model
				deleteInstanceGroupOptionsModel := new(vpcv1.DeleteInstanceGroupOptions)
				deleteInstanceGroupOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteInstanceGroup(deleteInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteInstanceGroupOptions model with no property values
				deleteInstanceGroupOptionsModelNew := new(vpcv1.DeleteInstanceGroupOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteInstanceGroup(deleteInstanceGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceGroup(getInstanceGroupOptions *GetInstanceGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceGroupPath := "/instance_groups/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupOptions model
				getInstanceGroupOptionsModel := new(vpcv1.GetInstanceGroupOptions)
				getInstanceGroupOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceGroup(getInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceGroup(getInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceGroup(getInstanceGroupOptions *GetInstanceGroupOptions)`, func() {
		version := "2024-06-23"
		getInstanceGroupPath := "/instance_groups/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "name": "my-instance-template"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetInstanceGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceGroupOptions model
				getInstanceGroupOptionsModel := new(vpcv1.GetInstanceGroupOptions)
				getInstanceGroupOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceGroupWithContext(ctx, getInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceGroup(getInstanceGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceGroupWithContext(ctx, getInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "name": "my-instance-template"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetInstanceGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceGroupOptions model
				getInstanceGroupOptionsModel := new(vpcv1.GetInstanceGroupOptions)
				getInstanceGroupOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceGroup(getInstanceGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupOptions model
				getInstanceGroupOptionsModel := new(vpcv1.GetInstanceGroupOptions)
				getInstanceGroupOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceGroup(getInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceGroupOptions model with no property values
				getInstanceGroupOptionsModelNew := new(vpcv1.GetInstanceGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceGroup(getInstanceGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupOptions model
				getInstanceGroupOptionsModel := new(vpcv1.GetInstanceGroupOptions)
				getInstanceGroupOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceGroup(getInstanceGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceGroup(updateInstanceGroupOptions *UpdateInstanceGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateInstanceGroupPath := "/instance_groups/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateInstanceGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceTemplateIdentityByID model
				instanceTemplateIdentityModel := new(vpcv1.InstanceTemplateIdentityByID)
				instanceTemplateIdentityModel.ID = core.StringPtr("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceGroupPatch model
				instanceGroupPatchModel := new(vpcv1.InstanceGroupPatch)
				instanceGroupPatchModel.ApplicationPort = core.Int64Ptr(int64(22))
				instanceGroupPatchModel.InstanceTemplate = instanceTemplateIdentityModel
				instanceGroupPatchModel.LoadBalancer = loadBalancerIdentityModel
				instanceGroupPatchModel.LoadBalancerPool = loadBalancerPoolIdentityModel
				instanceGroupPatchModel.MembershipCount = core.Int64Ptr(int64(20))
				instanceGroupPatchModel.Name = core.StringPtr("my-instance-group")
				instanceGroupPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				instanceGroupPatchModelAsPatch, asPatchErr := instanceGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupOptions model
				updateInstanceGroupOptionsModel := new(vpcv1.UpdateInstanceGroupOptions)
				updateInstanceGroupOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupOptionsModel.InstanceGroupPatch = instanceGroupPatchModelAsPatch
				updateInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateInstanceGroup(updateInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateInstanceGroup(updateInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceGroup(updateInstanceGroupOptions *UpdateInstanceGroupOptions)`, func() {
		version := "2024-06-23"
		updateInstanceGroupPath := "/instance_groups/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "name": "my-instance-template"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateInstanceGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceTemplateIdentityByID model
				instanceTemplateIdentityModel := new(vpcv1.InstanceTemplateIdentityByID)
				instanceTemplateIdentityModel.ID = core.StringPtr("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceGroupPatch model
				instanceGroupPatchModel := new(vpcv1.InstanceGroupPatch)
				instanceGroupPatchModel.ApplicationPort = core.Int64Ptr(int64(22))
				instanceGroupPatchModel.InstanceTemplate = instanceTemplateIdentityModel
				instanceGroupPatchModel.LoadBalancer = loadBalancerIdentityModel
				instanceGroupPatchModel.LoadBalancerPool = loadBalancerPoolIdentityModel
				instanceGroupPatchModel.MembershipCount = core.Int64Ptr(int64(20))
				instanceGroupPatchModel.Name = core.StringPtr("my-instance-group")
				instanceGroupPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				instanceGroupPatchModelAsPatch, asPatchErr := instanceGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupOptions model
				updateInstanceGroupOptionsModel := new(vpcv1.UpdateInstanceGroupOptions)
				updateInstanceGroupOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupOptionsModel.InstanceGroupPatch = instanceGroupPatchModelAsPatch
				updateInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateInstanceGroupWithContext(ctx, updateInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateInstanceGroup(updateInstanceGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateInstanceGroupWithContext(ctx, updateInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "name": "my-instance-template"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateInstanceGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateInstanceGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceTemplateIdentityByID model
				instanceTemplateIdentityModel := new(vpcv1.InstanceTemplateIdentityByID)
				instanceTemplateIdentityModel.ID = core.StringPtr("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceGroupPatch model
				instanceGroupPatchModel := new(vpcv1.InstanceGroupPatch)
				instanceGroupPatchModel.ApplicationPort = core.Int64Ptr(int64(22))
				instanceGroupPatchModel.InstanceTemplate = instanceTemplateIdentityModel
				instanceGroupPatchModel.LoadBalancer = loadBalancerIdentityModel
				instanceGroupPatchModel.LoadBalancerPool = loadBalancerPoolIdentityModel
				instanceGroupPatchModel.MembershipCount = core.Int64Ptr(int64(20))
				instanceGroupPatchModel.Name = core.StringPtr("my-instance-group")
				instanceGroupPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				instanceGroupPatchModelAsPatch, asPatchErr := instanceGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupOptions model
				updateInstanceGroupOptionsModel := new(vpcv1.UpdateInstanceGroupOptions)
				updateInstanceGroupOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupOptionsModel.InstanceGroupPatch = instanceGroupPatchModelAsPatch
				updateInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateInstanceGroup(updateInstanceGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateInstanceGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceTemplateIdentityByID model
				instanceTemplateIdentityModel := new(vpcv1.InstanceTemplateIdentityByID)
				instanceTemplateIdentityModel.ID = core.StringPtr("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceGroupPatch model
				instanceGroupPatchModel := new(vpcv1.InstanceGroupPatch)
				instanceGroupPatchModel.ApplicationPort = core.Int64Ptr(int64(22))
				instanceGroupPatchModel.InstanceTemplate = instanceTemplateIdentityModel
				instanceGroupPatchModel.LoadBalancer = loadBalancerIdentityModel
				instanceGroupPatchModel.LoadBalancerPool = loadBalancerPoolIdentityModel
				instanceGroupPatchModel.MembershipCount = core.Int64Ptr(int64(20))
				instanceGroupPatchModel.Name = core.StringPtr("my-instance-group")
				instanceGroupPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				instanceGroupPatchModelAsPatch, asPatchErr := instanceGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupOptions model
				updateInstanceGroupOptionsModel := new(vpcv1.UpdateInstanceGroupOptions)
				updateInstanceGroupOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupOptionsModel.InstanceGroupPatch = instanceGroupPatchModelAsPatch
				updateInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateInstanceGroup(updateInstanceGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateInstanceGroupOptions model with no property values
				updateInstanceGroupOptionsModelNew := new(vpcv1.UpdateInstanceGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateInstanceGroup(updateInstanceGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateInstanceGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceTemplateIdentityByID model
				instanceTemplateIdentityModel := new(vpcv1.InstanceTemplateIdentityByID)
				instanceTemplateIdentityModel.ID = core.StringPtr("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceGroupPatch model
				instanceGroupPatchModel := new(vpcv1.InstanceGroupPatch)
				instanceGroupPatchModel.ApplicationPort = core.Int64Ptr(int64(22))
				instanceGroupPatchModel.InstanceTemplate = instanceTemplateIdentityModel
				instanceGroupPatchModel.LoadBalancer = loadBalancerIdentityModel
				instanceGroupPatchModel.LoadBalancerPool = loadBalancerPoolIdentityModel
				instanceGroupPatchModel.MembershipCount = core.Int64Ptr(int64(20))
				instanceGroupPatchModel.Name = core.StringPtr("my-instance-group")
				instanceGroupPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				instanceGroupPatchModelAsPatch, asPatchErr := instanceGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupOptions model
				updateInstanceGroupOptionsModel := new(vpcv1.UpdateInstanceGroupOptions)
				updateInstanceGroupOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupOptionsModel.InstanceGroupPatch = instanceGroupPatchModelAsPatch
				updateInstanceGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateInstanceGroup(updateInstanceGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteInstanceGroupLoadBalancer(deleteInstanceGroupLoadBalancerOptions *DeleteInstanceGroupLoadBalancerOptions)`, func() {
		version := "2024-06-23"
		deleteInstanceGroupLoadBalancerPath := "/instance_groups/testString/load_balancer"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstanceGroupLoadBalancerPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteInstanceGroupLoadBalancer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteInstanceGroupLoadBalancer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteInstanceGroupLoadBalancerOptions model
				deleteInstanceGroupLoadBalancerOptionsModel := new(vpcv1.DeleteInstanceGroupLoadBalancerOptions)
				deleteInstanceGroupLoadBalancerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				deleteInstanceGroupLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteInstanceGroupLoadBalancer(deleteInstanceGroupLoadBalancerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteInstanceGroupLoadBalancer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceGroupLoadBalancerOptions model
				deleteInstanceGroupLoadBalancerOptionsModel := new(vpcv1.DeleteInstanceGroupLoadBalancerOptions)
				deleteInstanceGroupLoadBalancerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				deleteInstanceGroupLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteInstanceGroupLoadBalancer(deleteInstanceGroupLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteInstanceGroupLoadBalancerOptions model with no property values
				deleteInstanceGroupLoadBalancerOptionsModelNew := new(vpcv1.DeleteInstanceGroupLoadBalancerOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteInstanceGroupLoadBalancer(deleteInstanceGroupLoadBalancerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceGroupManagers(listInstanceGroupManagersOptions *ListInstanceGroupManagersOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstanceGroupManagersPath := "/instance_groups/testString/managers"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupManagersPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstanceGroupManagers with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupManagersOptions model
				listInstanceGroupManagersOptionsModel := new(vpcv1.ListInstanceGroupManagersOptions)
				listInstanceGroupManagersOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagersOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstanceGroupManagers(listInstanceGroupManagersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstanceGroupManagers(listInstanceGroupManagersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceGroupManagers(listInstanceGroupManagersOptions *ListInstanceGroupManagersOptions)`, func() {
		version := "2024-06-23"
		listInstanceGroupManagersPath := "/instance_groups/testString/managers"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupManagersPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "managers": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "management_enabled": false, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceGroupManagers successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstanceGroupManagersOptions model
				listInstanceGroupManagersOptionsModel := new(vpcv1.ListInstanceGroupManagersOptions)
				listInstanceGroupManagersOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagersOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstanceGroupManagersWithContext(ctx, listInstanceGroupManagersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstanceGroupManagers(listInstanceGroupManagersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstanceGroupManagersWithContext(ctx, listInstanceGroupManagersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupManagersPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "managers": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "management_enabled": false, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceGroupManagers successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstanceGroupManagers(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstanceGroupManagersOptions model
				listInstanceGroupManagersOptionsModel := new(vpcv1.ListInstanceGroupManagersOptions)
				listInstanceGroupManagersOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagersOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstanceGroupManagers(listInstanceGroupManagersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstanceGroupManagers with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupManagersOptions model
				listInstanceGroupManagersOptionsModel := new(vpcv1.ListInstanceGroupManagersOptions)
				listInstanceGroupManagersOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagersOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstanceGroupManagers(listInstanceGroupManagersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListInstanceGroupManagersOptions model with no property values
				listInstanceGroupManagersOptionsModelNew := new(vpcv1.ListInstanceGroupManagersOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListInstanceGroupManagers(listInstanceGroupManagersOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstanceGroupManagers successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupManagersOptions model
				listInstanceGroupManagersOptionsModel := new(vpcv1.ListInstanceGroupManagersOptions)
				listInstanceGroupManagersOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagersOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstanceGroupManagers(listInstanceGroupManagersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.InstanceGroupManagerCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.InstanceGroupManagerCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.InstanceGroupManagerCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupManagersPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"managers":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea","id":"r006-bd21f31f-8a05-4451-836d-ab0347e91fea","management_enabled":false,"name":"my-instance-group-manager","updated_at":"2019-01-01T12:00:00.000Z","aggregation_window":120,"cooldown":210,"manager_type":"autoscale","max_membership_count":10,"min_membership_count":10,"policies":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7","id":"r006-ca664290-30eb-4ad7-9fb6-db45731f0be7","name":"my-instance-group-manager-policy"}]}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"managers":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea","id":"r006-bd21f31f-8a05-4451-836d-ab0347e91fea","management_enabled":false,"name":"my-instance-group-manager","updated_at":"2019-01-01T12:00:00.000Z","aggregation_window":120,"cooldown":210,"manager_type":"autoscale","max_membership_count":10,"min_membership_count":10,"policies":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7","id":"r006-ca664290-30eb-4ad7-9fb6-db45731f0be7","name":"my-instance-group-manager-policy"}]}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use InstanceGroupManagersPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstanceGroupManagersOptionsModel := &vpcv1.ListInstanceGroupManagersOptions{
					InstanceGroupID: core.StringPtr("testString"),
					Limit:           core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewInstanceGroupManagersPager(listInstanceGroupManagersOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.InstanceGroupManagerIntf
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use InstanceGroupManagersPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstanceGroupManagersOptionsModel := &vpcv1.ListInstanceGroupManagersOptions{
					InstanceGroupID: core.StringPtr("testString"),
					Limit:           core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewInstanceGroupManagersPager(listInstanceGroupManagersOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateInstanceGroupManager(createInstanceGroupManagerOptions *CreateInstanceGroupManagerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createInstanceGroupManagerPath := "/instance_groups/testString/managers"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceGroupManagerPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateInstanceGroupManager with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype model
				instanceGroupManagerPrototypeModel := new(vpcv1.InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype)
				instanceGroupManagerPrototypeModel.ManagementEnabled = core.BoolPtr(true)
				instanceGroupManagerPrototypeModel.Name = core.StringPtr("my-instance-group-manager")
				instanceGroupManagerPrototypeModel.AggregationWindow = core.Int64Ptr(int64(120))
				instanceGroupManagerPrototypeModel.Cooldown = core.Int64Ptr(int64(210))
				instanceGroupManagerPrototypeModel.ManagerType = core.StringPtr("autoscale")
				instanceGroupManagerPrototypeModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPrototypeModel.MinMembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the CreateInstanceGroupManagerOptions model
				createInstanceGroupManagerOptionsModel := new(vpcv1.CreateInstanceGroupManagerOptions)
				createInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerOptionsModel.InstanceGroupManagerPrototype = instanceGroupManagerPrototypeModel
				createInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateInstanceGroupManager(createInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateInstanceGroupManager(createInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceGroupManager(createInstanceGroupManagerOptions *CreateInstanceGroupManagerOptions)`, func() {
		version := "2024-06-23"
		createInstanceGroupManagerPath := "/instance_groups/testString/managers"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceGroupManagerPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "management_enabled": false, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy"}]}`)
				}))
			})
			It(`Invoke CreateInstanceGroupManager successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype model
				instanceGroupManagerPrototypeModel := new(vpcv1.InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype)
				instanceGroupManagerPrototypeModel.ManagementEnabled = core.BoolPtr(true)
				instanceGroupManagerPrototypeModel.Name = core.StringPtr("my-instance-group-manager")
				instanceGroupManagerPrototypeModel.AggregationWindow = core.Int64Ptr(int64(120))
				instanceGroupManagerPrototypeModel.Cooldown = core.Int64Ptr(int64(210))
				instanceGroupManagerPrototypeModel.ManagerType = core.StringPtr("autoscale")
				instanceGroupManagerPrototypeModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPrototypeModel.MinMembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the CreateInstanceGroupManagerOptions model
				createInstanceGroupManagerOptionsModel := new(vpcv1.CreateInstanceGroupManagerOptions)
				createInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerOptionsModel.InstanceGroupManagerPrototype = instanceGroupManagerPrototypeModel
				createInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateInstanceGroupManagerWithContext(ctx, createInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateInstanceGroupManager(createInstanceGroupManagerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateInstanceGroupManagerWithContext(ctx, createInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceGroupManagerPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "management_enabled": false, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy"}]}`)
				}))
			})
			It(`Invoke CreateInstanceGroupManager successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateInstanceGroupManager(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype model
				instanceGroupManagerPrototypeModel := new(vpcv1.InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype)
				instanceGroupManagerPrototypeModel.ManagementEnabled = core.BoolPtr(true)
				instanceGroupManagerPrototypeModel.Name = core.StringPtr("my-instance-group-manager")
				instanceGroupManagerPrototypeModel.AggregationWindow = core.Int64Ptr(int64(120))
				instanceGroupManagerPrototypeModel.Cooldown = core.Int64Ptr(int64(210))
				instanceGroupManagerPrototypeModel.ManagerType = core.StringPtr("autoscale")
				instanceGroupManagerPrototypeModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPrototypeModel.MinMembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the CreateInstanceGroupManagerOptions model
				createInstanceGroupManagerOptionsModel := new(vpcv1.CreateInstanceGroupManagerOptions)
				createInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerOptionsModel.InstanceGroupManagerPrototype = instanceGroupManagerPrototypeModel
				createInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateInstanceGroupManager(createInstanceGroupManagerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateInstanceGroupManager with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype model
				instanceGroupManagerPrototypeModel := new(vpcv1.InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype)
				instanceGroupManagerPrototypeModel.ManagementEnabled = core.BoolPtr(true)
				instanceGroupManagerPrototypeModel.Name = core.StringPtr("my-instance-group-manager")
				instanceGroupManagerPrototypeModel.AggregationWindow = core.Int64Ptr(int64(120))
				instanceGroupManagerPrototypeModel.Cooldown = core.Int64Ptr(int64(210))
				instanceGroupManagerPrototypeModel.ManagerType = core.StringPtr("autoscale")
				instanceGroupManagerPrototypeModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPrototypeModel.MinMembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the CreateInstanceGroupManagerOptions model
				createInstanceGroupManagerOptionsModel := new(vpcv1.CreateInstanceGroupManagerOptions)
				createInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerOptionsModel.InstanceGroupManagerPrototype = instanceGroupManagerPrototypeModel
				createInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateInstanceGroupManager(createInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateInstanceGroupManagerOptions model with no property values
				createInstanceGroupManagerOptionsModelNew := new(vpcv1.CreateInstanceGroupManagerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateInstanceGroupManager(createInstanceGroupManagerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateInstanceGroupManager successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype model
				instanceGroupManagerPrototypeModel := new(vpcv1.InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype)
				instanceGroupManagerPrototypeModel.ManagementEnabled = core.BoolPtr(true)
				instanceGroupManagerPrototypeModel.Name = core.StringPtr("my-instance-group-manager")
				instanceGroupManagerPrototypeModel.AggregationWindow = core.Int64Ptr(int64(120))
				instanceGroupManagerPrototypeModel.Cooldown = core.Int64Ptr(int64(210))
				instanceGroupManagerPrototypeModel.ManagerType = core.StringPtr("autoscale")
				instanceGroupManagerPrototypeModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPrototypeModel.MinMembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the CreateInstanceGroupManagerOptions model
				createInstanceGroupManagerOptionsModel := new(vpcv1.CreateInstanceGroupManagerOptions)
				createInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerOptionsModel.InstanceGroupManagerPrototype = instanceGroupManagerPrototypeModel
				createInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateInstanceGroupManager(createInstanceGroupManagerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteInstanceGroupManager(deleteInstanceGroupManagerOptions *DeleteInstanceGroupManagerOptions)`, func() {
		version := "2024-06-23"
		deleteInstanceGroupManagerPath := "/instance_groups/testString/managers/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstanceGroupManagerPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteInstanceGroupManager successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteInstanceGroupManager(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteInstanceGroupManagerOptions model
				deleteInstanceGroupManagerOptionsModel := new(vpcv1.DeleteInstanceGroupManagerOptions)
				deleteInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				deleteInstanceGroupManagerOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteInstanceGroupManager(deleteInstanceGroupManagerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteInstanceGroupManager with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceGroupManagerOptions model
				deleteInstanceGroupManagerOptionsModel := new(vpcv1.DeleteInstanceGroupManagerOptions)
				deleteInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				deleteInstanceGroupManagerOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteInstanceGroupManager(deleteInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteInstanceGroupManagerOptions model with no property values
				deleteInstanceGroupManagerOptionsModelNew := new(vpcv1.DeleteInstanceGroupManagerOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteInstanceGroupManager(deleteInstanceGroupManagerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceGroupManager(getInstanceGroupManagerOptions *GetInstanceGroupManagerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceGroupManagerPath := "/instance_groups/testString/managers/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupManagerPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceGroupManager with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupManagerOptions model
				getInstanceGroupManagerOptionsModel := new(vpcv1.GetInstanceGroupManagerOptions)
				getInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceGroupManager(getInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceGroupManager(getInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceGroupManager(getInstanceGroupManagerOptions *GetInstanceGroupManagerOptions)`, func() {
		version := "2024-06-23"
		getInstanceGroupManagerPath := "/instance_groups/testString/managers/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupManagerPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "management_enabled": false, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy"}]}`)
				}))
			})
			It(`Invoke GetInstanceGroupManager successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceGroupManagerOptions model
				getInstanceGroupManagerOptionsModel := new(vpcv1.GetInstanceGroupManagerOptions)
				getInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceGroupManagerWithContext(ctx, getInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceGroupManager(getInstanceGroupManagerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceGroupManagerWithContext(ctx, getInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupManagerPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "management_enabled": false, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy"}]}`)
				}))
			})
			It(`Invoke GetInstanceGroupManager successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceGroupManager(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceGroupManagerOptions model
				getInstanceGroupManagerOptionsModel := new(vpcv1.GetInstanceGroupManagerOptions)
				getInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceGroupManager(getInstanceGroupManagerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceGroupManager with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupManagerOptions model
				getInstanceGroupManagerOptionsModel := new(vpcv1.GetInstanceGroupManagerOptions)
				getInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceGroupManager(getInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceGroupManagerOptions model with no property values
				getInstanceGroupManagerOptionsModelNew := new(vpcv1.GetInstanceGroupManagerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceGroupManager(getInstanceGroupManagerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceGroupManager successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupManagerOptions model
				getInstanceGroupManagerOptionsModel := new(vpcv1.GetInstanceGroupManagerOptions)
				getInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceGroupManager(getInstanceGroupManagerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceGroupManager(updateInstanceGroupManagerOptions *UpdateInstanceGroupManagerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateInstanceGroupManagerPath := "/instance_groups/testString/managers/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupManagerPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateInstanceGroupManager with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerPatch model
				instanceGroupManagerPatchModel := new(vpcv1.InstanceGroupManagerPatch)
				instanceGroupManagerPatchModel.AggregationWindow = core.Int64Ptr(int64(120))
				instanceGroupManagerPatchModel.Cooldown = core.Int64Ptr(int64(210))
				instanceGroupManagerPatchModel.ManagementEnabled = core.BoolPtr(false)
				instanceGroupManagerPatchModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPatchModel.MinMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPatchModel.Name = core.StringPtr("my-instance-group-manager")
				instanceGroupManagerPatchModelAsPatch, asPatchErr := instanceGroupManagerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerOptions model
				updateInstanceGroupManagerOptionsModel := new(vpcv1.UpdateInstanceGroupManagerOptions)
				updateInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerOptionsModel.InstanceGroupManagerPatch = instanceGroupManagerPatchModelAsPatch
				updateInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateInstanceGroupManager(updateInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateInstanceGroupManager(updateInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceGroupManager(updateInstanceGroupManagerOptions *UpdateInstanceGroupManagerOptions)`, func() {
		version := "2024-06-23"
		updateInstanceGroupManagerPath := "/instance_groups/testString/managers/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupManagerPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "management_enabled": false, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy"}]}`)
				}))
			})
			It(`Invoke UpdateInstanceGroupManager successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceGroupManagerPatch model
				instanceGroupManagerPatchModel := new(vpcv1.InstanceGroupManagerPatch)
				instanceGroupManagerPatchModel.AggregationWindow = core.Int64Ptr(int64(120))
				instanceGroupManagerPatchModel.Cooldown = core.Int64Ptr(int64(210))
				instanceGroupManagerPatchModel.ManagementEnabled = core.BoolPtr(false)
				instanceGroupManagerPatchModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPatchModel.MinMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPatchModel.Name = core.StringPtr("my-instance-group-manager")
				instanceGroupManagerPatchModelAsPatch, asPatchErr := instanceGroupManagerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerOptions model
				updateInstanceGroupManagerOptionsModel := new(vpcv1.UpdateInstanceGroupManagerOptions)
				updateInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerOptionsModel.InstanceGroupManagerPatch = instanceGroupManagerPatchModelAsPatch
				updateInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateInstanceGroupManagerWithContext(ctx, updateInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateInstanceGroupManager(updateInstanceGroupManagerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateInstanceGroupManagerWithContext(ctx, updateInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupManagerPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "id": "r006-bd21f31f-8a05-4451-836d-ab0347e91fea", "management_enabled": false, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy"}]}`)
				}))
			})
			It(`Invoke UpdateInstanceGroupManager successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateInstanceGroupManager(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceGroupManagerPatch model
				instanceGroupManagerPatchModel := new(vpcv1.InstanceGroupManagerPatch)
				instanceGroupManagerPatchModel.AggregationWindow = core.Int64Ptr(int64(120))
				instanceGroupManagerPatchModel.Cooldown = core.Int64Ptr(int64(210))
				instanceGroupManagerPatchModel.ManagementEnabled = core.BoolPtr(false)
				instanceGroupManagerPatchModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPatchModel.MinMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPatchModel.Name = core.StringPtr("my-instance-group-manager")
				instanceGroupManagerPatchModelAsPatch, asPatchErr := instanceGroupManagerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerOptions model
				updateInstanceGroupManagerOptionsModel := new(vpcv1.UpdateInstanceGroupManagerOptions)
				updateInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerOptionsModel.InstanceGroupManagerPatch = instanceGroupManagerPatchModelAsPatch
				updateInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateInstanceGroupManager(updateInstanceGroupManagerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateInstanceGroupManager with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerPatch model
				instanceGroupManagerPatchModel := new(vpcv1.InstanceGroupManagerPatch)
				instanceGroupManagerPatchModel.AggregationWindow = core.Int64Ptr(int64(120))
				instanceGroupManagerPatchModel.Cooldown = core.Int64Ptr(int64(210))
				instanceGroupManagerPatchModel.ManagementEnabled = core.BoolPtr(false)
				instanceGroupManagerPatchModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPatchModel.MinMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPatchModel.Name = core.StringPtr("my-instance-group-manager")
				instanceGroupManagerPatchModelAsPatch, asPatchErr := instanceGroupManagerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerOptions model
				updateInstanceGroupManagerOptionsModel := new(vpcv1.UpdateInstanceGroupManagerOptions)
				updateInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerOptionsModel.InstanceGroupManagerPatch = instanceGroupManagerPatchModelAsPatch
				updateInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateInstanceGroupManager(updateInstanceGroupManagerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateInstanceGroupManagerOptions model with no property values
				updateInstanceGroupManagerOptionsModelNew := new(vpcv1.UpdateInstanceGroupManagerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateInstanceGroupManager(updateInstanceGroupManagerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateInstanceGroupManager successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerPatch model
				instanceGroupManagerPatchModel := new(vpcv1.InstanceGroupManagerPatch)
				instanceGroupManagerPatchModel.AggregationWindow = core.Int64Ptr(int64(120))
				instanceGroupManagerPatchModel.Cooldown = core.Int64Ptr(int64(210))
				instanceGroupManagerPatchModel.ManagementEnabled = core.BoolPtr(false)
				instanceGroupManagerPatchModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPatchModel.MinMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPatchModel.Name = core.StringPtr("my-instance-group-manager")
				instanceGroupManagerPatchModelAsPatch, asPatchErr := instanceGroupManagerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerOptions model
				updateInstanceGroupManagerOptionsModel := new(vpcv1.UpdateInstanceGroupManagerOptions)
				updateInstanceGroupManagerOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerOptionsModel.InstanceGroupManagerPatch = instanceGroupManagerPatchModelAsPatch
				updateInstanceGroupManagerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateInstanceGroupManager(updateInstanceGroupManagerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceGroupManagerActions(listInstanceGroupManagerActionsOptions *ListInstanceGroupManagerActionsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstanceGroupManagerActionsPath := "/instance_groups/testString/managers/testString/actions"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupManagerActionsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstanceGroupManagerActions with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupManagerActionsOptions model
				listInstanceGroupManagerActionsOptionsModel := new(vpcv1.ListInstanceGroupManagerActionsOptions)
				listInstanceGroupManagerActionsOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagerActionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstanceGroupManagerActions(listInstanceGroupManagerActionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstanceGroupManagerActions(listInstanceGroupManagerActionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceGroupManagerActions(listInstanceGroupManagerActionsOptions *ListInstanceGroupManagerActionsOptions)`, func() {
		version := "2024-06-23"
		listInstanceGroupManagerActionsPath := "/instance_groups/testString/managers/testString/actions"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupManagerActionsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/actions/r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "id": "r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceGroupManagerActions successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstanceGroupManagerActionsOptions model
				listInstanceGroupManagerActionsOptionsModel := new(vpcv1.ListInstanceGroupManagerActionsOptions)
				listInstanceGroupManagerActionsOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagerActionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstanceGroupManagerActionsWithContext(ctx, listInstanceGroupManagerActionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstanceGroupManagerActions(listInstanceGroupManagerActionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstanceGroupManagerActionsWithContext(ctx, listInstanceGroupManagerActionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupManagerActionsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/actions/r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "id": "r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceGroupManagerActions successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstanceGroupManagerActions(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstanceGroupManagerActionsOptions model
				listInstanceGroupManagerActionsOptionsModel := new(vpcv1.ListInstanceGroupManagerActionsOptions)
				listInstanceGroupManagerActionsOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagerActionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstanceGroupManagerActions(listInstanceGroupManagerActionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstanceGroupManagerActions with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupManagerActionsOptions model
				listInstanceGroupManagerActionsOptionsModel := new(vpcv1.ListInstanceGroupManagerActionsOptions)
				listInstanceGroupManagerActionsOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagerActionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstanceGroupManagerActions(listInstanceGroupManagerActionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListInstanceGroupManagerActionsOptions model with no property values
				listInstanceGroupManagerActionsOptionsModelNew := new(vpcv1.ListInstanceGroupManagerActionsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListInstanceGroupManagerActions(listInstanceGroupManagerActionsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstanceGroupManagerActions successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupManagerActionsOptions model
				listInstanceGroupManagerActionsOptionsModel := new(vpcv1.ListInstanceGroupManagerActionsOptions)
				listInstanceGroupManagerActionsOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagerActionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagerActionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstanceGroupManagerActions(listInstanceGroupManagerActionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.InstanceGroupManagerActionsCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.InstanceGroupManagerActionsCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.InstanceGroupManagerActionsCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupManagerActionsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"actions":[{"auto_delete":true,"auto_delete_timeout":24,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/actions/r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7","id":"r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7","name":"my-instance-group-manager-action","resource_type":"instance_group_manager_action","status":"active","updated_at":"2019-01-01T12:00:00.000Z","action_type":"scheduled","cron_spec":"30 */2 * * 1-5","last_applied_at":"2019-01-01T12:00:00.000Z","next_run_at":"2019-01-01T12:00:00.000Z","group":{"membership_count":10}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"actions":[{"auto_delete":true,"auto_delete_timeout":24,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/actions/r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7","id":"r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7","name":"my-instance-group-manager-action","resource_type":"instance_group_manager_action","status":"active","updated_at":"2019-01-01T12:00:00.000Z","action_type":"scheduled","cron_spec":"30 */2 * * 1-5","last_applied_at":"2019-01-01T12:00:00.000Z","next_run_at":"2019-01-01T12:00:00.000Z","group":{"membership_count":10}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use InstanceGroupManagerActionsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstanceGroupManagerActionsOptionsModel := &vpcv1.ListInstanceGroupManagerActionsOptions{
					InstanceGroupID:        core.StringPtr("testString"),
					InstanceGroupManagerID: core.StringPtr("testString"),
					Limit:                  core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewInstanceGroupManagerActionsPager(listInstanceGroupManagerActionsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.InstanceGroupManagerActionIntf
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use InstanceGroupManagerActionsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstanceGroupManagerActionsOptionsModel := &vpcv1.ListInstanceGroupManagerActionsOptions{
					InstanceGroupID:        core.StringPtr("testString"),
					InstanceGroupManagerID: core.StringPtr("testString"),
					Limit:                  core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewInstanceGroupManagerActionsPager(listInstanceGroupManagerActionsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateInstanceGroupManagerAction(createInstanceGroupManagerActionOptions *CreateInstanceGroupManagerActionOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createInstanceGroupManagerActionPath := "/instance_groups/testString/managers/testString/actions"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceGroupManagerActionPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateInstanceGroupManagerAction with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerScheduledActionGroupPrototype model
				instanceGroupManagerScheduledActionGroupPrototypeModel := new(vpcv1.InstanceGroupManagerScheduledActionGroupPrototype)
				instanceGroupManagerScheduledActionGroupPrototypeModel.MembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup model
				instanceGroupManagerActionPrototypeModel := new(vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup)
				instanceGroupManagerActionPrototypeModel.Name = core.StringPtr("my-instance-group-manager-action")
				instanceGroupManagerActionPrototypeModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				instanceGroupManagerActionPrototypeModel.Group = instanceGroupManagerScheduledActionGroupPrototypeModel

				// Construct an instance of the CreateInstanceGroupManagerActionOptions model
				createInstanceGroupManagerActionOptionsModel := new(vpcv1.CreateInstanceGroupManagerActionOptions)
				createInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				createInstanceGroupManagerActionOptionsModel.InstanceGroupManagerActionPrototype = instanceGroupManagerActionPrototypeModel
				createInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateInstanceGroupManagerAction(createInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateInstanceGroupManagerAction(createInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceGroupManagerAction(createInstanceGroupManagerActionOptions *CreateInstanceGroupManagerActionOptions)`, func() {
		version := "2024-06-23"
		createInstanceGroupManagerActionPath := "/instance_groups/testString/managers/testString/actions"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceGroupManagerActionPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/actions/r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "id": "r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}`)
				}))
			})
			It(`Invoke CreateInstanceGroupManagerAction successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceGroupManagerScheduledActionGroupPrototype model
				instanceGroupManagerScheduledActionGroupPrototypeModel := new(vpcv1.InstanceGroupManagerScheduledActionGroupPrototype)
				instanceGroupManagerScheduledActionGroupPrototypeModel.MembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup model
				instanceGroupManagerActionPrototypeModel := new(vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup)
				instanceGroupManagerActionPrototypeModel.Name = core.StringPtr("my-instance-group-manager-action")
				instanceGroupManagerActionPrototypeModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				instanceGroupManagerActionPrototypeModel.Group = instanceGroupManagerScheduledActionGroupPrototypeModel

				// Construct an instance of the CreateInstanceGroupManagerActionOptions model
				createInstanceGroupManagerActionOptionsModel := new(vpcv1.CreateInstanceGroupManagerActionOptions)
				createInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				createInstanceGroupManagerActionOptionsModel.InstanceGroupManagerActionPrototype = instanceGroupManagerActionPrototypeModel
				createInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateInstanceGroupManagerActionWithContext(ctx, createInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateInstanceGroupManagerAction(createInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateInstanceGroupManagerActionWithContext(ctx, createInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceGroupManagerActionPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/actions/r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "id": "r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}`)
				}))
			})
			It(`Invoke CreateInstanceGroupManagerAction successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateInstanceGroupManagerAction(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceGroupManagerScheduledActionGroupPrototype model
				instanceGroupManagerScheduledActionGroupPrototypeModel := new(vpcv1.InstanceGroupManagerScheduledActionGroupPrototype)
				instanceGroupManagerScheduledActionGroupPrototypeModel.MembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup model
				instanceGroupManagerActionPrototypeModel := new(vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup)
				instanceGroupManagerActionPrototypeModel.Name = core.StringPtr("my-instance-group-manager-action")
				instanceGroupManagerActionPrototypeModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				instanceGroupManagerActionPrototypeModel.Group = instanceGroupManagerScheduledActionGroupPrototypeModel

				// Construct an instance of the CreateInstanceGroupManagerActionOptions model
				createInstanceGroupManagerActionOptionsModel := new(vpcv1.CreateInstanceGroupManagerActionOptions)
				createInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				createInstanceGroupManagerActionOptionsModel.InstanceGroupManagerActionPrototype = instanceGroupManagerActionPrototypeModel
				createInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateInstanceGroupManagerAction(createInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateInstanceGroupManagerAction with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerScheduledActionGroupPrototype model
				instanceGroupManagerScheduledActionGroupPrototypeModel := new(vpcv1.InstanceGroupManagerScheduledActionGroupPrototype)
				instanceGroupManagerScheduledActionGroupPrototypeModel.MembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup model
				instanceGroupManagerActionPrototypeModel := new(vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup)
				instanceGroupManagerActionPrototypeModel.Name = core.StringPtr("my-instance-group-manager-action")
				instanceGroupManagerActionPrototypeModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				instanceGroupManagerActionPrototypeModel.Group = instanceGroupManagerScheduledActionGroupPrototypeModel

				// Construct an instance of the CreateInstanceGroupManagerActionOptions model
				createInstanceGroupManagerActionOptionsModel := new(vpcv1.CreateInstanceGroupManagerActionOptions)
				createInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				createInstanceGroupManagerActionOptionsModel.InstanceGroupManagerActionPrototype = instanceGroupManagerActionPrototypeModel
				createInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateInstanceGroupManagerAction(createInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateInstanceGroupManagerActionOptions model with no property values
				createInstanceGroupManagerActionOptionsModelNew := new(vpcv1.CreateInstanceGroupManagerActionOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateInstanceGroupManagerAction(createInstanceGroupManagerActionOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateInstanceGroupManagerAction successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerScheduledActionGroupPrototype model
				instanceGroupManagerScheduledActionGroupPrototypeModel := new(vpcv1.InstanceGroupManagerScheduledActionGroupPrototype)
				instanceGroupManagerScheduledActionGroupPrototypeModel.MembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup model
				instanceGroupManagerActionPrototypeModel := new(vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup)
				instanceGroupManagerActionPrototypeModel.Name = core.StringPtr("my-instance-group-manager-action")
				instanceGroupManagerActionPrototypeModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				instanceGroupManagerActionPrototypeModel.Group = instanceGroupManagerScheduledActionGroupPrototypeModel

				// Construct an instance of the CreateInstanceGroupManagerActionOptions model
				createInstanceGroupManagerActionOptionsModel := new(vpcv1.CreateInstanceGroupManagerActionOptions)
				createInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				createInstanceGroupManagerActionOptionsModel.InstanceGroupManagerActionPrototype = instanceGroupManagerActionPrototypeModel
				createInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateInstanceGroupManagerAction(createInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteInstanceGroupManagerAction(deleteInstanceGroupManagerActionOptions *DeleteInstanceGroupManagerActionOptions)`, func() {
		version := "2024-06-23"
		deleteInstanceGroupManagerActionPath := "/instance_groups/testString/managers/testString/actions/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstanceGroupManagerActionPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteInstanceGroupManagerAction successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteInstanceGroupManagerAction(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteInstanceGroupManagerActionOptions model
				deleteInstanceGroupManagerActionOptionsModel := new(vpcv1.DeleteInstanceGroupManagerActionOptions)
				deleteInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				deleteInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				deleteInstanceGroupManagerActionOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteInstanceGroupManagerAction(deleteInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteInstanceGroupManagerAction with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceGroupManagerActionOptions model
				deleteInstanceGroupManagerActionOptionsModel := new(vpcv1.DeleteInstanceGroupManagerActionOptions)
				deleteInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				deleteInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				deleteInstanceGroupManagerActionOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteInstanceGroupManagerAction(deleteInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteInstanceGroupManagerActionOptions model with no property values
				deleteInstanceGroupManagerActionOptionsModelNew := new(vpcv1.DeleteInstanceGroupManagerActionOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteInstanceGroupManagerAction(deleteInstanceGroupManagerActionOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceGroupManagerAction(getInstanceGroupManagerActionOptions *GetInstanceGroupManagerActionOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceGroupManagerActionPath := "/instance_groups/testString/managers/testString/actions/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupManagerActionPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceGroupManagerAction with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupManagerActionOptions model
				getInstanceGroupManagerActionOptionsModel := new(vpcv1.GetInstanceGroupManagerActionOptions)
				getInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceGroupManagerAction(getInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceGroupManagerAction(getInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceGroupManagerAction(getInstanceGroupManagerActionOptions *GetInstanceGroupManagerActionOptions)`, func() {
		version := "2024-06-23"
		getInstanceGroupManagerActionPath := "/instance_groups/testString/managers/testString/actions/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupManagerActionPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/actions/r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "id": "r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}`)
				}))
			})
			It(`Invoke GetInstanceGroupManagerAction successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceGroupManagerActionOptions model
				getInstanceGroupManagerActionOptionsModel := new(vpcv1.GetInstanceGroupManagerActionOptions)
				getInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceGroupManagerActionWithContext(ctx, getInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceGroupManagerAction(getInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceGroupManagerActionWithContext(ctx, getInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupManagerActionPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/actions/r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "id": "r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}`)
				}))
			})
			It(`Invoke GetInstanceGroupManagerAction successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceGroupManagerAction(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceGroupManagerActionOptions model
				getInstanceGroupManagerActionOptionsModel := new(vpcv1.GetInstanceGroupManagerActionOptions)
				getInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceGroupManagerAction(getInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceGroupManagerAction with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupManagerActionOptions model
				getInstanceGroupManagerActionOptionsModel := new(vpcv1.GetInstanceGroupManagerActionOptions)
				getInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceGroupManagerAction(getInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceGroupManagerActionOptions model with no property values
				getInstanceGroupManagerActionOptionsModelNew := new(vpcv1.GetInstanceGroupManagerActionOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceGroupManagerAction(getInstanceGroupManagerActionOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceGroupManagerAction successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupManagerActionOptions model
				getInstanceGroupManagerActionOptionsModel := new(vpcv1.GetInstanceGroupManagerActionOptions)
				getInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceGroupManagerAction(getInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptions *UpdateInstanceGroupManagerActionOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateInstanceGroupManagerActionPath := "/instance_groups/testString/managers/testString/actions/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupManagerActionPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateInstanceGroupManagerAction with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerActionGroupPatch model
				instanceGroupManagerActionGroupPatchModel := new(vpcv1.InstanceGroupManagerActionGroupPatch)
				instanceGroupManagerActionGroupPatchModel.MembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionManagerPatch model
				instanceGroupManagerActionManagerPatchModel := new(vpcv1.InstanceGroupManagerActionManagerPatch)
				instanceGroupManagerActionManagerPatchModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerActionManagerPatchModel.MinMembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionPatch model
				instanceGroupManagerActionPatchModel := new(vpcv1.InstanceGroupManagerActionPatch)
				instanceGroupManagerActionPatchModel.AutoDelete = core.BoolPtr(false)
				instanceGroupManagerActionPatchModel.AutoDeleteTimeout = core.Int64Ptr(int64(24))
				instanceGroupManagerActionPatchModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				instanceGroupManagerActionPatchModel.Group = instanceGroupManagerActionGroupPatchModel
				instanceGroupManagerActionPatchModel.Manager = instanceGroupManagerActionManagerPatchModel
				instanceGroupManagerActionPatchModel.Name = core.StringPtr("my-instance-group-manager-action")
				instanceGroupManagerActionPatchModel.RunAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				instanceGroupManagerActionPatchModelAsPatch, asPatchErr := instanceGroupManagerActionPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerActionOptions model
				updateInstanceGroupManagerActionOptionsModel := new(vpcv1.UpdateInstanceGroupManagerActionOptions)
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupManagerActionPatch = instanceGroupManagerActionPatchModelAsPatch
				updateInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptions *UpdateInstanceGroupManagerActionOptions)`, func() {
		version := "2024-06-23"
		updateInstanceGroupManagerActionPath := "/instance_groups/testString/managers/testString/actions/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupManagerActionPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/actions/r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "id": "r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}`)
				}))
			})
			It(`Invoke UpdateInstanceGroupManagerAction successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceGroupManagerActionGroupPatch model
				instanceGroupManagerActionGroupPatchModel := new(vpcv1.InstanceGroupManagerActionGroupPatch)
				instanceGroupManagerActionGroupPatchModel.MembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionManagerPatch model
				instanceGroupManagerActionManagerPatchModel := new(vpcv1.InstanceGroupManagerActionManagerPatch)
				instanceGroupManagerActionManagerPatchModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerActionManagerPatchModel.MinMembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionPatch model
				instanceGroupManagerActionPatchModel := new(vpcv1.InstanceGroupManagerActionPatch)
				instanceGroupManagerActionPatchModel.AutoDelete = core.BoolPtr(false)
				instanceGroupManagerActionPatchModel.AutoDeleteTimeout = core.Int64Ptr(int64(24))
				instanceGroupManagerActionPatchModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				instanceGroupManagerActionPatchModel.Group = instanceGroupManagerActionGroupPatchModel
				instanceGroupManagerActionPatchModel.Manager = instanceGroupManagerActionManagerPatchModel
				instanceGroupManagerActionPatchModel.Name = core.StringPtr("my-instance-group-manager-action")
				instanceGroupManagerActionPatchModel.RunAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				instanceGroupManagerActionPatchModelAsPatch, asPatchErr := instanceGroupManagerActionPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerActionOptions model
				updateInstanceGroupManagerActionOptionsModel := new(vpcv1.UpdateInstanceGroupManagerActionOptions)
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupManagerActionPatch = instanceGroupManagerActionPatchModelAsPatch
				updateInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateInstanceGroupManagerActionWithContext(ctx, updateInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateInstanceGroupManagerActionWithContext(ctx, updateInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupManagerActionPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/actions/r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "id": "r006-b3fda6cb-6f66-4ab4-a636-100ded91e8d7", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}`)
				}))
			})
			It(`Invoke UpdateInstanceGroupManagerAction successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateInstanceGroupManagerAction(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceGroupManagerActionGroupPatch model
				instanceGroupManagerActionGroupPatchModel := new(vpcv1.InstanceGroupManagerActionGroupPatch)
				instanceGroupManagerActionGroupPatchModel.MembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionManagerPatch model
				instanceGroupManagerActionManagerPatchModel := new(vpcv1.InstanceGroupManagerActionManagerPatch)
				instanceGroupManagerActionManagerPatchModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerActionManagerPatchModel.MinMembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionPatch model
				instanceGroupManagerActionPatchModel := new(vpcv1.InstanceGroupManagerActionPatch)
				instanceGroupManagerActionPatchModel.AutoDelete = core.BoolPtr(false)
				instanceGroupManagerActionPatchModel.AutoDeleteTimeout = core.Int64Ptr(int64(24))
				instanceGroupManagerActionPatchModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				instanceGroupManagerActionPatchModel.Group = instanceGroupManagerActionGroupPatchModel
				instanceGroupManagerActionPatchModel.Manager = instanceGroupManagerActionManagerPatchModel
				instanceGroupManagerActionPatchModel.Name = core.StringPtr("my-instance-group-manager-action")
				instanceGroupManagerActionPatchModel.RunAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				instanceGroupManagerActionPatchModelAsPatch, asPatchErr := instanceGroupManagerActionPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerActionOptions model
				updateInstanceGroupManagerActionOptionsModel := new(vpcv1.UpdateInstanceGroupManagerActionOptions)
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupManagerActionPatch = instanceGroupManagerActionPatchModelAsPatch
				updateInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateInstanceGroupManagerAction with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerActionGroupPatch model
				instanceGroupManagerActionGroupPatchModel := new(vpcv1.InstanceGroupManagerActionGroupPatch)
				instanceGroupManagerActionGroupPatchModel.MembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionManagerPatch model
				instanceGroupManagerActionManagerPatchModel := new(vpcv1.InstanceGroupManagerActionManagerPatch)
				instanceGroupManagerActionManagerPatchModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerActionManagerPatchModel.MinMembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionPatch model
				instanceGroupManagerActionPatchModel := new(vpcv1.InstanceGroupManagerActionPatch)
				instanceGroupManagerActionPatchModel.AutoDelete = core.BoolPtr(false)
				instanceGroupManagerActionPatchModel.AutoDeleteTimeout = core.Int64Ptr(int64(24))
				instanceGroupManagerActionPatchModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				instanceGroupManagerActionPatchModel.Group = instanceGroupManagerActionGroupPatchModel
				instanceGroupManagerActionPatchModel.Manager = instanceGroupManagerActionManagerPatchModel
				instanceGroupManagerActionPatchModel.Name = core.StringPtr("my-instance-group-manager-action")
				instanceGroupManagerActionPatchModel.RunAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				instanceGroupManagerActionPatchModelAsPatch, asPatchErr := instanceGroupManagerActionPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerActionOptions model
				updateInstanceGroupManagerActionOptionsModel := new(vpcv1.UpdateInstanceGroupManagerActionOptions)
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupManagerActionPatch = instanceGroupManagerActionPatchModelAsPatch
				updateInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateInstanceGroupManagerActionOptions model with no property values
				updateInstanceGroupManagerActionOptionsModelNew := new(vpcv1.UpdateInstanceGroupManagerActionOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateInstanceGroupManagerAction successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerActionGroupPatch model
				instanceGroupManagerActionGroupPatchModel := new(vpcv1.InstanceGroupManagerActionGroupPatch)
				instanceGroupManagerActionGroupPatchModel.MembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionManagerPatch model
				instanceGroupManagerActionManagerPatchModel := new(vpcv1.InstanceGroupManagerActionManagerPatch)
				instanceGroupManagerActionManagerPatchModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerActionManagerPatchModel.MinMembershipCount = core.Int64Ptr(int64(10))

				// Construct an instance of the InstanceGroupManagerActionPatch model
				instanceGroupManagerActionPatchModel := new(vpcv1.InstanceGroupManagerActionPatch)
				instanceGroupManagerActionPatchModel.AutoDelete = core.BoolPtr(false)
				instanceGroupManagerActionPatchModel.AutoDeleteTimeout = core.Int64Ptr(int64(24))
				instanceGroupManagerActionPatchModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				instanceGroupManagerActionPatchModel.Group = instanceGroupManagerActionGroupPatchModel
				instanceGroupManagerActionPatchModel.Manager = instanceGroupManagerActionManagerPatchModel
				instanceGroupManagerActionPatchModel.Name = core.StringPtr("my-instance-group-manager-action")
				instanceGroupManagerActionPatchModel.RunAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				instanceGroupManagerActionPatchModelAsPatch, asPatchErr := instanceGroupManagerActionPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerActionOptions model
				updateInstanceGroupManagerActionOptionsModel := new(vpcv1.UpdateInstanceGroupManagerActionOptions)
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerActionOptionsModel.InstanceGroupManagerActionPatch = instanceGroupManagerActionPatchModelAsPatch
				updateInstanceGroupManagerActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptions *ListInstanceGroupManagerPoliciesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstanceGroupManagerPoliciesPath := "/instance_groups/testString/managers/testString/policies"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupManagerPoliciesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstanceGroupManagerPolicies with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupManagerPoliciesOptions model
				listInstanceGroupManagerPoliciesOptionsModel := new(vpcv1.ListInstanceGroupManagerPoliciesOptions)
				listInstanceGroupManagerPoliciesOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagerPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptions *ListInstanceGroupManagerPoliciesOptions)`, func() {
		version := "2024-06-23"
		listInstanceGroupManagerPoliciesPath := "/instance_groups/testString/managers/testString/policies"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupManagerPoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "policies": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 0, "policy_type": "target"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceGroupManagerPolicies successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstanceGroupManagerPoliciesOptions model
				listInstanceGroupManagerPoliciesOptionsModel := new(vpcv1.ListInstanceGroupManagerPoliciesOptions)
				listInstanceGroupManagerPoliciesOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagerPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstanceGroupManagerPoliciesWithContext(ctx, listInstanceGroupManagerPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstanceGroupManagerPoliciesWithContext(ctx, listInstanceGroupManagerPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupManagerPoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "policies": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 0, "policy_type": "target"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceGroupManagerPolicies successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstanceGroupManagerPolicies(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstanceGroupManagerPoliciesOptions model
				listInstanceGroupManagerPoliciesOptionsModel := new(vpcv1.ListInstanceGroupManagerPoliciesOptions)
				listInstanceGroupManagerPoliciesOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagerPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstanceGroupManagerPolicies with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupManagerPoliciesOptions model
				listInstanceGroupManagerPoliciesOptionsModel := new(vpcv1.ListInstanceGroupManagerPoliciesOptions)
				listInstanceGroupManagerPoliciesOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagerPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListInstanceGroupManagerPoliciesOptions model with no property values
				listInstanceGroupManagerPoliciesOptionsModelNew := new(vpcv1.ListInstanceGroupManagerPoliciesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstanceGroupManagerPolicies successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupManagerPoliciesOptions model
				listInstanceGroupManagerPoliciesOptionsModel := new(vpcv1.ListInstanceGroupManagerPoliciesOptions)
				listInstanceGroupManagerPoliciesOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupManagerPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupManagerPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.InstanceGroupManagerPolicyCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.InstanceGroupManagerPolicyCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.InstanceGroupManagerPolicyCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupManagerPoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"policies":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7","id":"r006-ca664290-30eb-4ad7-9fb6-db45731f0be7","name":"my-instance-group-manager-policy","updated_at":"2019-01-01T12:00:00.000Z","metric_type":"cpu","metric_value":0,"policy_type":"target"}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"policies":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7","id":"r006-ca664290-30eb-4ad7-9fb6-db45731f0be7","name":"my-instance-group-manager-policy","updated_at":"2019-01-01T12:00:00.000Z","metric_type":"cpu","metric_value":0,"policy_type":"target"}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use InstanceGroupManagerPoliciesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstanceGroupManagerPoliciesOptionsModel := &vpcv1.ListInstanceGroupManagerPoliciesOptions{
					InstanceGroupID:        core.StringPtr("testString"),
					InstanceGroupManagerID: core.StringPtr("testString"),
					Limit:                  core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewInstanceGroupManagerPoliciesPager(listInstanceGroupManagerPoliciesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.InstanceGroupManagerPolicyIntf
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use InstanceGroupManagerPoliciesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstanceGroupManagerPoliciesOptionsModel := &vpcv1.ListInstanceGroupManagerPoliciesOptions{
					InstanceGroupID:        core.StringPtr("testString"),
					InstanceGroupManagerID: core.StringPtr("testString"),
					Limit:                  core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewInstanceGroupManagerPoliciesPager(listInstanceGroupManagerPoliciesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptions *CreateInstanceGroupManagerPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createInstanceGroupManagerPolicyPath := "/instance_groups/testString/managers/testString/policies"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceGroupManagerPolicyPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateInstanceGroupManagerPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model
				instanceGroupManagerPolicyPrototypeModel := new(vpcv1.InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype)
				instanceGroupManagerPolicyPrototypeModel.Name = core.StringPtr("my-instance-group-manager-policy")
				instanceGroupManagerPolicyPrototypeModel.MetricType = core.StringPtr("cpu")
				instanceGroupManagerPolicyPrototypeModel.MetricValue = core.Int64Ptr(int64(0))
				instanceGroupManagerPolicyPrototypeModel.PolicyType = core.StringPtr("target")

				// Construct an instance of the CreateInstanceGroupManagerPolicyOptions model
				createInstanceGroupManagerPolicyOptionsModel := new(vpcv1.CreateInstanceGroupManagerPolicyOptions)
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerPolicyPrototype = instanceGroupManagerPolicyPrototypeModel
				createInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptions *CreateInstanceGroupManagerPolicyOptions)`, func() {
		version := "2024-06-23"
		createInstanceGroupManagerPolicyPath := "/instance_groups/testString/managers/testString/policies"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceGroupManagerPolicyPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 0, "policy_type": "target"}`)
				}))
			})
			It(`Invoke CreateInstanceGroupManagerPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model
				instanceGroupManagerPolicyPrototypeModel := new(vpcv1.InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype)
				instanceGroupManagerPolicyPrototypeModel.Name = core.StringPtr("my-instance-group-manager-policy")
				instanceGroupManagerPolicyPrototypeModel.MetricType = core.StringPtr("cpu")
				instanceGroupManagerPolicyPrototypeModel.MetricValue = core.Int64Ptr(int64(0))
				instanceGroupManagerPolicyPrototypeModel.PolicyType = core.StringPtr("target")

				// Construct an instance of the CreateInstanceGroupManagerPolicyOptions model
				createInstanceGroupManagerPolicyOptionsModel := new(vpcv1.CreateInstanceGroupManagerPolicyOptions)
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerPolicyPrototype = instanceGroupManagerPolicyPrototypeModel
				createInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateInstanceGroupManagerPolicyWithContext(ctx, createInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateInstanceGroupManagerPolicyWithContext(ctx, createInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceGroupManagerPolicyPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 0, "policy_type": "target"}`)
				}))
			})
			It(`Invoke CreateInstanceGroupManagerPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateInstanceGroupManagerPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model
				instanceGroupManagerPolicyPrototypeModel := new(vpcv1.InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype)
				instanceGroupManagerPolicyPrototypeModel.Name = core.StringPtr("my-instance-group-manager-policy")
				instanceGroupManagerPolicyPrototypeModel.MetricType = core.StringPtr("cpu")
				instanceGroupManagerPolicyPrototypeModel.MetricValue = core.Int64Ptr(int64(0))
				instanceGroupManagerPolicyPrototypeModel.PolicyType = core.StringPtr("target")

				// Construct an instance of the CreateInstanceGroupManagerPolicyOptions model
				createInstanceGroupManagerPolicyOptionsModel := new(vpcv1.CreateInstanceGroupManagerPolicyOptions)
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerPolicyPrototype = instanceGroupManagerPolicyPrototypeModel
				createInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateInstanceGroupManagerPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model
				instanceGroupManagerPolicyPrototypeModel := new(vpcv1.InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype)
				instanceGroupManagerPolicyPrototypeModel.Name = core.StringPtr("my-instance-group-manager-policy")
				instanceGroupManagerPolicyPrototypeModel.MetricType = core.StringPtr("cpu")
				instanceGroupManagerPolicyPrototypeModel.MetricValue = core.Int64Ptr(int64(0))
				instanceGroupManagerPolicyPrototypeModel.PolicyType = core.StringPtr("target")

				// Construct an instance of the CreateInstanceGroupManagerPolicyOptions model
				createInstanceGroupManagerPolicyOptionsModel := new(vpcv1.CreateInstanceGroupManagerPolicyOptions)
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerPolicyPrototype = instanceGroupManagerPolicyPrototypeModel
				createInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateInstanceGroupManagerPolicyOptions model with no property values
				createInstanceGroupManagerPolicyOptionsModelNew := new(vpcv1.CreateInstanceGroupManagerPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateInstanceGroupManagerPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model
				instanceGroupManagerPolicyPrototypeModel := new(vpcv1.InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype)
				instanceGroupManagerPolicyPrototypeModel.Name = core.StringPtr("my-instance-group-manager-policy")
				instanceGroupManagerPolicyPrototypeModel.MetricType = core.StringPtr("cpu")
				instanceGroupManagerPolicyPrototypeModel.MetricValue = core.Int64Ptr(int64(0))
				instanceGroupManagerPolicyPrototypeModel.PolicyType = core.StringPtr("target")

				// Construct an instance of the CreateInstanceGroupManagerPolicyOptions model
				createInstanceGroupManagerPolicyOptionsModel := new(vpcv1.CreateInstanceGroupManagerPolicyOptions)
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				createInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerPolicyPrototype = instanceGroupManagerPolicyPrototypeModel
				createInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteInstanceGroupManagerPolicy(deleteInstanceGroupManagerPolicyOptions *DeleteInstanceGroupManagerPolicyOptions)`, func() {
		version := "2024-06-23"
		deleteInstanceGroupManagerPolicyPath := "/instance_groups/testString/managers/testString/policies/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstanceGroupManagerPolicyPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteInstanceGroupManagerPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteInstanceGroupManagerPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteInstanceGroupManagerPolicyOptions model
				deleteInstanceGroupManagerPolicyOptionsModel := new(vpcv1.DeleteInstanceGroupManagerPolicyOptions)
				deleteInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				deleteInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				deleteInstanceGroupManagerPolicyOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteInstanceGroupManagerPolicy(deleteInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteInstanceGroupManagerPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceGroupManagerPolicyOptions model
				deleteInstanceGroupManagerPolicyOptionsModel := new(vpcv1.DeleteInstanceGroupManagerPolicyOptions)
				deleteInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				deleteInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				deleteInstanceGroupManagerPolicyOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteInstanceGroupManagerPolicy(deleteInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteInstanceGroupManagerPolicyOptions model with no property values
				deleteInstanceGroupManagerPolicyOptionsModelNew := new(vpcv1.DeleteInstanceGroupManagerPolicyOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteInstanceGroupManagerPolicy(deleteInstanceGroupManagerPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceGroupManagerPolicy(getInstanceGroupManagerPolicyOptions *GetInstanceGroupManagerPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceGroupManagerPolicyPath := "/instance_groups/testString/managers/testString/policies/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupManagerPolicyPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceGroupManagerPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupManagerPolicyOptions model
				getInstanceGroupManagerPolicyOptionsModel := new(vpcv1.GetInstanceGroupManagerPolicyOptions)
				getInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceGroupManagerPolicy(getInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceGroupManagerPolicy(getInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceGroupManagerPolicy(getInstanceGroupManagerPolicyOptions *GetInstanceGroupManagerPolicyOptions)`, func() {
		version := "2024-06-23"
		getInstanceGroupManagerPolicyPath := "/instance_groups/testString/managers/testString/policies/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupManagerPolicyPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 0, "policy_type": "target"}`)
				}))
			})
			It(`Invoke GetInstanceGroupManagerPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceGroupManagerPolicyOptions model
				getInstanceGroupManagerPolicyOptionsModel := new(vpcv1.GetInstanceGroupManagerPolicyOptions)
				getInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceGroupManagerPolicyWithContext(ctx, getInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceGroupManagerPolicy(getInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceGroupManagerPolicyWithContext(ctx, getInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupManagerPolicyPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 0, "policy_type": "target"}`)
				}))
			})
			It(`Invoke GetInstanceGroupManagerPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceGroupManagerPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceGroupManagerPolicyOptions model
				getInstanceGroupManagerPolicyOptionsModel := new(vpcv1.GetInstanceGroupManagerPolicyOptions)
				getInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceGroupManagerPolicy(getInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceGroupManagerPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupManagerPolicyOptions model
				getInstanceGroupManagerPolicyOptionsModel := new(vpcv1.GetInstanceGroupManagerPolicyOptions)
				getInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceGroupManagerPolicy(getInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceGroupManagerPolicyOptions model with no property values
				getInstanceGroupManagerPolicyOptionsModelNew := new(vpcv1.GetInstanceGroupManagerPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceGroupManagerPolicy(getInstanceGroupManagerPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceGroupManagerPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupManagerPolicyOptions model
				getInstanceGroupManagerPolicyOptionsModel := new(vpcv1.GetInstanceGroupManagerPolicyOptions)
				getInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceGroupManagerPolicy(getInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptions *UpdateInstanceGroupManagerPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateInstanceGroupManagerPolicyPath := "/instance_groups/testString/managers/testString/policies/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupManagerPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateInstanceGroupManagerPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerPolicyPatch model
				instanceGroupManagerPolicyPatchModel := new(vpcv1.InstanceGroupManagerPolicyPatch)
				instanceGroupManagerPolicyPatchModel.MetricType = core.StringPtr("cpu")
				instanceGroupManagerPolicyPatchModel.MetricValue = core.Int64Ptr(int64(75))
				instanceGroupManagerPolicyPatchModel.Name = core.StringPtr("my-instance-group-manager-policy")
				instanceGroupManagerPolicyPatchModelAsPatch, asPatchErr := instanceGroupManagerPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerPolicyOptions model
				updateInstanceGroupManagerPolicyOptionsModel := new(vpcv1.UpdateInstanceGroupManagerPolicyOptions)
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerPolicyPatch = instanceGroupManagerPolicyPatchModelAsPatch
				updateInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptions *UpdateInstanceGroupManagerPolicyOptions)`, func() {
		version := "2024-06-23"
		updateInstanceGroupManagerPolicyPath := "/instance_groups/testString/managers/testString/policies/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupManagerPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 0, "policy_type": "target"}`)
				}))
			})
			It(`Invoke UpdateInstanceGroupManagerPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceGroupManagerPolicyPatch model
				instanceGroupManagerPolicyPatchModel := new(vpcv1.InstanceGroupManagerPolicyPatch)
				instanceGroupManagerPolicyPatchModel.MetricType = core.StringPtr("cpu")
				instanceGroupManagerPolicyPatchModel.MetricValue = core.Int64Ptr(int64(75))
				instanceGroupManagerPolicyPatchModel.Name = core.StringPtr("my-instance-group-manager-policy")
				instanceGroupManagerPolicyPatchModelAsPatch, asPatchErr := instanceGroupManagerPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerPolicyOptions model
				updateInstanceGroupManagerPolicyOptionsModel := new(vpcv1.UpdateInstanceGroupManagerPolicyOptions)
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerPolicyPatch = instanceGroupManagerPolicyPatchModelAsPatch
				updateInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateInstanceGroupManagerPolicyWithContext(ctx, updateInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateInstanceGroupManagerPolicyWithContext(ctx, updateInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupManagerPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea/policies/r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "id": "r006-ca664290-30eb-4ad7-9fb6-db45731f0be7", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 0, "policy_type": "target"}`)
				}))
			})
			It(`Invoke UpdateInstanceGroupManagerPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateInstanceGroupManagerPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceGroupManagerPolicyPatch model
				instanceGroupManagerPolicyPatchModel := new(vpcv1.InstanceGroupManagerPolicyPatch)
				instanceGroupManagerPolicyPatchModel.MetricType = core.StringPtr("cpu")
				instanceGroupManagerPolicyPatchModel.MetricValue = core.Int64Ptr(int64(75))
				instanceGroupManagerPolicyPatchModel.Name = core.StringPtr("my-instance-group-manager-policy")
				instanceGroupManagerPolicyPatchModelAsPatch, asPatchErr := instanceGroupManagerPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerPolicyOptions model
				updateInstanceGroupManagerPolicyOptionsModel := new(vpcv1.UpdateInstanceGroupManagerPolicyOptions)
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerPolicyPatch = instanceGroupManagerPolicyPatchModelAsPatch
				updateInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateInstanceGroupManagerPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerPolicyPatch model
				instanceGroupManagerPolicyPatchModel := new(vpcv1.InstanceGroupManagerPolicyPatch)
				instanceGroupManagerPolicyPatchModel.MetricType = core.StringPtr("cpu")
				instanceGroupManagerPolicyPatchModel.MetricValue = core.Int64Ptr(int64(75))
				instanceGroupManagerPolicyPatchModel.Name = core.StringPtr("my-instance-group-manager-policy")
				instanceGroupManagerPolicyPatchModelAsPatch, asPatchErr := instanceGroupManagerPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerPolicyOptions model
				updateInstanceGroupManagerPolicyOptionsModel := new(vpcv1.UpdateInstanceGroupManagerPolicyOptions)
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerPolicyPatch = instanceGroupManagerPolicyPatchModelAsPatch
				updateInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateInstanceGroupManagerPolicyOptions model with no property values
				updateInstanceGroupManagerPolicyOptionsModelNew := new(vpcv1.UpdateInstanceGroupManagerPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateInstanceGroupManagerPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupManagerPolicyPatch model
				instanceGroupManagerPolicyPatchModel := new(vpcv1.InstanceGroupManagerPolicyPatch)
				instanceGroupManagerPolicyPatchModel.MetricType = core.StringPtr("cpu")
				instanceGroupManagerPolicyPatchModel.MetricValue = core.Int64Ptr(int64(75))
				instanceGroupManagerPolicyPatchModel.Name = core.StringPtr("my-instance-group-manager-policy")
				instanceGroupManagerPolicyPatchModelAsPatch, asPatchErr := instanceGroupManagerPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupManagerPolicyOptions model
				updateInstanceGroupManagerPolicyOptionsModel := new(vpcv1.UpdateInstanceGroupManagerPolicyOptions)
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerPolicyPatch = instanceGroupManagerPolicyPatchModelAsPatch
				updateInstanceGroupManagerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteInstanceGroupMemberships(deleteInstanceGroupMembershipsOptions *DeleteInstanceGroupMembershipsOptions)`, func() {
		version := "2024-06-23"
		deleteInstanceGroupMembershipsPath := "/instance_groups/testString/memberships"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstanceGroupMembershipsPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteInstanceGroupMemberships successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteInstanceGroupMemberships(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteInstanceGroupMembershipsOptions model
				deleteInstanceGroupMembershipsOptionsModel := new(vpcv1.DeleteInstanceGroupMembershipsOptions)
				deleteInstanceGroupMembershipsOptionsModel.InstanceGroupID = core.StringPtr("testString")
				deleteInstanceGroupMembershipsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteInstanceGroupMemberships(deleteInstanceGroupMembershipsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteInstanceGroupMemberships with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceGroupMembershipsOptions model
				deleteInstanceGroupMembershipsOptionsModel := new(vpcv1.DeleteInstanceGroupMembershipsOptions)
				deleteInstanceGroupMembershipsOptionsModel.InstanceGroupID = core.StringPtr("testString")
				deleteInstanceGroupMembershipsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteInstanceGroupMemberships(deleteInstanceGroupMembershipsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteInstanceGroupMembershipsOptions model with no property values
				deleteInstanceGroupMembershipsOptionsModelNew := new(vpcv1.DeleteInstanceGroupMembershipsOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteInstanceGroupMemberships(deleteInstanceGroupMembershipsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceGroupMemberships(listInstanceGroupMembershipsOptions *ListInstanceGroupMembershipsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstanceGroupMembershipsPath := "/instance_groups/testString/memberships"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupMembershipsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstanceGroupMemberships with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupMembershipsOptions model
				listInstanceGroupMembershipsOptionsModel := new(vpcv1.ListInstanceGroupMembershipsOptions)
				listInstanceGroupMembershipsOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupMembershipsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupMembershipsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupMembershipsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstanceGroupMemberships(listInstanceGroupMembershipsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstanceGroupMemberships(listInstanceGroupMembershipsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceGroupMemberships(listInstanceGroupMembershipsOptions *ListInstanceGroupMembershipsOptions)`, func() {
		version := "2024-06-23"
		listInstanceGroupMembershipsPath := "/instance_groups/testString/memberships"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupMembershipsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "memberships": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "id": "r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}], "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceGroupMemberships successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstanceGroupMembershipsOptions model
				listInstanceGroupMembershipsOptionsModel := new(vpcv1.ListInstanceGroupMembershipsOptions)
				listInstanceGroupMembershipsOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupMembershipsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupMembershipsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupMembershipsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstanceGroupMembershipsWithContext(ctx, listInstanceGroupMembershipsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstanceGroupMemberships(listInstanceGroupMembershipsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstanceGroupMembershipsWithContext(ctx, listInstanceGroupMembershipsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupMembershipsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "memberships": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "id": "r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}], "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceGroupMemberships successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstanceGroupMemberships(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstanceGroupMembershipsOptions model
				listInstanceGroupMembershipsOptionsModel := new(vpcv1.ListInstanceGroupMembershipsOptions)
				listInstanceGroupMembershipsOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupMembershipsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupMembershipsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupMembershipsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstanceGroupMemberships(listInstanceGroupMembershipsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstanceGroupMemberships with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupMembershipsOptions model
				listInstanceGroupMembershipsOptionsModel := new(vpcv1.ListInstanceGroupMembershipsOptions)
				listInstanceGroupMembershipsOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupMembershipsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupMembershipsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupMembershipsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstanceGroupMemberships(listInstanceGroupMembershipsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListInstanceGroupMembershipsOptions model with no property values
				listInstanceGroupMembershipsOptionsModelNew := new(vpcv1.ListInstanceGroupMembershipsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListInstanceGroupMemberships(listInstanceGroupMembershipsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstanceGroupMemberships successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceGroupMembershipsOptions model
				listInstanceGroupMembershipsOptionsModel := new(vpcv1.ListInstanceGroupMembershipsOptions)
				listInstanceGroupMembershipsOptionsModel.InstanceGroupID = core.StringPtr("testString")
				listInstanceGroupMembershipsOptionsModel.Start = core.StringPtr("testString")
				listInstanceGroupMembershipsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceGroupMembershipsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstanceGroupMemberships(listInstanceGroupMembershipsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.InstanceGroupMembershipCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.InstanceGroupMembershipCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.InstanceGroupMembershipCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceGroupMembershipsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"memberships":[{"created_at":"2019-01-01T12:00:00.000Z","delete_instance_on_membership_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741","id":"r006-32c8210b-fd1a-409f-8966-de85bbfd3741","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"},"instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2","id":"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2","name":"my-instance-template"},"name":"my-instance-group-membership","pool_member":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a","id":"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"},"status":"deleting","updated_at":"2019-01-01T12:00:00.000Z"}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"memberships":[{"created_at":"2019-01-01T12:00:00.000Z","delete_instance_on_membership_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741","id":"r006-32c8210b-fd1a-409f-8966-de85bbfd3741","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"},"instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2","id":"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2","name":"my-instance-template"},"name":"my-instance-group-membership","pool_member":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a","id":"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"},"status":"deleting","updated_at":"2019-01-01T12:00:00.000Z"}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use InstanceGroupMembershipsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstanceGroupMembershipsOptionsModel := &vpcv1.ListInstanceGroupMembershipsOptions{
					InstanceGroupID: core.StringPtr("testString"),
					Limit:           core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewInstanceGroupMembershipsPager(listInstanceGroupMembershipsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.InstanceGroupMembership
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use InstanceGroupMembershipsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstanceGroupMembershipsOptionsModel := &vpcv1.ListInstanceGroupMembershipsOptions{
					InstanceGroupID: core.StringPtr("testString"),
					Limit:           core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewInstanceGroupMembershipsPager(listInstanceGroupMembershipsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`DeleteInstanceGroupMembership(deleteInstanceGroupMembershipOptions *DeleteInstanceGroupMembershipOptions)`, func() {
		version := "2024-06-23"
		deleteInstanceGroupMembershipPath := "/instance_groups/testString/memberships/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstanceGroupMembershipPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteInstanceGroupMembership successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteInstanceGroupMembership(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteInstanceGroupMembershipOptions model
				deleteInstanceGroupMembershipOptionsModel := new(vpcv1.DeleteInstanceGroupMembershipOptions)
				deleteInstanceGroupMembershipOptionsModel.InstanceGroupID = core.StringPtr("testString")
				deleteInstanceGroupMembershipOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceGroupMembershipOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteInstanceGroupMembership(deleteInstanceGroupMembershipOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteInstanceGroupMembership with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceGroupMembershipOptions model
				deleteInstanceGroupMembershipOptionsModel := new(vpcv1.DeleteInstanceGroupMembershipOptions)
				deleteInstanceGroupMembershipOptionsModel.InstanceGroupID = core.StringPtr("testString")
				deleteInstanceGroupMembershipOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceGroupMembershipOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteInstanceGroupMembership(deleteInstanceGroupMembershipOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteInstanceGroupMembershipOptions model with no property values
				deleteInstanceGroupMembershipOptionsModelNew := new(vpcv1.DeleteInstanceGroupMembershipOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteInstanceGroupMembership(deleteInstanceGroupMembershipOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceGroupMembership(getInstanceGroupMembershipOptions *GetInstanceGroupMembershipOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceGroupMembershipPath := "/instance_groups/testString/memberships/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupMembershipPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceGroupMembership with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupMembershipOptions model
				getInstanceGroupMembershipOptionsModel := new(vpcv1.GetInstanceGroupMembershipOptions)
				getInstanceGroupMembershipOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupMembershipOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupMembershipOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceGroupMembership(getInstanceGroupMembershipOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceGroupMembership(getInstanceGroupMembershipOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceGroupMembership(getInstanceGroupMembershipOptions *GetInstanceGroupMembershipOptions)`, func() {
		version := "2024-06-23"
		getInstanceGroupMembershipPath := "/instance_groups/testString/memberships/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupMembershipPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "id": "r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}`)
				}))
			})
			It(`Invoke GetInstanceGroupMembership successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceGroupMembershipOptions model
				getInstanceGroupMembershipOptionsModel := new(vpcv1.GetInstanceGroupMembershipOptions)
				getInstanceGroupMembershipOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupMembershipOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupMembershipOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceGroupMembershipWithContext(ctx, getInstanceGroupMembershipOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceGroupMembership(getInstanceGroupMembershipOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceGroupMembershipWithContext(ctx, getInstanceGroupMembershipOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceGroupMembershipPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "id": "r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}`)
				}))
			})
			It(`Invoke GetInstanceGroupMembership successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceGroupMembership(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceGroupMembershipOptions model
				getInstanceGroupMembershipOptionsModel := new(vpcv1.GetInstanceGroupMembershipOptions)
				getInstanceGroupMembershipOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupMembershipOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupMembershipOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceGroupMembership(getInstanceGroupMembershipOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceGroupMembership with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupMembershipOptions model
				getInstanceGroupMembershipOptionsModel := new(vpcv1.GetInstanceGroupMembershipOptions)
				getInstanceGroupMembershipOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupMembershipOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupMembershipOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceGroupMembership(getInstanceGroupMembershipOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceGroupMembershipOptions model with no property values
				getInstanceGroupMembershipOptionsModelNew := new(vpcv1.GetInstanceGroupMembershipOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceGroupMembership(getInstanceGroupMembershipOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceGroupMembership successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceGroupMembershipOptions model
				getInstanceGroupMembershipOptionsModel := new(vpcv1.GetInstanceGroupMembershipOptions)
				getInstanceGroupMembershipOptionsModel.InstanceGroupID = core.StringPtr("testString")
				getInstanceGroupMembershipOptionsModel.ID = core.StringPtr("testString")
				getInstanceGroupMembershipOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceGroupMembership(getInstanceGroupMembershipOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceGroupMembership(updateInstanceGroupMembershipOptions *UpdateInstanceGroupMembershipOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateInstanceGroupMembershipPath := "/instance_groups/testString/memberships/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupMembershipPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateInstanceGroupMembership with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupMembershipPatch model
				instanceGroupMembershipPatchModel := new(vpcv1.InstanceGroupMembershipPatch)
				instanceGroupMembershipPatchModel.DeleteInstanceOnMembershipDelete = core.BoolPtr(false)
				instanceGroupMembershipPatchModel.Name = core.StringPtr("my-instance-group-membership")
				instanceGroupMembershipPatchModelAsPatch, asPatchErr := instanceGroupMembershipPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupMembershipOptions model
				updateInstanceGroupMembershipOptionsModel := new(vpcv1.UpdateInstanceGroupMembershipOptions)
				updateInstanceGroupMembershipOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupMembershipOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupMembershipOptionsModel.InstanceGroupMembershipPatch = instanceGroupMembershipPatchModelAsPatch
				updateInstanceGroupMembershipOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateInstanceGroupMembership(updateInstanceGroupMembershipOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateInstanceGroupMembership(updateInstanceGroupMembershipOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceGroupMembership(updateInstanceGroupMembershipOptions *UpdateInstanceGroupMembershipOptions)`, func() {
		version := "2024-06-23"
		updateInstanceGroupMembershipPath := "/instance_groups/testString/memberships/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupMembershipPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "id": "r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}`)
				}))
			})
			It(`Invoke UpdateInstanceGroupMembership successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceGroupMembershipPatch model
				instanceGroupMembershipPatchModel := new(vpcv1.InstanceGroupMembershipPatch)
				instanceGroupMembershipPatchModel.DeleteInstanceOnMembershipDelete = core.BoolPtr(false)
				instanceGroupMembershipPatchModel.Name = core.StringPtr("my-instance-group-membership")
				instanceGroupMembershipPatchModelAsPatch, asPatchErr := instanceGroupMembershipPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupMembershipOptions model
				updateInstanceGroupMembershipOptionsModel := new(vpcv1.UpdateInstanceGroupMembershipOptions)
				updateInstanceGroupMembershipOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupMembershipOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupMembershipOptionsModel.InstanceGroupMembershipPatch = instanceGroupMembershipPatchModelAsPatch
				updateInstanceGroupMembershipOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateInstanceGroupMembershipWithContext(ctx, updateInstanceGroupMembershipOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateInstanceGroupMembership(updateInstanceGroupMembershipOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateInstanceGroupMembershipWithContext(ctx, updateInstanceGroupMembershipOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceGroupMembershipPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "id": "r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}`)
				}))
			})
			It(`Invoke UpdateInstanceGroupMembership successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateInstanceGroupMembership(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceGroupMembershipPatch model
				instanceGroupMembershipPatchModel := new(vpcv1.InstanceGroupMembershipPatch)
				instanceGroupMembershipPatchModel.DeleteInstanceOnMembershipDelete = core.BoolPtr(false)
				instanceGroupMembershipPatchModel.Name = core.StringPtr("my-instance-group-membership")
				instanceGroupMembershipPatchModelAsPatch, asPatchErr := instanceGroupMembershipPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupMembershipOptions model
				updateInstanceGroupMembershipOptionsModel := new(vpcv1.UpdateInstanceGroupMembershipOptions)
				updateInstanceGroupMembershipOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupMembershipOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupMembershipOptionsModel.InstanceGroupMembershipPatch = instanceGroupMembershipPatchModelAsPatch
				updateInstanceGroupMembershipOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateInstanceGroupMembership(updateInstanceGroupMembershipOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateInstanceGroupMembership with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupMembershipPatch model
				instanceGroupMembershipPatchModel := new(vpcv1.InstanceGroupMembershipPatch)
				instanceGroupMembershipPatchModel.DeleteInstanceOnMembershipDelete = core.BoolPtr(false)
				instanceGroupMembershipPatchModel.Name = core.StringPtr("my-instance-group-membership")
				instanceGroupMembershipPatchModelAsPatch, asPatchErr := instanceGroupMembershipPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupMembershipOptions model
				updateInstanceGroupMembershipOptionsModel := new(vpcv1.UpdateInstanceGroupMembershipOptions)
				updateInstanceGroupMembershipOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupMembershipOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupMembershipOptionsModel.InstanceGroupMembershipPatch = instanceGroupMembershipPatchModelAsPatch
				updateInstanceGroupMembershipOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateInstanceGroupMembership(updateInstanceGroupMembershipOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateInstanceGroupMembershipOptions model with no property values
				updateInstanceGroupMembershipOptionsModelNew := new(vpcv1.UpdateInstanceGroupMembershipOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateInstanceGroupMembership(updateInstanceGroupMembershipOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateInstanceGroupMembership successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceGroupMembershipPatch model
				instanceGroupMembershipPatchModel := new(vpcv1.InstanceGroupMembershipPatch)
				instanceGroupMembershipPatchModel.DeleteInstanceOnMembershipDelete = core.BoolPtr(false)
				instanceGroupMembershipPatchModel.Name = core.StringPtr("my-instance-group-membership")
				instanceGroupMembershipPatchModelAsPatch, asPatchErr := instanceGroupMembershipPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceGroupMembershipOptions model
				updateInstanceGroupMembershipOptionsModel := new(vpcv1.UpdateInstanceGroupMembershipOptions)
				updateInstanceGroupMembershipOptionsModel.InstanceGroupID = core.StringPtr("testString")
				updateInstanceGroupMembershipOptionsModel.ID = core.StringPtr("testString")
				updateInstanceGroupMembershipOptionsModel.InstanceGroupMembershipPatch = instanceGroupMembershipPatchModelAsPatch
				updateInstanceGroupMembershipOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateInstanceGroupMembership(updateInstanceGroupMembershipOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceTemplates(listInstanceTemplatesOptions *ListInstanceTemplatesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstanceTemplatesPath := "/instance/templates"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceTemplatesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstanceTemplates with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceTemplatesOptions model
				listInstanceTemplatesOptionsModel := new(vpcv1.ListInstanceTemplatesOptions)
				listInstanceTemplatesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstanceTemplates(listInstanceTemplatesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstanceTemplates(listInstanceTemplatesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceTemplates(listInstanceTemplatesOptions *ListInstanceTemplatesOptions)`, func() {
		version := "2024-06-23"
		listInstanceTemplatesPath := "/instance/templates"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceTemplatesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "templates": [{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "automatic", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "UserData", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "bandwidth": 1000, "capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["UserTags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceTemplates successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstanceTemplatesOptions model
				listInstanceTemplatesOptionsModel := new(vpcv1.ListInstanceTemplatesOptions)
				listInstanceTemplatesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstanceTemplatesWithContext(ctx, listInstanceTemplatesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstanceTemplates(listInstanceTemplatesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstanceTemplatesWithContext(ctx, listInstanceTemplatesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceTemplatesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "templates": [{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "automatic", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "UserData", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "bandwidth": 1000, "capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["UserTags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceTemplates successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstanceTemplates(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstanceTemplatesOptions model
				listInstanceTemplatesOptionsModel := new(vpcv1.ListInstanceTemplatesOptions)
				listInstanceTemplatesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstanceTemplates(listInstanceTemplatesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstanceTemplates with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceTemplatesOptions model
				listInstanceTemplatesOptionsModel := new(vpcv1.ListInstanceTemplatesOptions)
				listInstanceTemplatesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstanceTemplates(listInstanceTemplatesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstanceTemplates successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceTemplatesOptions model
				listInstanceTemplatesOptionsModel := new(vpcv1.ListInstanceTemplatesOptions)
				listInstanceTemplatesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstanceTemplates(listInstanceTemplatesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceTemplate(createInstanceTemplateOptions *CreateInstanceTemplateOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createInstanceTemplatePath := "/instance/templates"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceTemplatePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateInstanceTemplate with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceAvailabilityPolicyPrototype model
				instanceAvailabilityPolicyPrototypeModel := new(vpcv1.InstanceAvailabilityPolicyPrototype)
				instanceAvailabilityPolicyPrototypeModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext)
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.Name = core.StringPtr("my-instance-network-attachment")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the InstanceDefaultTrustedProfilePrototype model
				instanceDefaultTrustedProfilePrototypeModel := new(vpcv1.InstanceDefaultTrustedProfilePrototype)
				instanceDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				instanceDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the InstanceMetadataServicePrototype model
				instanceMetadataServicePrototypeModel := new(vpcv1.InstanceMetadataServicePrototype)
				instanceMetadataServicePrototypeModel.Enabled = core.BoolPtr(false)
				instanceMetadataServicePrototypeModel.Protocol = core.StringPtr("https")
				instanceMetadataServicePrototypeModel.ResponseHopLimit = core.Int64Ptr(int64(2))

				// Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPrototypeModel := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPrototypeModel.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

				// Construct an instance of the InstanceProfileIdentityByName model
				instanceProfileIdentityModel := new(vpcv1.InstanceProfileIdentityByName)
				instanceProfileIdentityModel.Name = core.StringPtr("bx2-4x16")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPrototype model
				instanceReservationAffinityPrototypeModel := new(vpcv1.InstanceReservationAffinityPrototype)
				instanceReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID)
				volumeAttachmentPrototypeVolumeModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the VolumeAttachmentPrototype model
				volumeAttachmentPrototypeModel := new(vpcv1.VolumeAttachmentPrototype)
				volumeAttachmentPrototypeModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				volumeAttachmentPrototypeModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeModel.Volume = volumeAttachmentPrototypeVolumeModel

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VolumeAllowedUsePrototype model
				volumeAllowedUsePrototypeModel := new(vpcv1.VolumeAllowedUsePrototype)
				volumeAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("general-purpose")

				// Construct an instance of the VolumePrototypeInstanceByImageContext model
				volumePrototypeInstanceByImageContextModel := new(vpcv1.VolumePrototypeInstanceByImageContext)
				volumePrototypeInstanceByImageContextModel.AllowedUse = volumeAllowedUsePrototypeModel
				volumePrototypeInstanceByImageContextModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeInstanceByImageContextModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeInstanceByImageContextModel.EncryptionKey = encryptionKeyIdentityModel
				volumePrototypeInstanceByImageContextModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeInstanceByImageContextModel.Name = core.StringPtr("my-boot-volume")
				volumePrototypeInstanceByImageContextModel.Profile = volumeProfileIdentityModel
				volumePrototypeInstanceByImageContextModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeInstanceByImageContextModel.UserTags = []string{}

				// Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model
				volumeAttachmentPrototypeInstanceByImageContextModel := new(vpcv1.VolumeAttachmentPrototypeInstanceByImageContext)
				volumeAttachmentPrototypeInstanceByImageContextModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPrototypeInstanceByImageContextModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeInstanceByImageContextModel.Volume = volumePrototypeInstanceByImageContextModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the InstanceNetworkAttachmentPrototype model
				instanceNetworkAttachmentPrototypeModel := new(vpcv1.InstanceNetworkAttachmentPrototype)
				instanceNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-instance-network-attachment")
				instanceNetworkAttachmentPrototypeModel.VirtualNetworkInterface = instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel

				// Construct an instance of the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment model
				instanceTemplatePrototypeModel := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment)
				instanceTemplatePrototypeModel.AvailabilityPolicy = instanceAvailabilityPolicyPrototypeModel
				instanceTemplatePrototypeModel.ClusterNetworkAttachments = []vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext{*instanceClusterNetworkAttachmentPrototypeInstanceContextModel}
				instanceTemplatePrototypeModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instanceTemplatePrototypeModel.DefaultTrustedProfile = instanceDefaultTrustedProfilePrototypeModel
				instanceTemplatePrototypeModel.EnableSecureBoot = core.BoolPtr(true)
				instanceTemplatePrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				instanceTemplatePrototypeModel.MetadataService = instanceMetadataServicePrototypeModel
				instanceTemplatePrototypeModel.Name = core.StringPtr("my-instance")
				instanceTemplatePrototypeModel.PlacementTarget = instancePlacementTargetPrototypeModel
				instanceTemplatePrototypeModel.Profile = instanceProfileIdentityModel
				instanceTemplatePrototypeModel.ReservationAffinity = instanceReservationAffinityPrototypeModel
				instanceTemplatePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				instanceTemplatePrototypeModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instanceTemplatePrototypeModel.UserData = core.StringPtr("testString")
				instanceTemplatePrototypeModel.VolumeAttachments = []vpcv1.VolumeAttachmentPrototype{*volumeAttachmentPrototypeModel}
				instanceTemplatePrototypeModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instanceTemplatePrototypeModel.VPC = vpcIdentityModel
				instanceTemplatePrototypeModel.BootVolumeAttachment = volumeAttachmentPrototypeInstanceByImageContextModel
				instanceTemplatePrototypeModel.Image = imageIdentityModel
				instanceTemplatePrototypeModel.Zone = zoneIdentityModel
				instanceTemplatePrototypeModel.NetworkAttachments = []vpcv1.InstanceNetworkAttachmentPrototype{*instanceNetworkAttachmentPrototypeModel}
				instanceTemplatePrototypeModel.PrimaryNetworkAttachment = instanceNetworkAttachmentPrototypeModel

				// Construct an instance of the CreateInstanceTemplateOptions model
				createInstanceTemplateOptionsModel := new(vpcv1.CreateInstanceTemplateOptions)
				createInstanceTemplateOptionsModel.InstanceTemplatePrototype = instanceTemplatePrototypeModel
				createInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateInstanceTemplate(createInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateInstanceTemplate(createInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceTemplate(createInstanceTemplateOptions *CreateInstanceTemplateOptions)`, func() {
		version := "2024-06-23"
		createInstanceTemplatePath := "/instance/templates"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceTemplatePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "automatic", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "UserData", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "bandwidth": 1000, "capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["UserTags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}`)
				}))
			})
			It(`Invoke CreateInstanceTemplate successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceAvailabilityPolicyPrototype model
				instanceAvailabilityPolicyPrototypeModel := new(vpcv1.InstanceAvailabilityPolicyPrototype)
				instanceAvailabilityPolicyPrototypeModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext)
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.Name = core.StringPtr("my-instance-network-attachment")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the InstanceDefaultTrustedProfilePrototype model
				instanceDefaultTrustedProfilePrototypeModel := new(vpcv1.InstanceDefaultTrustedProfilePrototype)
				instanceDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				instanceDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the InstanceMetadataServicePrototype model
				instanceMetadataServicePrototypeModel := new(vpcv1.InstanceMetadataServicePrototype)
				instanceMetadataServicePrototypeModel.Enabled = core.BoolPtr(false)
				instanceMetadataServicePrototypeModel.Protocol = core.StringPtr("https")
				instanceMetadataServicePrototypeModel.ResponseHopLimit = core.Int64Ptr(int64(2))

				// Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPrototypeModel := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPrototypeModel.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

				// Construct an instance of the InstanceProfileIdentityByName model
				instanceProfileIdentityModel := new(vpcv1.InstanceProfileIdentityByName)
				instanceProfileIdentityModel.Name = core.StringPtr("bx2-4x16")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPrototype model
				instanceReservationAffinityPrototypeModel := new(vpcv1.InstanceReservationAffinityPrototype)
				instanceReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID)
				volumeAttachmentPrototypeVolumeModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the VolumeAttachmentPrototype model
				volumeAttachmentPrototypeModel := new(vpcv1.VolumeAttachmentPrototype)
				volumeAttachmentPrototypeModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				volumeAttachmentPrototypeModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeModel.Volume = volumeAttachmentPrototypeVolumeModel

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VolumeAllowedUsePrototype model
				volumeAllowedUsePrototypeModel := new(vpcv1.VolumeAllowedUsePrototype)
				volumeAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("general-purpose")

				// Construct an instance of the VolumePrototypeInstanceByImageContext model
				volumePrototypeInstanceByImageContextModel := new(vpcv1.VolumePrototypeInstanceByImageContext)
				volumePrototypeInstanceByImageContextModel.AllowedUse = volumeAllowedUsePrototypeModel
				volumePrototypeInstanceByImageContextModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeInstanceByImageContextModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeInstanceByImageContextModel.EncryptionKey = encryptionKeyIdentityModel
				volumePrototypeInstanceByImageContextModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeInstanceByImageContextModel.Name = core.StringPtr("my-boot-volume")
				volumePrototypeInstanceByImageContextModel.Profile = volumeProfileIdentityModel
				volumePrototypeInstanceByImageContextModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeInstanceByImageContextModel.UserTags = []string{}

				// Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model
				volumeAttachmentPrototypeInstanceByImageContextModel := new(vpcv1.VolumeAttachmentPrototypeInstanceByImageContext)
				volumeAttachmentPrototypeInstanceByImageContextModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPrototypeInstanceByImageContextModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeInstanceByImageContextModel.Volume = volumePrototypeInstanceByImageContextModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the InstanceNetworkAttachmentPrototype model
				instanceNetworkAttachmentPrototypeModel := new(vpcv1.InstanceNetworkAttachmentPrototype)
				instanceNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-instance-network-attachment")
				instanceNetworkAttachmentPrototypeModel.VirtualNetworkInterface = instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel

				// Construct an instance of the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment model
				instanceTemplatePrototypeModel := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment)
				instanceTemplatePrototypeModel.AvailabilityPolicy = instanceAvailabilityPolicyPrototypeModel
				instanceTemplatePrototypeModel.ClusterNetworkAttachments = []vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext{*instanceClusterNetworkAttachmentPrototypeInstanceContextModel}
				instanceTemplatePrototypeModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instanceTemplatePrototypeModel.DefaultTrustedProfile = instanceDefaultTrustedProfilePrototypeModel
				instanceTemplatePrototypeModel.EnableSecureBoot = core.BoolPtr(true)
				instanceTemplatePrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				instanceTemplatePrototypeModel.MetadataService = instanceMetadataServicePrototypeModel
				instanceTemplatePrototypeModel.Name = core.StringPtr("my-instance")
				instanceTemplatePrototypeModel.PlacementTarget = instancePlacementTargetPrototypeModel
				instanceTemplatePrototypeModel.Profile = instanceProfileIdentityModel
				instanceTemplatePrototypeModel.ReservationAffinity = instanceReservationAffinityPrototypeModel
				instanceTemplatePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				instanceTemplatePrototypeModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instanceTemplatePrototypeModel.UserData = core.StringPtr("testString")
				instanceTemplatePrototypeModel.VolumeAttachments = []vpcv1.VolumeAttachmentPrototype{*volumeAttachmentPrototypeModel}
				instanceTemplatePrototypeModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instanceTemplatePrototypeModel.VPC = vpcIdentityModel
				instanceTemplatePrototypeModel.BootVolumeAttachment = volumeAttachmentPrototypeInstanceByImageContextModel
				instanceTemplatePrototypeModel.Image = imageIdentityModel
				instanceTemplatePrototypeModel.Zone = zoneIdentityModel
				instanceTemplatePrototypeModel.NetworkAttachments = []vpcv1.InstanceNetworkAttachmentPrototype{*instanceNetworkAttachmentPrototypeModel}
				instanceTemplatePrototypeModel.PrimaryNetworkAttachment = instanceNetworkAttachmentPrototypeModel

				// Construct an instance of the CreateInstanceTemplateOptions model
				createInstanceTemplateOptionsModel := new(vpcv1.CreateInstanceTemplateOptions)
				createInstanceTemplateOptionsModel.InstanceTemplatePrototype = instanceTemplatePrototypeModel
				createInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateInstanceTemplateWithContext(ctx, createInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateInstanceTemplate(createInstanceTemplateOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateInstanceTemplateWithContext(ctx, createInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceTemplatePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "automatic", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "UserData", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "bandwidth": 1000, "capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["UserTags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}`)
				}))
			})
			It(`Invoke CreateInstanceTemplate successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateInstanceTemplate(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceAvailabilityPolicyPrototype model
				instanceAvailabilityPolicyPrototypeModel := new(vpcv1.InstanceAvailabilityPolicyPrototype)
				instanceAvailabilityPolicyPrototypeModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext)
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.Name = core.StringPtr("my-instance-network-attachment")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the InstanceDefaultTrustedProfilePrototype model
				instanceDefaultTrustedProfilePrototypeModel := new(vpcv1.InstanceDefaultTrustedProfilePrototype)
				instanceDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				instanceDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the InstanceMetadataServicePrototype model
				instanceMetadataServicePrototypeModel := new(vpcv1.InstanceMetadataServicePrototype)
				instanceMetadataServicePrototypeModel.Enabled = core.BoolPtr(false)
				instanceMetadataServicePrototypeModel.Protocol = core.StringPtr("https")
				instanceMetadataServicePrototypeModel.ResponseHopLimit = core.Int64Ptr(int64(2))

				// Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPrototypeModel := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPrototypeModel.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

				// Construct an instance of the InstanceProfileIdentityByName model
				instanceProfileIdentityModel := new(vpcv1.InstanceProfileIdentityByName)
				instanceProfileIdentityModel.Name = core.StringPtr("bx2-4x16")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPrototype model
				instanceReservationAffinityPrototypeModel := new(vpcv1.InstanceReservationAffinityPrototype)
				instanceReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID)
				volumeAttachmentPrototypeVolumeModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the VolumeAttachmentPrototype model
				volumeAttachmentPrototypeModel := new(vpcv1.VolumeAttachmentPrototype)
				volumeAttachmentPrototypeModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				volumeAttachmentPrototypeModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeModel.Volume = volumeAttachmentPrototypeVolumeModel

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VolumeAllowedUsePrototype model
				volumeAllowedUsePrototypeModel := new(vpcv1.VolumeAllowedUsePrototype)
				volumeAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("general-purpose")

				// Construct an instance of the VolumePrototypeInstanceByImageContext model
				volumePrototypeInstanceByImageContextModel := new(vpcv1.VolumePrototypeInstanceByImageContext)
				volumePrototypeInstanceByImageContextModel.AllowedUse = volumeAllowedUsePrototypeModel
				volumePrototypeInstanceByImageContextModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeInstanceByImageContextModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeInstanceByImageContextModel.EncryptionKey = encryptionKeyIdentityModel
				volumePrototypeInstanceByImageContextModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeInstanceByImageContextModel.Name = core.StringPtr("my-boot-volume")
				volumePrototypeInstanceByImageContextModel.Profile = volumeProfileIdentityModel
				volumePrototypeInstanceByImageContextModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeInstanceByImageContextModel.UserTags = []string{}

				// Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model
				volumeAttachmentPrototypeInstanceByImageContextModel := new(vpcv1.VolumeAttachmentPrototypeInstanceByImageContext)
				volumeAttachmentPrototypeInstanceByImageContextModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPrototypeInstanceByImageContextModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeInstanceByImageContextModel.Volume = volumePrototypeInstanceByImageContextModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the InstanceNetworkAttachmentPrototype model
				instanceNetworkAttachmentPrototypeModel := new(vpcv1.InstanceNetworkAttachmentPrototype)
				instanceNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-instance-network-attachment")
				instanceNetworkAttachmentPrototypeModel.VirtualNetworkInterface = instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel

				// Construct an instance of the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment model
				instanceTemplatePrototypeModel := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment)
				instanceTemplatePrototypeModel.AvailabilityPolicy = instanceAvailabilityPolicyPrototypeModel
				instanceTemplatePrototypeModel.ClusterNetworkAttachments = []vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext{*instanceClusterNetworkAttachmentPrototypeInstanceContextModel}
				instanceTemplatePrototypeModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instanceTemplatePrototypeModel.DefaultTrustedProfile = instanceDefaultTrustedProfilePrototypeModel
				instanceTemplatePrototypeModel.EnableSecureBoot = core.BoolPtr(true)
				instanceTemplatePrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				instanceTemplatePrototypeModel.MetadataService = instanceMetadataServicePrototypeModel
				instanceTemplatePrototypeModel.Name = core.StringPtr("my-instance")
				instanceTemplatePrototypeModel.PlacementTarget = instancePlacementTargetPrototypeModel
				instanceTemplatePrototypeModel.Profile = instanceProfileIdentityModel
				instanceTemplatePrototypeModel.ReservationAffinity = instanceReservationAffinityPrototypeModel
				instanceTemplatePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				instanceTemplatePrototypeModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instanceTemplatePrototypeModel.UserData = core.StringPtr("testString")
				instanceTemplatePrototypeModel.VolumeAttachments = []vpcv1.VolumeAttachmentPrototype{*volumeAttachmentPrototypeModel}
				instanceTemplatePrototypeModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instanceTemplatePrototypeModel.VPC = vpcIdentityModel
				instanceTemplatePrototypeModel.BootVolumeAttachment = volumeAttachmentPrototypeInstanceByImageContextModel
				instanceTemplatePrototypeModel.Image = imageIdentityModel
				instanceTemplatePrototypeModel.Zone = zoneIdentityModel
				instanceTemplatePrototypeModel.NetworkAttachments = []vpcv1.InstanceNetworkAttachmentPrototype{*instanceNetworkAttachmentPrototypeModel}
				instanceTemplatePrototypeModel.PrimaryNetworkAttachment = instanceNetworkAttachmentPrototypeModel

				// Construct an instance of the CreateInstanceTemplateOptions model
				createInstanceTemplateOptionsModel := new(vpcv1.CreateInstanceTemplateOptions)
				createInstanceTemplateOptionsModel.InstanceTemplatePrototype = instanceTemplatePrototypeModel
				createInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateInstanceTemplate(createInstanceTemplateOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateInstanceTemplate with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceAvailabilityPolicyPrototype model
				instanceAvailabilityPolicyPrototypeModel := new(vpcv1.InstanceAvailabilityPolicyPrototype)
				instanceAvailabilityPolicyPrototypeModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext)
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.Name = core.StringPtr("my-instance-network-attachment")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the InstanceDefaultTrustedProfilePrototype model
				instanceDefaultTrustedProfilePrototypeModel := new(vpcv1.InstanceDefaultTrustedProfilePrototype)
				instanceDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				instanceDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the InstanceMetadataServicePrototype model
				instanceMetadataServicePrototypeModel := new(vpcv1.InstanceMetadataServicePrototype)
				instanceMetadataServicePrototypeModel.Enabled = core.BoolPtr(false)
				instanceMetadataServicePrototypeModel.Protocol = core.StringPtr("https")
				instanceMetadataServicePrototypeModel.ResponseHopLimit = core.Int64Ptr(int64(2))

				// Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPrototypeModel := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPrototypeModel.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

				// Construct an instance of the InstanceProfileIdentityByName model
				instanceProfileIdentityModel := new(vpcv1.InstanceProfileIdentityByName)
				instanceProfileIdentityModel.Name = core.StringPtr("bx2-4x16")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPrototype model
				instanceReservationAffinityPrototypeModel := new(vpcv1.InstanceReservationAffinityPrototype)
				instanceReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID)
				volumeAttachmentPrototypeVolumeModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the VolumeAttachmentPrototype model
				volumeAttachmentPrototypeModel := new(vpcv1.VolumeAttachmentPrototype)
				volumeAttachmentPrototypeModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				volumeAttachmentPrototypeModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeModel.Volume = volumeAttachmentPrototypeVolumeModel

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VolumeAllowedUsePrototype model
				volumeAllowedUsePrototypeModel := new(vpcv1.VolumeAllowedUsePrototype)
				volumeAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("general-purpose")

				// Construct an instance of the VolumePrototypeInstanceByImageContext model
				volumePrototypeInstanceByImageContextModel := new(vpcv1.VolumePrototypeInstanceByImageContext)
				volumePrototypeInstanceByImageContextModel.AllowedUse = volumeAllowedUsePrototypeModel
				volumePrototypeInstanceByImageContextModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeInstanceByImageContextModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeInstanceByImageContextModel.EncryptionKey = encryptionKeyIdentityModel
				volumePrototypeInstanceByImageContextModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeInstanceByImageContextModel.Name = core.StringPtr("my-boot-volume")
				volumePrototypeInstanceByImageContextModel.Profile = volumeProfileIdentityModel
				volumePrototypeInstanceByImageContextModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeInstanceByImageContextModel.UserTags = []string{}

				// Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model
				volumeAttachmentPrototypeInstanceByImageContextModel := new(vpcv1.VolumeAttachmentPrototypeInstanceByImageContext)
				volumeAttachmentPrototypeInstanceByImageContextModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPrototypeInstanceByImageContextModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeInstanceByImageContextModel.Volume = volumePrototypeInstanceByImageContextModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the InstanceNetworkAttachmentPrototype model
				instanceNetworkAttachmentPrototypeModel := new(vpcv1.InstanceNetworkAttachmentPrototype)
				instanceNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-instance-network-attachment")
				instanceNetworkAttachmentPrototypeModel.VirtualNetworkInterface = instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel

				// Construct an instance of the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment model
				instanceTemplatePrototypeModel := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment)
				instanceTemplatePrototypeModel.AvailabilityPolicy = instanceAvailabilityPolicyPrototypeModel
				instanceTemplatePrototypeModel.ClusterNetworkAttachments = []vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext{*instanceClusterNetworkAttachmentPrototypeInstanceContextModel}
				instanceTemplatePrototypeModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instanceTemplatePrototypeModel.DefaultTrustedProfile = instanceDefaultTrustedProfilePrototypeModel
				instanceTemplatePrototypeModel.EnableSecureBoot = core.BoolPtr(true)
				instanceTemplatePrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				instanceTemplatePrototypeModel.MetadataService = instanceMetadataServicePrototypeModel
				instanceTemplatePrototypeModel.Name = core.StringPtr("my-instance")
				instanceTemplatePrototypeModel.PlacementTarget = instancePlacementTargetPrototypeModel
				instanceTemplatePrototypeModel.Profile = instanceProfileIdentityModel
				instanceTemplatePrototypeModel.ReservationAffinity = instanceReservationAffinityPrototypeModel
				instanceTemplatePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				instanceTemplatePrototypeModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instanceTemplatePrototypeModel.UserData = core.StringPtr("testString")
				instanceTemplatePrototypeModel.VolumeAttachments = []vpcv1.VolumeAttachmentPrototype{*volumeAttachmentPrototypeModel}
				instanceTemplatePrototypeModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instanceTemplatePrototypeModel.VPC = vpcIdentityModel
				instanceTemplatePrototypeModel.BootVolumeAttachment = volumeAttachmentPrototypeInstanceByImageContextModel
				instanceTemplatePrototypeModel.Image = imageIdentityModel
				instanceTemplatePrototypeModel.Zone = zoneIdentityModel
				instanceTemplatePrototypeModel.NetworkAttachments = []vpcv1.InstanceNetworkAttachmentPrototype{*instanceNetworkAttachmentPrototypeModel}
				instanceTemplatePrototypeModel.PrimaryNetworkAttachment = instanceNetworkAttachmentPrototypeModel

				// Construct an instance of the CreateInstanceTemplateOptions model
				createInstanceTemplateOptionsModel := new(vpcv1.CreateInstanceTemplateOptions)
				createInstanceTemplateOptionsModel.InstanceTemplatePrototype = instanceTemplatePrototypeModel
				createInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateInstanceTemplate(createInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateInstanceTemplateOptions model with no property values
				createInstanceTemplateOptionsModelNew := new(vpcv1.CreateInstanceTemplateOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateInstanceTemplate(createInstanceTemplateOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateInstanceTemplate successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceAvailabilityPolicyPrototype model
				instanceAvailabilityPolicyPrototypeModel := new(vpcv1.InstanceAvailabilityPolicyPrototype)
				instanceAvailabilityPolicyPrototypeModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext)
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.Name = core.StringPtr("my-instance-network-attachment")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the InstanceDefaultTrustedProfilePrototype model
				instanceDefaultTrustedProfilePrototypeModel := new(vpcv1.InstanceDefaultTrustedProfilePrototype)
				instanceDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				instanceDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the InstanceMetadataServicePrototype model
				instanceMetadataServicePrototypeModel := new(vpcv1.InstanceMetadataServicePrototype)
				instanceMetadataServicePrototypeModel.Enabled = core.BoolPtr(false)
				instanceMetadataServicePrototypeModel.Protocol = core.StringPtr("https")
				instanceMetadataServicePrototypeModel.ResponseHopLimit = core.Int64Ptr(int64(2))

				// Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPrototypeModel := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPrototypeModel.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

				// Construct an instance of the InstanceProfileIdentityByName model
				instanceProfileIdentityModel := new(vpcv1.InstanceProfileIdentityByName)
				instanceProfileIdentityModel.Name = core.StringPtr("bx2-4x16")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPrototype model
				instanceReservationAffinityPrototypeModel := new(vpcv1.InstanceReservationAffinityPrototype)
				instanceReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID)
				volumeAttachmentPrototypeVolumeModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the VolumeAttachmentPrototype model
				volumeAttachmentPrototypeModel := new(vpcv1.VolumeAttachmentPrototype)
				volumeAttachmentPrototypeModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				volumeAttachmentPrototypeModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeModel.Volume = volumeAttachmentPrototypeVolumeModel

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VolumeAllowedUsePrototype model
				volumeAllowedUsePrototypeModel := new(vpcv1.VolumeAllowedUsePrototype)
				volumeAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("general-purpose")

				// Construct an instance of the VolumePrototypeInstanceByImageContext model
				volumePrototypeInstanceByImageContextModel := new(vpcv1.VolumePrototypeInstanceByImageContext)
				volumePrototypeInstanceByImageContextModel.AllowedUse = volumeAllowedUsePrototypeModel
				volumePrototypeInstanceByImageContextModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeInstanceByImageContextModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeInstanceByImageContextModel.EncryptionKey = encryptionKeyIdentityModel
				volumePrototypeInstanceByImageContextModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeInstanceByImageContextModel.Name = core.StringPtr("my-boot-volume")
				volumePrototypeInstanceByImageContextModel.Profile = volumeProfileIdentityModel
				volumePrototypeInstanceByImageContextModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeInstanceByImageContextModel.UserTags = []string{}

				// Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model
				volumeAttachmentPrototypeInstanceByImageContextModel := new(vpcv1.VolumeAttachmentPrototypeInstanceByImageContext)
				volumeAttachmentPrototypeInstanceByImageContextModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPrototypeInstanceByImageContextModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeInstanceByImageContextModel.Volume = volumePrototypeInstanceByImageContextModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the InstanceNetworkAttachmentPrototype model
				instanceNetworkAttachmentPrototypeModel := new(vpcv1.InstanceNetworkAttachmentPrototype)
				instanceNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-instance-network-attachment")
				instanceNetworkAttachmentPrototypeModel.VirtualNetworkInterface = instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel

				// Construct an instance of the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment model
				instanceTemplatePrototypeModel := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment)
				instanceTemplatePrototypeModel.AvailabilityPolicy = instanceAvailabilityPolicyPrototypeModel
				instanceTemplatePrototypeModel.ClusterNetworkAttachments = []vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext{*instanceClusterNetworkAttachmentPrototypeInstanceContextModel}
				instanceTemplatePrototypeModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instanceTemplatePrototypeModel.DefaultTrustedProfile = instanceDefaultTrustedProfilePrototypeModel
				instanceTemplatePrototypeModel.EnableSecureBoot = core.BoolPtr(true)
				instanceTemplatePrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				instanceTemplatePrototypeModel.MetadataService = instanceMetadataServicePrototypeModel
				instanceTemplatePrototypeModel.Name = core.StringPtr("my-instance")
				instanceTemplatePrototypeModel.PlacementTarget = instancePlacementTargetPrototypeModel
				instanceTemplatePrototypeModel.Profile = instanceProfileIdentityModel
				instanceTemplatePrototypeModel.ReservationAffinity = instanceReservationAffinityPrototypeModel
				instanceTemplatePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				instanceTemplatePrototypeModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instanceTemplatePrototypeModel.UserData = core.StringPtr("testString")
				instanceTemplatePrototypeModel.VolumeAttachments = []vpcv1.VolumeAttachmentPrototype{*volumeAttachmentPrototypeModel}
				instanceTemplatePrototypeModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instanceTemplatePrototypeModel.VPC = vpcIdentityModel
				instanceTemplatePrototypeModel.BootVolumeAttachment = volumeAttachmentPrototypeInstanceByImageContextModel
				instanceTemplatePrototypeModel.Image = imageIdentityModel
				instanceTemplatePrototypeModel.Zone = zoneIdentityModel
				instanceTemplatePrototypeModel.NetworkAttachments = []vpcv1.InstanceNetworkAttachmentPrototype{*instanceNetworkAttachmentPrototypeModel}
				instanceTemplatePrototypeModel.PrimaryNetworkAttachment = instanceNetworkAttachmentPrototypeModel

				// Construct an instance of the CreateInstanceTemplateOptions model
				createInstanceTemplateOptionsModel := new(vpcv1.CreateInstanceTemplateOptions)
				createInstanceTemplateOptionsModel.InstanceTemplatePrototype = instanceTemplatePrototypeModel
				createInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateInstanceTemplate(createInstanceTemplateOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteInstanceTemplate(deleteInstanceTemplateOptions *DeleteInstanceTemplateOptions)`, func() {
		version := "2024-06-23"
		deleteInstanceTemplatePath := "/instance/templates/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstanceTemplatePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteInstanceTemplate successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteInstanceTemplate(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteInstanceTemplateOptions model
				deleteInstanceTemplateOptionsModel := new(vpcv1.DeleteInstanceTemplateOptions)
				deleteInstanceTemplateOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteInstanceTemplate(deleteInstanceTemplateOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteInstanceTemplate with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceTemplateOptions model
				deleteInstanceTemplateOptionsModel := new(vpcv1.DeleteInstanceTemplateOptions)
				deleteInstanceTemplateOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteInstanceTemplate(deleteInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteInstanceTemplateOptions model with no property values
				deleteInstanceTemplateOptionsModelNew := new(vpcv1.DeleteInstanceTemplateOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteInstanceTemplate(deleteInstanceTemplateOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceTemplate(getInstanceTemplateOptions *GetInstanceTemplateOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceTemplatePath := "/instance/templates/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceTemplatePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceTemplate with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceTemplateOptions model
				getInstanceTemplateOptionsModel := new(vpcv1.GetInstanceTemplateOptions)
				getInstanceTemplateOptionsModel.ID = core.StringPtr("testString")
				getInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceTemplate(getInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceTemplate(getInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceTemplate(getInstanceTemplateOptions *GetInstanceTemplateOptions)`, func() {
		version := "2024-06-23"
		getInstanceTemplatePath := "/instance/templates/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceTemplatePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "automatic", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "UserData", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "bandwidth": 1000, "capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["UserTags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}`)
				}))
			})
			It(`Invoke GetInstanceTemplate successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceTemplateOptions model
				getInstanceTemplateOptionsModel := new(vpcv1.GetInstanceTemplateOptions)
				getInstanceTemplateOptionsModel.ID = core.StringPtr("testString")
				getInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceTemplateWithContext(ctx, getInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceTemplate(getInstanceTemplateOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceTemplateWithContext(ctx, getInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceTemplatePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "automatic", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "UserData", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "bandwidth": 1000, "capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["UserTags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}`)
				}))
			})
			It(`Invoke GetInstanceTemplate successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceTemplate(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceTemplateOptions model
				getInstanceTemplateOptionsModel := new(vpcv1.GetInstanceTemplateOptions)
				getInstanceTemplateOptionsModel.ID = core.StringPtr("testString")
				getInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceTemplate(getInstanceTemplateOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceTemplate with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceTemplateOptions model
				getInstanceTemplateOptionsModel := new(vpcv1.GetInstanceTemplateOptions)
				getInstanceTemplateOptionsModel.ID = core.StringPtr("testString")
				getInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceTemplate(getInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceTemplateOptions model with no property values
				getInstanceTemplateOptionsModelNew := new(vpcv1.GetInstanceTemplateOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceTemplate(getInstanceTemplateOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceTemplate successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceTemplateOptions model
				getInstanceTemplateOptionsModel := new(vpcv1.GetInstanceTemplateOptions)
				getInstanceTemplateOptionsModel.ID = core.StringPtr("testString")
				getInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceTemplate(getInstanceTemplateOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceTemplate(updateInstanceTemplateOptions *UpdateInstanceTemplateOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateInstanceTemplatePath := "/instance/templates/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceTemplatePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateInstanceTemplate with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceTemplatePatch model
				instanceTemplatePatchModel := new(vpcv1.InstanceTemplatePatch)
				instanceTemplatePatchModel.Name = core.StringPtr("my-instance-template-updated")
				instanceTemplatePatchModelAsPatch, asPatchErr := instanceTemplatePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceTemplateOptions model
				updateInstanceTemplateOptionsModel := new(vpcv1.UpdateInstanceTemplateOptions)
				updateInstanceTemplateOptionsModel.ID = core.StringPtr("testString")
				updateInstanceTemplateOptionsModel.InstanceTemplatePatch = instanceTemplatePatchModelAsPatch
				updateInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateInstanceTemplate(updateInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateInstanceTemplate(updateInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceTemplate(updateInstanceTemplateOptions *UpdateInstanceTemplateOptions)`, func() {
		version := "2024-06-23"
		updateInstanceTemplatePath := "/instance/templates/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceTemplatePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "automatic", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "UserData", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "bandwidth": 1000, "capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["UserTags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}`)
				}))
			})
			It(`Invoke UpdateInstanceTemplate successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceTemplatePatch model
				instanceTemplatePatchModel := new(vpcv1.InstanceTemplatePatch)
				instanceTemplatePatchModel.Name = core.StringPtr("my-instance-template-updated")
				instanceTemplatePatchModelAsPatch, asPatchErr := instanceTemplatePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceTemplateOptions model
				updateInstanceTemplateOptionsModel := new(vpcv1.UpdateInstanceTemplateOptions)
				updateInstanceTemplateOptionsModel.ID = core.StringPtr("testString")
				updateInstanceTemplateOptionsModel.InstanceTemplatePatch = instanceTemplatePatchModelAsPatch
				updateInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateInstanceTemplateWithContext(ctx, updateInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateInstanceTemplate(updateInstanceTemplateOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateInstanceTemplateWithContext(ctx, updateInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceTemplatePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "id": "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "automatic", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "UserData", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "bandwidth": 1000, "capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["UserTags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}`)
				}))
			})
			It(`Invoke UpdateInstanceTemplate successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateInstanceTemplate(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceTemplatePatch model
				instanceTemplatePatchModel := new(vpcv1.InstanceTemplatePatch)
				instanceTemplatePatchModel.Name = core.StringPtr("my-instance-template-updated")
				instanceTemplatePatchModelAsPatch, asPatchErr := instanceTemplatePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceTemplateOptions model
				updateInstanceTemplateOptionsModel := new(vpcv1.UpdateInstanceTemplateOptions)
				updateInstanceTemplateOptionsModel.ID = core.StringPtr("testString")
				updateInstanceTemplateOptionsModel.InstanceTemplatePatch = instanceTemplatePatchModelAsPatch
				updateInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateInstanceTemplate(updateInstanceTemplateOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateInstanceTemplate with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceTemplatePatch model
				instanceTemplatePatchModel := new(vpcv1.InstanceTemplatePatch)
				instanceTemplatePatchModel.Name = core.StringPtr("my-instance-template-updated")
				instanceTemplatePatchModelAsPatch, asPatchErr := instanceTemplatePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceTemplateOptions model
				updateInstanceTemplateOptionsModel := new(vpcv1.UpdateInstanceTemplateOptions)
				updateInstanceTemplateOptionsModel.ID = core.StringPtr("testString")
				updateInstanceTemplateOptionsModel.InstanceTemplatePatch = instanceTemplatePatchModelAsPatch
				updateInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateInstanceTemplate(updateInstanceTemplateOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateInstanceTemplateOptions model with no property values
				updateInstanceTemplateOptionsModelNew := new(vpcv1.UpdateInstanceTemplateOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateInstanceTemplate(updateInstanceTemplateOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateInstanceTemplate successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceTemplatePatch model
				instanceTemplatePatchModel := new(vpcv1.InstanceTemplatePatch)
				instanceTemplatePatchModel.Name = core.StringPtr("my-instance-template-updated")
				instanceTemplatePatchModelAsPatch, asPatchErr := instanceTemplatePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceTemplateOptions model
				updateInstanceTemplateOptionsModel := new(vpcv1.UpdateInstanceTemplateOptions)
				updateInstanceTemplateOptionsModel.ID = core.StringPtr("testString")
				updateInstanceTemplateOptionsModel.InstanceTemplatePatch = instanceTemplatePatchModelAsPatch
				updateInstanceTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateInstanceTemplate(updateInstanceTemplateOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceProfiles(listInstanceProfilesOptions *ListInstanceProfilesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstanceProfilesPath := "/instance/profiles"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstanceProfiles with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceProfilesOptions model
				listInstanceProfilesOptionsModel := new(vpcv1.ListInstanceProfilesOptions)
				listInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstanceProfiles(listInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstanceProfiles(listInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceProfiles(listInstanceProfilesOptions *ListInstanceProfilesOptions)`, func() {
		version := "2024-06-23"
		listInstanceProfilesPath := "/instance/profiles"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "cluster_network_attachment_count": {"type": "dependent"}, "confidential_compute_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["amd"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "secure_boot_modes": {"default": false, "type": "enum", "values": [true]}, "status": "current", "supported_cluster_network_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}], "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}, "volume_bandwidth_qos_modes": {"default": "pooled", "type": "enum", "values": ["pooled"]}}]}`)
				}))
			})
			It(`Invoke ListInstanceProfiles successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstanceProfilesOptions model
				listInstanceProfilesOptionsModel := new(vpcv1.ListInstanceProfilesOptions)
				listInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstanceProfilesWithContext(ctx, listInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstanceProfiles(listInstanceProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstanceProfilesWithContext(ctx, listInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "cluster_network_attachment_count": {"type": "dependent"}, "confidential_compute_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["amd"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "secure_boot_modes": {"default": false, "type": "enum", "values": [true]}, "status": "current", "supported_cluster_network_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}], "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}, "volume_bandwidth_qos_modes": {"default": "pooled", "type": "enum", "values": ["pooled"]}}]}`)
				}))
			})
			It(`Invoke ListInstanceProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstanceProfiles(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstanceProfilesOptions model
				listInstanceProfilesOptionsModel := new(vpcv1.ListInstanceProfilesOptions)
				listInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstanceProfiles(listInstanceProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstanceProfiles with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceProfilesOptions model
				listInstanceProfilesOptionsModel := new(vpcv1.ListInstanceProfilesOptions)
				listInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstanceProfiles(listInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstanceProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceProfilesOptions model
				listInstanceProfilesOptionsModel := new(vpcv1.ListInstanceProfilesOptions)
				listInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstanceProfiles(listInstanceProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceProfile(getInstanceProfileOptions *GetInstanceProfileOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceProfilePath := "/instance/profiles/mx2-host-152x1216"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceProfilePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceProfile with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceProfileOptions model
				getInstanceProfileOptionsModel := new(vpcv1.GetInstanceProfileOptions)
				getInstanceProfileOptionsModel.Name = core.StringPtr("mx2-host-152x1216")
				getInstanceProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceProfile(getInstanceProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceProfile(getInstanceProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceProfile(getInstanceProfileOptions *GetInstanceProfileOptions)`, func() {
		version := "2024-06-23"
		getInstanceProfilePath := "/instance/profiles/mx2-host-152x1216"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceProfilePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bandwidth": {"type": "fixed", "value": 20000}, "cluster_network_attachment_count": {"type": "dependent"}, "confidential_compute_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["amd"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "secure_boot_modes": {"default": false, "type": "enum", "values": [true]}, "status": "current", "supported_cluster_network_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}], "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}, "volume_bandwidth_qos_modes": {"default": "pooled", "type": "enum", "values": ["pooled"]}}`)
				}))
			})
			It(`Invoke GetInstanceProfile successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceProfileOptions model
				getInstanceProfileOptionsModel := new(vpcv1.GetInstanceProfileOptions)
				getInstanceProfileOptionsModel.Name = core.StringPtr("mx2-host-152x1216")
				getInstanceProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceProfileWithContext(ctx, getInstanceProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceProfile(getInstanceProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceProfileWithContext(ctx, getInstanceProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceProfilePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bandwidth": {"type": "fixed", "value": 20000}, "cluster_network_attachment_count": {"type": "dependent"}, "confidential_compute_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["amd"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "secure_boot_modes": {"default": false, "type": "enum", "values": [true]}, "status": "current", "supported_cluster_network_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}], "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}, "volume_bandwidth_qos_modes": {"default": "pooled", "type": "enum", "values": ["pooled"]}}`)
				}))
			})
			It(`Invoke GetInstanceProfile successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceProfile(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceProfileOptions model
				getInstanceProfileOptionsModel := new(vpcv1.GetInstanceProfileOptions)
				getInstanceProfileOptionsModel.Name = core.StringPtr("mx2-host-152x1216")
				getInstanceProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceProfile(getInstanceProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceProfile with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceProfileOptions model
				getInstanceProfileOptionsModel := new(vpcv1.GetInstanceProfileOptions)
				getInstanceProfileOptionsModel.Name = core.StringPtr("mx2-host-152x1216")
				getInstanceProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceProfile(getInstanceProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceProfileOptions model with no property values
				getInstanceProfileOptionsModelNew := new(vpcv1.GetInstanceProfileOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceProfile(getInstanceProfileOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceProfile successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceProfileOptions model
				getInstanceProfileOptionsModel := new(vpcv1.GetInstanceProfileOptions)
				getInstanceProfileOptionsModel.Name = core.StringPtr("mx2-host-152x1216")
				getInstanceProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceProfile(getInstanceProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstances(listInstancesOptions *ListInstancesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstancesPath := "/instances"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstancesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["cluster_network.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["cluster_network.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573"}))
					Expect(req.URL.Query()["cluster_network.name"]).To(Equal([]string{"my-cluster-network"}))
					Expect(req.URL.Query()["dedicated_host.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["dedicated_host.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}))
					Expect(req.URL.Query()["dedicated_host.name"]).To(Equal([]string{"my-dedicated-host"}))
					Expect(req.URL.Query()["instance_group_membership.instance_group.id"]).To(Equal([]string{"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60"}))
					Expect(req.URL.Query()["instance_group_membership.instance_group.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60"}))
					Expect(req.URL.Query()["placement_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["placement_group.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871"}))
					Expect(req.URL.Query()["placement_group.name"]).To(Equal([]string{"my-placement-group"}))
					Expect(req.URL.Query()["reservation_affinity.policy"]).To(Equal([]string{"automatic"}))
					Expect(req.URL.Query()["reservation.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["reservation.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}))
					Expect(req.URL.Query()["reservation.name"]).To(Equal([]string{"my-reservation"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstances with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstancesOptions model
				listInstancesOptionsModel := new(vpcv1.ListInstancesOptions)
				listInstancesOptionsModel.Start = core.StringPtr("testString")
				listInstancesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstancesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listInstancesOptionsModel.Name = core.StringPtr("my-name")
				listInstancesOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listInstancesOptionsModel.ClusterNetworkCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573")
				listInstancesOptionsModel.ClusterNetworkName = core.StringPtr("my-cluster-network")
				listInstancesOptionsModel.DedicatedHostID = core.StringPtr("testString")
				listInstancesOptionsModel.DedicatedHostCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
				listInstancesOptionsModel.DedicatedHostName = core.StringPtr("my-dedicated-host")
				listInstancesOptionsModel.InstanceGroupMembershipInstanceGroupID = core.StringPtr("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60")
				listInstancesOptionsModel.InstanceGroupMembershipInstanceGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60")
				listInstancesOptionsModel.PlacementGroupID = core.StringPtr("testString")
				listInstancesOptionsModel.PlacementGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871")
				listInstancesOptionsModel.PlacementGroupName = core.StringPtr("my-placement-group")
				listInstancesOptionsModel.ReservationAffinityPolicy = core.StringPtr("automatic")
				listInstancesOptionsModel.ReservationID = core.StringPtr("testString")
				listInstancesOptionsModel.ReservationCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				listInstancesOptionsModel.ReservationName = core.StringPtr("my-reservation")
				listInstancesOptionsModel.VPCID = core.StringPtr("testString")
				listInstancesOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listInstancesOptionsModel.VPCName = core.StringPtr("my-vpc")
				listInstancesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstances(listInstancesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstances(listInstancesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstances(listInstancesOptions *ListInstancesOptions)`, func() {
		version := "2024-06-23"
		listInstancesPath := "/instances"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstancesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["cluster_network.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["cluster_network.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573"}))
					Expect(req.URL.Query()["cluster_network.name"]).To(Equal([]string{"my-cluster-network"}))
					Expect(req.URL.Query()["dedicated_host.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["dedicated_host.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}))
					Expect(req.URL.Query()["dedicated_host.name"]).To(Equal([]string{"my-dedicated-host"}))
					Expect(req.URL.Query()["instance_group_membership.instance_group.id"]).To(Equal([]string{"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60"}))
					Expect(req.URL.Query()["instance_group_membership.instance_group.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60"}))
					Expect(req.URL.Query()["placement_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["placement_group.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871"}))
					Expect(req.URL.Query()["placement_group.name"]).To(Equal([]string{"my-placement-group"}))
					Expect(req.URL.Query()["reservation_affinity.policy"]).To(Equal([]string{"automatic"}))
					Expect(req.URL.Query()["reservation.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["reservation.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}))
					Expect(req.URL.Query()["reservation.name"]).To(Equal([]string{"my-reservation"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "amd", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "instance_group_membership": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "id": "r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "name": "my-instance-group-membership"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstances successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstancesOptions model
				listInstancesOptionsModel := new(vpcv1.ListInstancesOptions)
				listInstancesOptionsModel.Start = core.StringPtr("testString")
				listInstancesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstancesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listInstancesOptionsModel.Name = core.StringPtr("my-name")
				listInstancesOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listInstancesOptionsModel.ClusterNetworkCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573")
				listInstancesOptionsModel.ClusterNetworkName = core.StringPtr("my-cluster-network")
				listInstancesOptionsModel.DedicatedHostID = core.StringPtr("testString")
				listInstancesOptionsModel.DedicatedHostCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
				listInstancesOptionsModel.DedicatedHostName = core.StringPtr("my-dedicated-host")
				listInstancesOptionsModel.InstanceGroupMembershipInstanceGroupID = core.StringPtr("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60")
				listInstancesOptionsModel.InstanceGroupMembershipInstanceGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60")
				listInstancesOptionsModel.PlacementGroupID = core.StringPtr("testString")
				listInstancesOptionsModel.PlacementGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871")
				listInstancesOptionsModel.PlacementGroupName = core.StringPtr("my-placement-group")
				listInstancesOptionsModel.ReservationAffinityPolicy = core.StringPtr("automatic")
				listInstancesOptionsModel.ReservationID = core.StringPtr("testString")
				listInstancesOptionsModel.ReservationCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				listInstancesOptionsModel.ReservationName = core.StringPtr("my-reservation")
				listInstancesOptionsModel.VPCID = core.StringPtr("testString")
				listInstancesOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listInstancesOptionsModel.VPCName = core.StringPtr("my-vpc")
				listInstancesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstancesWithContext(ctx, listInstancesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstances(listInstancesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstancesWithContext(ctx, listInstancesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstancesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["cluster_network.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["cluster_network.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573"}))
					Expect(req.URL.Query()["cluster_network.name"]).To(Equal([]string{"my-cluster-network"}))
					Expect(req.URL.Query()["dedicated_host.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["dedicated_host.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}))
					Expect(req.URL.Query()["dedicated_host.name"]).To(Equal([]string{"my-dedicated-host"}))
					Expect(req.URL.Query()["instance_group_membership.instance_group.id"]).To(Equal([]string{"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60"}))
					Expect(req.URL.Query()["instance_group_membership.instance_group.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60"}))
					Expect(req.URL.Query()["placement_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["placement_group.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871"}))
					Expect(req.URL.Query()["placement_group.name"]).To(Equal([]string{"my-placement-group"}))
					Expect(req.URL.Query()["reservation_affinity.policy"]).To(Equal([]string{"automatic"}))
					Expect(req.URL.Query()["reservation.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["reservation.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}))
					Expect(req.URL.Query()["reservation.name"]).To(Equal([]string{"my-reservation"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "amd", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "instance_group_membership": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "id": "r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "name": "my-instance-group-membership"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstances successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstances(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstancesOptions model
				listInstancesOptionsModel := new(vpcv1.ListInstancesOptions)
				listInstancesOptionsModel.Start = core.StringPtr("testString")
				listInstancesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstancesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listInstancesOptionsModel.Name = core.StringPtr("my-name")
				listInstancesOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listInstancesOptionsModel.ClusterNetworkCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573")
				listInstancesOptionsModel.ClusterNetworkName = core.StringPtr("my-cluster-network")
				listInstancesOptionsModel.DedicatedHostID = core.StringPtr("testString")
				listInstancesOptionsModel.DedicatedHostCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
				listInstancesOptionsModel.DedicatedHostName = core.StringPtr("my-dedicated-host")
				listInstancesOptionsModel.InstanceGroupMembershipInstanceGroupID = core.StringPtr("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60")
				listInstancesOptionsModel.InstanceGroupMembershipInstanceGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60")
				listInstancesOptionsModel.PlacementGroupID = core.StringPtr("testString")
				listInstancesOptionsModel.PlacementGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871")
				listInstancesOptionsModel.PlacementGroupName = core.StringPtr("my-placement-group")
				listInstancesOptionsModel.ReservationAffinityPolicy = core.StringPtr("automatic")
				listInstancesOptionsModel.ReservationID = core.StringPtr("testString")
				listInstancesOptionsModel.ReservationCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				listInstancesOptionsModel.ReservationName = core.StringPtr("my-reservation")
				listInstancesOptionsModel.VPCID = core.StringPtr("testString")
				listInstancesOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listInstancesOptionsModel.VPCName = core.StringPtr("my-vpc")
				listInstancesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstances(listInstancesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstances with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstancesOptions model
				listInstancesOptionsModel := new(vpcv1.ListInstancesOptions)
				listInstancesOptionsModel.Start = core.StringPtr("testString")
				listInstancesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstancesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listInstancesOptionsModel.Name = core.StringPtr("my-name")
				listInstancesOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listInstancesOptionsModel.ClusterNetworkCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573")
				listInstancesOptionsModel.ClusterNetworkName = core.StringPtr("my-cluster-network")
				listInstancesOptionsModel.DedicatedHostID = core.StringPtr("testString")
				listInstancesOptionsModel.DedicatedHostCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
				listInstancesOptionsModel.DedicatedHostName = core.StringPtr("my-dedicated-host")
				listInstancesOptionsModel.InstanceGroupMembershipInstanceGroupID = core.StringPtr("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60")
				listInstancesOptionsModel.InstanceGroupMembershipInstanceGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60")
				listInstancesOptionsModel.PlacementGroupID = core.StringPtr("testString")
				listInstancesOptionsModel.PlacementGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871")
				listInstancesOptionsModel.PlacementGroupName = core.StringPtr("my-placement-group")
				listInstancesOptionsModel.ReservationAffinityPolicy = core.StringPtr("automatic")
				listInstancesOptionsModel.ReservationID = core.StringPtr("testString")
				listInstancesOptionsModel.ReservationCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				listInstancesOptionsModel.ReservationName = core.StringPtr("my-reservation")
				listInstancesOptionsModel.VPCID = core.StringPtr("testString")
				listInstancesOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listInstancesOptionsModel.VPCName = core.StringPtr("my-vpc")
				listInstancesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstances(listInstancesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstances successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstancesOptions model
				listInstancesOptionsModel := new(vpcv1.ListInstancesOptions)
				listInstancesOptionsModel.Start = core.StringPtr("testString")
				listInstancesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstancesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listInstancesOptionsModel.Name = core.StringPtr("my-name")
				listInstancesOptionsModel.ClusterNetworkID = core.StringPtr("testString")
				listInstancesOptionsModel.ClusterNetworkCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573")
				listInstancesOptionsModel.ClusterNetworkName = core.StringPtr("my-cluster-network")
				listInstancesOptionsModel.DedicatedHostID = core.StringPtr("testString")
				listInstancesOptionsModel.DedicatedHostCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
				listInstancesOptionsModel.DedicatedHostName = core.StringPtr("my-dedicated-host")
				listInstancesOptionsModel.InstanceGroupMembershipInstanceGroupID = core.StringPtr("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60")
				listInstancesOptionsModel.InstanceGroupMembershipInstanceGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60")
				listInstancesOptionsModel.PlacementGroupID = core.StringPtr("testString")
				listInstancesOptionsModel.PlacementGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871")
				listInstancesOptionsModel.PlacementGroupName = core.StringPtr("my-placement-group")
				listInstancesOptionsModel.ReservationAffinityPolicy = core.StringPtr("automatic")
				listInstancesOptionsModel.ReservationID = core.StringPtr("testString")
				listInstancesOptionsModel.ReservationCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				listInstancesOptionsModel.ReservationName = core.StringPtr("my-reservation")
				listInstancesOptionsModel.VPCID = core.StringPtr("testString")
				listInstancesOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listInstancesOptionsModel.VPCName = core.StringPtr("my-vpc")
				listInstancesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstances(listInstancesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.InstanceCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.InstanceCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.InstanceCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstancesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"ID"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"cluster_network":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573","id":"0717-da0df18c-7598-4633-a648-fdaac28a5573","name":"my-cluster-network","resource_type":"cluster_network"},"cluster_network_attachments":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"}],"confidential_compute_mode":"disabled","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"enable_secure_boot":true,"gpu":{"count":1,"manufacturer":"amd","memory":1,"model":"Tesla V100"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"instance_group_membership":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741","id":"r006-32c8210b-fd1a-409f-8966-de85bbfd3741","instance_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60","id":"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60","name":"my-instance-group"},"name":"my-instance-group-membership"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":64,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_type":"dedicated_host_group"},"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"automatic","pool":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"ID"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"volume_bandwidth_qos_mode":"pooled","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"ID"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"cluster_network":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573","id":"0717-da0df18c-7598-4633-a648-fdaac28a5573","name":"my-cluster-network","resource_type":"cluster_network"},"cluster_network_attachments":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"}],"confidential_compute_mode":"disabled","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"enable_secure_boot":true,"gpu":{"count":1,"manufacturer":"amd","memory":1,"model":"Tesla V100"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"instance_group_membership":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741","id":"r006-32c8210b-fd1a-409f-8966-de85bbfd3741","instance_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60","id":"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60","name":"my-instance-group"},"name":"my-instance-group-membership"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":64,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_type":"dedicated_host_group"},"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"automatic","pool":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"ID"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"volume_bandwidth_qos_mode":"pooled","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use InstancesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstancesOptionsModel := &vpcv1.ListInstancesOptions{
					Limit:                                   core.Int64Ptr(int64(10)),
					ResourceGroupID:                         core.StringPtr("testString"),
					Name:                                    core.StringPtr("my-name"),
					ClusterNetworkID:                        core.StringPtr("testString"),
					ClusterNetworkCRN:                       core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573"),
					ClusterNetworkName:                      core.StringPtr("my-cluster-network"),
					DedicatedHostID:                         core.StringPtr("testString"),
					DedicatedHostCRN:                        core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a"),
					DedicatedHostName:                       core.StringPtr("my-dedicated-host"),
					InstanceGroupMembershipInstanceGroupID:  core.StringPtr("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60"),
					InstanceGroupMembershipInstanceGroupCRN: core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60"),
					PlacementGroupID:                        core.StringPtr("testString"),
					PlacementGroupCRN:                       core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871"),
					PlacementGroupName:                      core.StringPtr("my-placement-group"),
					ReservationAffinityPolicy:               core.StringPtr("automatic"),
					ReservationID:                           core.StringPtr("testString"),
					ReservationCRN:                          core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"),
					ReservationName:                         core.StringPtr("my-reservation"),
					VPCID:                                   core.StringPtr("testString"),
					VPCCRN:                                  core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:                                 core.StringPtr("my-vpc"),
				}

				pager, err := vpcService.NewInstancesPager(listInstancesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.Instance
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use InstancesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstancesOptionsModel := &vpcv1.ListInstancesOptions{
					Limit:                                   core.Int64Ptr(int64(10)),
					ResourceGroupID:                         core.StringPtr("testString"),
					Name:                                    core.StringPtr("my-name"),
					ClusterNetworkID:                        core.StringPtr("testString"),
					ClusterNetworkCRN:                       core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573"),
					ClusterNetworkName:                      core.StringPtr("my-cluster-network"),
					DedicatedHostID:                         core.StringPtr("testString"),
					DedicatedHostCRN:                        core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a"),
					DedicatedHostName:                       core.StringPtr("my-dedicated-host"),
					InstanceGroupMembershipInstanceGroupID:  core.StringPtr("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60"),
					InstanceGroupMembershipInstanceGroupCRN: core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60"),
					PlacementGroupID:                        core.StringPtr("testString"),
					PlacementGroupCRN:                       core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871"),
					PlacementGroupName:                      core.StringPtr("my-placement-group"),
					ReservationAffinityPolicy:               core.StringPtr("automatic"),
					ReservationID:                           core.StringPtr("testString"),
					ReservationCRN:                          core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"),
					ReservationName:                         core.StringPtr("my-reservation"),
					VPCID:                                   core.StringPtr("testString"),
					VPCCRN:                                  core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:                                 core.StringPtr("my-vpc"),
				}

				pager, err := vpcService.NewInstancesPager(listInstancesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateInstance(createInstanceOptions *CreateInstanceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createInstancePath := "/instances"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstancePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateInstance with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceAvailabilityPolicyPrototype model
				instanceAvailabilityPolicyPrototypeModel := new(vpcv1.InstanceAvailabilityPolicyPrototype)
				instanceAvailabilityPolicyPrototypeModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext)
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.Name = core.StringPtr("my-instance-network-attachment")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the InstanceDefaultTrustedProfilePrototype model
				instanceDefaultTrustedProfilePrototypeModel := new(vpcv1.InstanceDefaultTrustedProfilePrototype)
				instanceDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				instanceDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the InstanceMetadataServicePrototype model
				instanceMetadataServicePrototypeModel := new(vpcv1.InstanceMetadataServicePrototype)
				instanceMetadataServicePrototypeModel.Enabled = core.BoolPtr(false)
				instanceMetadataServicePrototypeModel.Protocol = core.StringPtr("https")
				instanceMetadataServicePrototypeModel.ResponseHopLimit = core.Int64Ptr(int64(2))

				// Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPrototypeModel := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPrototypeModel.ID = core.StringPtr("r006-418fe842-a3e9-47b9-a938-1aa5bd632871")

				// Construct an instance of the InstanceProfileIdentityByName model
				instanceProfileIdentityModel := new(vpcv1.InstanceProfileIdentityByName)
				instanceProfileIdentityModel.Name = core.StringPtr("bx2-2x8")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPrototype model
				instanceReservationAffinityPrototypeModel := new(vpcv1.InstanceReservationAffinityPrototype)
				instanceReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("5iops-tier")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity)
				volumeAttachmentPrototypeVolumeModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumeAttachmentPrototypeVolumeModel.Iops = core.Int64Ptr(int64(10000))
				volumeAttachmentPrototypeVolumeModel.Name = core.StringPtr("my-data-volume")
				volumeAttachmentPrototypeVolumeModel.Profile = volumeProfileIdentityModel
				volumeAttachmentPrototypeVolumeModel.ResourceGroup = resourceGroupIdentityModel
				volumeAttachmentPrototypeVolumeModel.UserTags = []string{}
				volumeAttachmentPrototypeVolumeModel.Capacity = core.Int64Ptr(int64(1000))
				volumeAttachmentPrototypeVolumeModel.EncryptionKey = encryptionKeyIdentityModel

				// Construct an instance of the VolumeAttachmentPrototype model
				volumeAttachmentPrototypeModel := new(vpcv1.VolumeAttachmentPrototype)
				volumeAttachmentPrototypeModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				volumeAttachmentPrototypeModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeModel.Volume = volumeAttachmentPrototypeVolumeModel

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VolumeAllowedUsePrototype model
				volumeAllowedUsePrototypeModel := new(vpcv1.VolumeAllowedUsePrototype)
				volumeAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the VolumePrototypeInstanceByImageContext model
				volumePrototypeInstanceByImageContextModel := new(vpcv1.VolumePrototypeInstanceByImageContext)
				volumePrototypeInstanceByImageContextModel.AllowedUse = volumeAllowedUsePrototypeModel
				volumePrototypeInstanceByImageContextModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeInstanceByImageContextModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeInstanceByImageContextModel.EncryptionKey = encryptionKeyIdentityModel
				volumePrototypeInstanceByImageContextModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeInstanceByImageContextModel.Name = core.StringPtr("my-boot-volume")
				volumePrototypeInstanceByImageContextModel.Profile = volumeProfileIdentityModel
				volumePrototypeInstanceByImageContextModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeInstanceByImageContextModel.UserTags = []string{}

				// Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model
				volumeAttachmentPrototypeInstanceByImageContextModel := new(vpcv1.VolumeAttachmentPrototypeInstanceByImageContext)
				volumeAttachmentPrototypeInstanceByImageContextModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPrototypeInstanceByImageContextModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeInstanceByImageContextModel.Volume = volumePrototypeInstanceByImageContextModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the NetworkInterfacePrototype model
				networkInterfacePrototypeModel := new(vpcv1.NetworkInterfacePrototype)
				networkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				networkInterfacePrototypeModel.Name = core.StringPtr("my-instance-network-interface")
				networkInterfacePrototypeModel.PrimaryIP = networkInterfaceIPPrototypeModel
				networkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				networkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface model
				instancePrototypeModel := new(vpcv1.InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface)
				instancePrototypeModel.AvailabilityPolicy = instanceAvailabilityPolicyPrototypeModel
				instancePrototypeModel.ClusterNetworkAttachments = []vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext{*instanceClusterNetworkAttachmentPrototypeInstanceContextModel}
				instancePrototypeModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instancePrototypeModel.DefaultTrustedProfile = instanceDefaultTrustedProfilePrototypeModel
				instancePrototypeModel.EnableSecureBoot = core.BoolPtr(true)
				instancePrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				instancePrototypeModel.MetadataService = instanceMetadataServicePrototypeModel
				instancePrototypeModel.Name = core.StringPtr("my-instance")
				instancePrototypeModel.PlacementTarget = instancePlacementTargetPrototypeModel
				instancePrototypeModel.Profile = instanceProfileIdentityModel
				instancePrototypeModel.ReservationAffinity = instanceReservationAffinityPrototypeModel
				instancePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				instancePrototypeModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instancePrototypeModel.UserData = core.StringPtr("testString")
				instancePrototypeModel.VolumeAttachments = []vpcv1.VolumeAttachmentPrototype{*volumeAttachmentPrototypeModel}
				instancePrototypeModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instancePrototypeModel.VPC = vpcIdentityModel
				instancePrototypeModel.BootVolumeAttachment = volumeAttachmentPrototypeInstanceByImageContextModel
				instancePrototypeModel.Image = imageIdentityModel
				instancePrototypeModel.Zone = zoneIdentityModel
				instancePrototypeModel.NetworkInterfaces = []vpcv1.NetworkInterfacePrototype{*networkInterfacePrototypeModel}
				instancePrototypeModel.PrimaryNetworkInterface = networkInterfacePrototypeModel

				// Construct an instance of the CreateInstanceOptions model
				createInstanceOptionsModel := new(vpcv1.CreateInstanceOptions)
				createInstanceOptionsModel.InstancePrototype = instancePrototypeModel
				createInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateInstance(createInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateInstance(createInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstance(createInstanceOptions *CreateInstanceOptions)`, func() {
		version := "2024-06-23"
		createInstancePath := "/instances"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstancePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "amd", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "instance_group_membership": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "id": "r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "name": "my-instance-group-membership"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateInstance successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceAvailabilityPolicyPrototype model
				instanceAvailabilityPolicyPrototypeModel := new(vpcv1.InstanceAvailabilityPolicyPrototype)
				instanceAvailabilityPolicyPrototypeModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext)
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.Name = core.StringPtr("my-instance-network-attachment")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the InstanceDefaultTrustedProfilePrototype model
				instanceDefaultTrustedProfilePrototypeModel := new(vpcv1.InstanceDefaultTrustedProfilePrototype)
				instanceDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				instanceDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the InstanceMetadataServicePrototype model
				instanceMetadataServicePrototypeModel := new(vpcv1.InstanceMetadataServicePrototype)
				instanceMetadataServicePrototypeModel.Enabled = core.BoolPtr(false)
				instanceMetadataServicePrototypeModel.Protocol = core.StringPtr("https")
				instanceMetadataServicePrototypeModel.ResponseHopLimit = core.Int64Ptr(int64(2))

				// Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPrototypeModel := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPrototypeModel.ID = core.StringPtr("r006-418fe842-a3e9-47b9-a938-1aa5bd632871")

				// Construct an instance of the InstanceProfileIdentityByName model
				instanceProfileIdentityModel := new(vpcv1.InstanceProfileIdentityByName)
				instanceProfileIdentityModel.Name = core.StringPtr("bx2-2x8")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPrototype model
				instanceReservationAffinityPrototypeModel := new(vpcv1.InstanceReservationAffinityPrototype)
				instanceReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("5iops-tier")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity)
				volumeAttachmentPrototypeVolumeModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumeAttachmentPrototypeVolumeModel.Iops = core.Int64Ptr(int64(10000))
				volumeAttachmentPrototypeVolumeModel.Name = core.StringPtr("my-data-volume")
				volumeAttachmentPrototypeVolumeModel.Profile = volumeProfileIdentityModel
				volumeAttachmentPrototypeVolumeModel.ResourceGroup = resourceGroupIdentityModel
				volumeAttachmentPrototypeVolumeModel.UserTags = []string{}
				volumeAttachmentPrototypeVolumeModel.Capacity = core.Int64Ptr(int64(1000))
				volumeAttachmentPrototypeVolumeModel.EncryptionKey = encryptionKeyIdentityModel

				// Construct an instance of the VolumeAttachmentPrototype model
				volumeAttachmentPrototypeModel := new(vpcv1.VolumeAttachmentPrototype)
				volumeAttachmentPrototypeModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				volumeAttachmentPrototypeModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeModel.Volume = volumeAttachmentPrototypeVolumeModel

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VolumeAllowedUsePrototype model
				volumeAllowedUsePrototypeModel := new(vpcv1.VolumeAllowedUsePrototype)
				volumeAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the VolumePrototypeInstanceByImageContext model
				volumePrototypeInstanceByImageContextModel := new(vpcv1.VolumePrototypeInstanceByImageContext)
				volumePrototypeInstanceByImageContextModel.AllowedUse = volumeAllowedUsePrototypeModel
				volumePrototypeInstanceByImageContextModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeInstanceByImageContextModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeInstanceByImageContextModel.EncryptionKey = encryptionKeyIdentityModel
				volumePrototypeInstanceByImageContextModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeInstanceByImageContextModel.Name = core.StringPtr("my-boot-volume")
				volumePrototypeInstanceByImageContextModel.Profile = volumeProfileIdentityModel
				volumePrototypeInstanceByImageContextModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeInstanceByImageContextModel.UserTags = []string{}

				// Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model
				volumeAttachmentPrototypeInstanceByImageContextModel := new(vpcv1.VolumeAttachmentPrototypeInstanceByImageContext)
				volumeAttachmentPrototypeInstanceByImageContextModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPrototypeInstanceByImageContextModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeInstanceByImageContextModel.Volume = volumePrototypeInstanceByImageContextModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the NetworkInterfacePrototype model
				networkInterfacePrototypeModel := new(vpcv1.NetworkInterfacePrototype)
				networkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				networkInterfacePrototypeModel.Name = core.StringPtr("my-instance-network-interface")
				networkInterfacePrototypeModel.PrimaryIP = networkInterfaceIPPrototypeModel
				networkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				networkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface model
				instancePrototypeModel := new(vpcv1.InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface)
				instancePrototypeModel.AvailabilityPolicy = instanceAvailabilityPolicyPrototypeModel
				instancePrototypeModel.ClusterNetworkAttachments = []vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext{*instanceClusterNetworkAttachmentPrototypeInstanceContextModel}
				instancePrototypeModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instancePrototypeModel.DefaultTrustedProfile = instanceDefaultTrustedProfilePrototypeModel
				instancePrototypeModel.EnableSecureBoot = core.BoolPtr(true)
				instancePrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				instancePrototypeModel.MetadataService = instanceMetadataServicePrototypeModel
				instancePrototypeModel.Name = core.StringPtr("my-instance")
				instancePrototypeModel.PlacementTarget = instancePlacementTargetPrototypeModel
				instancePrototypeModel.Profile = instanceProfileIdentityModel
				instancePrototypeModel.ReservationAffinity = instanceReservationAffinityPrototypeModel
				instancePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				instancePrototypeModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instancePrototypeModel.UserData = core.StringPtr("testString")
				instancePrototypeModel.VolumeAttachments = []vpcv1.VolumeAttachmentPrototype{*volumeAttachmentPrototypeModel}
				instancePrototypeModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instancePrototypeModel.VPC = vpcIdentityModel
				instancePrototypeModel.BootVolumeAttachment = volumeAttachmentPrototypeInstanceByImageContextModel
				instancePrototypeModel.Image = imageIdentityModel
				instancePrototypeModel.Zone = zoneIdentityModel
				instancePrototypeModel.NetworkInterfaces = []vpcv1.NetworkInterfacePrototype{*networkInterfacePrototypeModel}
				instancePrototypeModel.PrimaryNetworkInterface = networkInterfacePrototypeModel

				// Construct an instance of the CreateInstanceOptions model
				createInstanceOptionsModel := new(vpcv1.CreateInstanceOptions)
				createInstanceOptionsModel.InstancePrototype = instancePrototypeModel
				createInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateInstanceWithContext(ctx, createInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateInstance(createInstanceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateInstanceWithContext(ctx, createInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstancePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "amd", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "instance_group_membership": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "id": "r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "name": "my-instance-group-membership"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateInstance successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateInstance(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceAvailabilityPolicyPrototype model
				instanceAvailabilityPolicyPrototypeModel := new(vpcv1.InstanceAvailabilityPolicyPrototype)
				instanceAvailabilityPolicyPrototypeModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext)
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.Name = core.StringPtr("my-instance-network-attachment")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the InstanceDefaultTrustedProfilePrototype model
				instanceDefaultTrustedProfilePrototypeModel := new(vpcv1.InstanceDefaultTrustedProfilePrototype)
				instanceDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				instanceDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the InstanceMetadataServicePrototype model
				instanceMetadataServicePrototypeModel := new(vpcv1.InstanceMetadataServicePrototype)
				instanceMetadataServicePrototypeModel.Enabled = core.BoolPtr(false)
				instanceMetadataServicePrototypeModel.Protocol = core.StringPtr("https")
				instanceMetadataServicePrototypeModel.ResponseHopLimit = core.Int64Ptr(int64(2))

				// Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPrototypeModel := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPrototypeModel.ID = core.StringPtr("r006-418fe842-a3e9-47b9-a938-1aa5bd632871")

				// Construct an instance of the InstanceProfileIdentityByName model
				instanceProfileIdentityModel := new(vpcv1.InstanceProfileIdentityByName)
				instanceProfileIdentityModel.Name = core.StringPtr("bx2-2x8")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPrototype model
				instanceReservationAffinityPrototypeModel := new(vpcv1.InstanceReservationAffinityPrototype)
				instanceReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("5iops-tier")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity)
				volumeAttachmentPrototypeVolumeModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumeAttachmentPrototypeVolumeModel.Iops = core.Int64Ptr(int64(10000))
				volumeAttachmentPrototypeVolumeModel.Name = core.StringPtr("my-data-volume")
				volumeAttachmentPrototypeVolumeModel.Profile = volumeProfileIdentityModel
				volumeAttachmentPrototypeVolumeModel.ResourceGroup = resourceGroupIdentityModel
				volumeAttachmentPrototypeVolumeModel.UserTags = []string{}
				volumeAttachmentPrototypeVolumeModel.Capacity = core.Int64Ptr(int64(1000))
				volumeAttachmentPrototypeVolumeModel.EncryptionKey = encryptionKeyIdentityModel

				// Construct an instance of the VolumeAttachmentPrototype model
				volumeAttachmentPrototypeModel := new(vpcv1.VolumeAttachmentPrototype)
				volumeAttachmentPrototypeModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				volumeAttachmentPrototypeModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeModel.Volume = volumeAttachmentPrototypeVolumeModel

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VolumeAllowedUsePrototype model
				volumeAllowedUsePrototypeModel := new(vpcv1.VolumeAllowedUsePrototype)
				volumeAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the VolumePrototypeInstanceByImageContext model
				volumePrototypeInstanceByImageContextModel := new(vpcv1.VolumePrototypeInstanceByImageContext)
				volumePrototypeInstanceByImageContextModel.AllowedUse = volumeAllowedUsePrototypeModel
				volumePrototypeInstanceByImageContextModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeInstanceByImageContextModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeInstanceByImageContextModel.EncryptionKey = encryptionKeyIdentityModel
				volumePrototypeInstanceByImageContextModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeInstanceByImageContextModel.Name = core.StringPtr("my-boot-volume")
				volumePrototypeInstanceByImageContextModel.Profile = volumeProfileIdentityModel
				volumePrototypeInstanceByImageContextModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeInstanceByImageContextModel.UserTags = []string{}

				// Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model
				volumeAttachmentPrototypeInstanceByImageContextModel := new(vpcv1.VolumeAttachmentPrototypeInstanceByImageContext)
				volumeAttachmentPrototypeInstanceByImageContextModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPrototypeInstanceByImageContextModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeInstanceByImageContextModel.Volume = volumePrototypeInstanceByImageContextModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the NetworkInterfacePrototype model
				networkInterfacePrototypeModel := new(vpcv1.NetworkInterfacePrototype)
				networkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				networkInterfacePrototypeModel.Name = core.StringPtr("my-instance-network-interface")
				networkInterfacePrototypeModel.PrimaryIP = networkInterfaceIPPrototypeModel
				networkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				networkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface model
				instancePrototypeModel := new(vpcv1.InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface)
				instancePrototypeModel.AvailabilityPolicy = instanceAvailabilityPolicyPrototypeModel
				instancePrototypeModel.ClusterNetworkAttachments = []vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext{*instanceClusterNetworkAttachmentPrototypeInstanceContextModel}
				instancePrototypeModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instancePrototypeModel.DefaultTrustedProfile = instanceDefaultTrustedProfilePrototypeModel
				instancePrototypeModel.EnableSecureBoot = core.BoolPtr(true)
				instancePrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				instancePrototypeModel.MetadataService = instanceMetadataServicePrototypeModel
				instancePrototypeModel.Name = core.StringPtr("my-instance")
				instancePrototypeModel.PlacementTarget = instancePlacementTargetPrototypeModel
				instancePrototypeModel.Profile = instanceProfileIdentityModel
				instancePrototypeModel.ReservationAffinity = instanceReservationAffinityPrototypeModel
				instancePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				instancePrototypeModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instancePrototypeModel.UserData = core.StringPtr("testString")
				instancePrototypeModel.VolumeAttachments = []vpcv1.VolumeAttachmentPrototype{*volumeAttachmentPrototypeModel}
				instancePrototypeModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instancePrototypeModel.VPC = vpcIdentityModel
				instancePrototypeModel.BootVolumeAttachment = volumeAttachmentPrototypeInstanceByImageContextModel
				instancePrototypeModel.Image = imageIdentityModel
				instancePrototypeModel.Zone = zoneIdentityModel
				instancePrototypeModel.NetworkInterfaces = []vpcv1.NetworkInterfacePrototype{*networkInterfacePrototypeModel}
				instancePrototypeModel.PrimaryNetworkInterface = networkInterfacePrototypeModel

				// Construct an instance of the CreateInstanceOptions model
				createInstanceOptionsModel := new(vpcv1.CreateInstanceOptions)
				createInstanceOptionsModel.InstancePrototype = instancePrototypeModel
				createInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateInstance(createInstanceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateInstance with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceAvailabilityPolicyPrototype model
				instanceAvailabilityPolicyPrototypeModel := new(vpcv1.InstanceAvailabilityPolicyPrototype)
				instanceAvailabilityPolicyPrototypeModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext)
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.Name = core.StringPtr("my-instance-network-attachment")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the InstanceDefaultTrustedProfilePrototype model
				instanceDefaultTrustedProfilePrototypeModel := new(vpcv1.InstanceDefaultTrustedProfilePrototype)
				instanceDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				instanceDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the InstanceMetadataServicePrototype model
				instanceMetadataServicePrototypeModel := new(vpcv1.InstanceMetadataServicePrototype)
				instanceMetadataServicePrototypeModel.Enabled = core.BoolPtr(false)
				instanceMetadataServicePrototypeModel.Protocol = core.StringPtr("https")
				instanceMetadataServicePrototypeModel.ResponseHopLimit = core.Int64Ptr(int64(2))

				// Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPrototypeModel := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPrototypeModel.ID = core.StringPtr("r006-418fe842-a3e9-47b9-a938-1aa5bd632871")

				// Construct an instance of the InstanceProfileIdentityByName model
				instanceProfileIdentityModel := new(vpcv1.InstanceProfileIdentityByName)
				instanceProfileIdentityModel.Name = core.StringPtr("bx2-2x8")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPrototype model
				instanceReservationAffinityPrototypeModel := new(vpcv1.InstanceReservationAffinityPrototype)
				instanceReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("5iops-tier")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity)
				volumeAttachmentPrototypeVolumeModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumeAttachmentPrototypeVolumeModel.Iops = core.Int64Ptr(int64(10000))
				volumeAttachmentPrototypeVolumeModel.Name = core.StringPtr("my-data-volume")
				volumeAttachmentPrototypeVolumeModel.Profile = volumeProfileIdentityModel
				volumeAttachmentPrototypeVolumeModel.ResourceGroup = resourceGroupIdentityModel
				volumeAttachmentPrototypeVolumeModel.UserTags = []string{}
				volumeAttachmentPrototypeVolumeModel.Capacity = core.Int64Ptr(int64(1000))
				volumeAttachmentPrototypeVolumeModel.EncryptionKey = encryptionKeyIdentityModel

				// Construct an instance of the VolumeAttachmentPrototype model
				volumeAttachmentPrototypeModel := new(vpcv1.VolumeAttachmentPrototype)
				volumeAttachmentPrototypeModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				volumeAttachmentPrototypeModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeModel.Volume = volumeAttachmentPrototypeVolumeModel

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VolumeAllowedUsePrototype model
				volumeAllowedUsePrototypeModel := new(vpcv1.VolumeAllowedUsePrototype)
				volumeAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the VolumePrototypeInstanceByImageContext model
				volumePrototypeInstanceByImageContextModel := new(vpcv1.VolumePrototypeInstanceByImageContext)
				volumePrototypeInstanceByImageContextModel.AllowedUse = volumeAllowedUsePrototypeModel
				volumePrototypeInstanceByImageContextModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeInstanceByImageContextModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeInstanceByImageContextModel.EncryptionKey = encryptionKeyIdentityModel
				volumePrototypeInstanceByImageContextModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeInstanceByImageContextModel.Name = core.StringPtr("my-boot-volume")
				volumePrototypeInstanceByImageContextModel.Profile = volumeProfileIdentityModel
				volumePrototypeInstanceByImageContextModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeInstanceByImageContextModel.UserTags = []string{}

				// Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model
				volumeAttachmentPrototypeInstanceByImageContextModel := new(vpcv1.VolumeAttachmentPrototypeInstanceByImageContext)
				volumeAttachmentPrototypeInstanceByImageContextModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPrototypeInstanceByImageContextModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeInstanceByImageContextModel.Volume = volumePrototypeInstanceByImageContextModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the NetworkInterfacePrototype model
				networkInterfacePrototypeModel := new(vpcv1.NetworkInterfacePrototype)
				networkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				networkInterfacePrototypeModel.Name = core.StringPtr("my-instance-network-interface")
				networkInterfacePrototypeModel.PrimaryIP = networkInterfaceIPPrototypeModel
				networkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				networkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface model
				instancePrototypeModel := new(vpcv1.InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface)
				instancePrototypeModel.AvailabilityPolicy = instanceAvailabilityPolicyPrototypeModel
				instancePrototypeModel.ClusterNetworkAttachments = []vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext{*instanceClusterNetworkAttachmentPrototypeInstanceContextModel}
				instancePrototypeModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instancePrototypeModel.DefaultTrustedProfile = instanceDefaultTrustedProfilePrototypeModel
				instancePrototypeModel.EnableSecureBoot = core.BoolPtr(true)
				instancePrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				instancePrototypeModel.MetadataService = instanceMetadataServicePrototypeModel
				instancePrototypeModel.Name = core.StringPtr("my-instance")
				instancePrototypeModel.PlacementTarget = instancePlacementTargetPrototypeModel
				instancePrototypeModel.Profile = instanceProfileIdentityModel
				instancePrototypeModel.ReservationAffinity = instanceReservationAffinityPrototypeModel
				instancePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				instancePrototypeModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instancePrototypeModel.UserData = core.StringPtr("testString")
				instancePrototypeModel.VolumeAttachments = []vpcv1.VolumeAttachmentPrototype{*volumeAttachmentPrototypeModel}
				instancePrototypeModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instancePrototypeModel.VPC = vpcIdentityModel
				instancePrototypeModel.BootVolumeAttachment = volumeAttachmentPrototypeInstanceByImageContextModel
				instancePrototypeModel.Image = imageIdentityModel
				instancePrototypeModel.Zone = zoneIdentityModel
				instancePrototypeModel.NetworkInterfaces = []vpcv1.NetworkInterfacePrototype{*networkInterfacePrototypeModel}
				instancePrototypeModel.PrimaryNetworkInterface = networkInterfacePrototypeModel

				// Construct an instance of the CreateInstanceOptions model
				createInstanceOptionsModel := new(vpcv1.CreateInstanceOptions)
				createInstanceOptionsModel.InstancePrototype = instancePrototypeModel
				createInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateInstance(createInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateInstanceOptions model with no property values
				createInstanceOptionsModelNew := new(vpcv1.CreateInstanceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateInstance(createInstanceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateInstance successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceAvailabilityPolicyPrototype model
				instanceAvailabilityPolicyPrototypeModel := new(vpcv1.InstanceAvailabilityPolicyPrototype)
				instanceAvailabilityPolicyPrototypeModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext)
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.Name = core.StringPtr("my-instance-network-attachment")

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

				// Construct an instance of the InstanceDefaultTrustedProfilePrototype model
				instanceDefaultTrustedProfilePrototypeModel := new(vpcv1.InstanceDefaultTrustedProfilePrototype)
				instanceDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				instanceDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

				// Construct an instance of the InstanceMetadataServicePrototype model
				instanceMetadataServicePrototypeModel := new(vpcv1.InstanceMetadataServicePrototype)
				instanceMetadataServicePrototypeModel.Enabled = core.BoolPtr(false)
				instanceMetadataServicePrototypeModel.Protocol = core.StringPtr("https")
				instanceMetadataServicePrototypeModel.ResponseHopLimit = core.Int64Ptr(int64(2))

				// Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPrototypeModel := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPrototypeModel.ID = core.StringPtr("r006-418fe842-a3e9-47b9-a938-1aa5bd632871")

				// Construct an instance of the InstanceProfileIdentityByName model
				instanceProfileIdentityModel := new(vpcv1.InstanceProfileIdentityByName)
				instanceProfileIdentityModel.Name = core.StringPtr("bx2-2x8")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPrototype model
				instanceReservationAffinityPrototypeModel := new(vpcv1.InstanceReservationAffinityPrototype)
				instanceReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("5iops-tier")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity)
				volumeAttachmentPrototypeVolumeModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumeAttachmentPrototypeVolumeModel.Iops = core.Int64Ptr(int64(10000))
				volumeAttachmentPrototypeVolumeModel.Name = core.StringPtr("my-data-volume")
				volumeAttachmentPrototypeVolumeModel.Profile = volumeProfileIdentityModel
				volumeAttachmentPrototypeVolumeModel.ResourceGroup = resourceGroupIdentityModel
				volumeAttachmentPrototypeVolumeModel.UserTags = []string{}
				volumeAttachmentPrototypeVolumeModel.Capacity = core.Int64Ptr(int64(1000))
				volumeAttachmentPrototypeVolumeModel.EncryptionKey = encryptionKeyIdentityModel

				// Construct an instance of the VolumeAttachmentPrototype model
				volumeAttachmentPrototypeModel := new(vpcv1.VolumeAttachmentPrototype)
				volumeAttachmentPrototypeModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				volumeAttachmentPrototypeModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeModel.Volume = volumeAttachmentPrototypeVolumeModel

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VolumeAllowedUsePrototype model
				volumeAllowedUsePrototypeModel := new(vpcv1.VolumeAllowedUsePrototype)
				volumeAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the VolumePrototypeInstanceByImageContext model
				volumePrototypeInstanceByImageContextModel := new(vpcv1.VolumePrototypeInstanceByImageContext)
				volumePrototypeInstanceByImageContextModel.AllowedUse = volumeAllowedUsePrototypeModel
				volumePrototypeInstanceByImageContextModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeInstanceByImageContextModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeInstanceByImageContextModel.EncryptionKey = encryptionKeyIdentityModel
				volumePrototypeInstanceByImageContextModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeInstanceByImageContextModel.Name = core.StringPtr("my-boot-volume")
				volumePrototypeInstanceByImageContextModel.Profile = volumeProfileIdentityModel
				volumePrototypeInstanceByImageContextModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeInstanceByImageContextModel.UserTags = []string{}

				// Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model
				volumeAttachmentPrototypeInstanceByImageContextModel := new(vpcv1.VolumeAttachmentPrototypeInstanceByImageContext)
				volumeAttachmentPrototypeInstanceByImageContextModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPrototypeInstanceByImageContextModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeInstanceByImageContextModel.Volume = volumePrototypeInstanceByImageContextModel

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the NetworkInterfacePrototype model
				networkInterfacePrototypeModel := new(vpcv1.NetworkInterfacePrototype)
				networkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				networkInterfacePrototypeModel.Name = core.StringPtr("my-instance-network-interface")
				networkInterfacePrototypeModel.PrimaryIP = networkInterfaceIPPrototypeModel
				networkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				networkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface model
				instancePrototypeModel := new(vpcv1.InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface)
				instancePrototypeModel.AvailabilityPolicy = instanceAvailabilityPolicyPrototypeModel
				instancePrototypeModel.ClusterNetworkAttachments = []vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext{*instanceClusterNetworkAttachmentPrototypeInstanceContextModel}
				instancePrototypeModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instancePrototypeModel.DefaultTrustedProfile = instanceDefaultTrustedProfilePrototypeModel
				instancePrototypeModel.EnableSecureBoot = core.BoolPtr(true)
				instancePrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				instancePrototypeModel.MetadataService = instanceMetadataServicePrototypeModel
				instancePrototypeModel.Name = core.StringPtr("my-instance")
				instancePrototypeModel.PlacementTarget = instancePlacementTargetPrototypeModel
				instancePrototypeModel.Profile = instanceProfileIdentityModel
				instancePrototypeModel.ReservationAffinity = instanceReservationAffinityPrototypeModel
				instancePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				instancePrototypeModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instancePrototypeModel.UserData = core.StringPtr("testString")
				instancePrototypeModel.VolumeAttachments = []vpcv1.VolumeAttachmentPrototype{*volumeAttachmentPrototypeModel}
				instancePrototypeModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instancePrototypeModel.VPC = vpcIdentityModel
				instancePrototypeModel.BootVolumeAttachment = volumeAttachmentPrototypeInstanceByImageContextModel
				instancePrototypeModel.Image = imageIdentityModel
				instancePrototypeModel.Zone = zoneIdentityModel
				instancePrototypeModel.NetworkInterfaces = []vpcv1.NetworkInterfacePrototype{*networkInterfacePrototypeModel}
				instancePrototypeModel.PrimaryNetworkInterface = networkInterfacePrototypeModel

				// Construct an instance of the CreateInstanceOptions model
				createInstanceOptionsModel := new(vpcv1.CreateInstanceOptions)
				createInstanceOptionsModel.InstancePrototype = instancePrototypeModel
				createInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateInstance(createInstanceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteInstance(deleteInstanceOptions *DeleteInstanceOptions)`, func() {
		version := "2024-06-23"
		deleteInstancePath := "/instances/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstancePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteInstance successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteInstance(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteInstanceOptions model
				deleteInstanceOptionsModel := new(vpcv1.DeleteInstanceOptions)
				deleteInstanceOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteInstance(deleteInstanceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteInstance with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceOptions model
				deleteInstanceOptionsModel := new(vpcv1.DeleteInstanceOptions)
				deleteInstanceOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteInstance(deleteInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteInstanceOptions model with no property values
				deleteInstanceOptionsModelNew := new(vpcv1.DeleteInstanceOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteInstance(deleteInstanceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstance(getInstanceOptions *GetInstanceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstancePath := "/instances/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstancePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstance with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceOptions model
				getInstanceOptionsModel := new(vpcv1.GetInstanceOptions)
				getInstanceOptionsModel.ID = core.StringPtr("testString")
				getInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstance(getInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstance(getInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstance(getInstanceOptions *GetInstanceOptions)`, func() {
		version := "2024-06-23"
		getInstancePath := "/instances/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstancePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "amd", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "instance_group_membership": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "id": "r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "name": "my-instance-group-membership"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetInstance successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceOptions model
				getInstanceOptionsModel := new(vpcv1.GetInstanceOptions)
				getInstanceOptionsModel.ID = core.StringPtr("testString")
				getInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceWithContext(ctx, getInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstance(getInstanceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceWithContext(ctx, getInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstancePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "amd", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "instance_group_membership": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "id": "r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "name": "my-instance-group-membership"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetInstance successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstance(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceOptions model
				getInstanceOptionsModel := new(vpcv1.GetInstanceOptions)
				getInstanceOptionsModel.ID = core.StringPtr("testString")
				getInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstance(getInstanceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstance with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceOptions model
				getInstanceOptionsModel := new(vpcv1.GetInstanceOptions)
				getInstanceOptionsModel.ID = core.StringPtr("testString")
				getInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstance(getInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceOptions model with no property values
				getInstanceOptionsModelNew := new(vpcv1.GetInstanceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstance(getInstanceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstance successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceOptions model
				getInstanceOptionsModel := new(vpcv1.GetInstanceOptions)
				getInstanceOptionsModel.ID = core.StringPtr("testString")
				getInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstance(getInstanceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstance(updateInstanceOptions *UpdateInstanceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateInstancePath := "/instances/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstancePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateInstance with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceAvailabilityPolicyPatch model
				instanceAvailabilityPolicyPatchModel := new(vpcv1.InstanceAvailabilityPolicyPatch)
				instanceAvailabilityPolicyPatchModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the InstanceMetadataServicePatch model
				instanceMetadataServicePatchModel := new(vpcv1.InstanceMetadataServicePatch)
				instanceMetadataServicePatchModel.Enabled = core.BoolPtr(true)
				instanceMetadataServicePatchModel.Protocol = core.StringPtr("http")
				instanceMetadataServicePatchModel.ResponseHopLimit = core.Int64Ptr(int64(1))

				// Construct an instance of the InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPatchModel := new(vpcv1.InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPatchModel.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

				// Construct an instance of the InstancePatchProfileInstanceProfileIdentityByName model
				instancePatchProfileModel := new(vpcv1.InstancePatchProfileInstanceProfileIdentityByName)
				instancePatchProfileModel.Name = core.StringPtr("bx2-4x16")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPatch model
				instanceReservationAffinityPatchModel := new(vpcv1.InstanceReservationAffinityPatch)
				instanceReservationAffinityPatchModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPatchModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the InstancePatch model
				instancePatchModel := new(vpcv1.InstancePatch)
				instancePatchModel.AvailabilityPolicy = instanceAvailabilityPolicyPatchModel
				instancePatchModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instancePatchModel.EnableSecureBoot = core.BoolPtr(true)
				instancePatchModel.MetadataService = instanceMetadataServicePatchModel
				instancePatchModel.Name = core.StringPtr("my-instance")
				instancePatchModel.PlacementTarget = instancePlacementTargetPatchModel
				instancePatchModel.Profile = instancePatchProfileModel
				instancePatchModel.ReservationAffinity = instanceReservationAffinityPatchModel
				instancePatchModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instancePatchModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instancePatchModelAsPatch, asPatchErr := instancePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceOptions model
				updateInstanceOptionsModel := new(vpcv1.UpdateInstanceOptions)
				updateInstanceOptionsModel.ID = core.StringPtr("testString")
				updateInstanceOptionsModel.InstancePatch = instancePatchModelAsPatch
				updateInstanceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateInstance(updateInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateInstance(updateInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstance(updateInstanceOptions *UpdateInstanceOptions)`, func() {
		version := "2024-06-23"
		updateInstancePath := "/instances/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstancePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "amd", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "instance_group_membership": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "id": "r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "name": "my-instance-group-membership"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateInstance successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceAvailabilityPolicyPatch model
				instanceAvailabilityPolicyPatchModel := new(vpcv1.InstanceAvailabilityPolicyPatch)
				instanceAvailabilityPolicyPatchModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the InstanceMetadataServicePatch model
				instanceMetadataServicePatchModel := new(vpcv1.InstanceMetadataServicePatch)
				instanceMetadataServicePatchModel.Enabled = core.BoolPtr(true)
				instanceMetadataServicePatchModel.Protocol = core.StringPtr("http")
				instanceMetadataServicePatchModel.ResponseHopLimit = core.Int64Ptr(int64(1))

				// Construct an instance of the InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPatchModel := new(vpcv1.InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPatchModel.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

				// Construct an instance of the InstancePatchProfileInstanceProfileIdentityByName model
				instancePatchProfileModel := new(vpcv1.InstancePatchProfileInstanceProfileIdentityByName)
				instancePatchProfileModel.Name = core.StringPtr("bx2-4x16")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPatch model
				instanceReservationAffinityPatchModel := new(vpcv1.InstanceReservationAffinityPatch)
				instanceReservationAffinityPatchModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPatchModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the InstancePatch model
				instancePatchModel := new(vpcv1.InstancePatch)
				instancePatchModel.AvailabilityPolicy = instanceAvailabilityPolicyPatchModel
				instancePatchModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instancePatchModel.EnableSecureBoot = core.BoolPtr(true)
				instancePatchModel.MetadataService = instanceMetadataServicePatchModel
				instancePatchModel.Name = core.StringPtr("my-instance")
				instancePatchModel.PlacementTarget = instancePlacementTargetPatchModel
				instancePatchModel.Profile = instancePatchProfileModel
				instancePatchModel.ReservationAffinity = instanceReservationAffinityPatchModel
				instancePatchModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instancePatchModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instancePatchModelAsPatch, asPatchErr := instancePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceOptions model
				updateInstanceOptionsModel := new(vpcv1.UpdateInstanceOptions)
				updateInstanceOptionsModel.ID = core.StringPtr("testString")
				updateInstanceOptionsModel.InstancePatch = instancePatchModelAsPatch
				updateInstanceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateInstanceWithContext(ctx, updateInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateInstance(updateInstanceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateInstanceWithContext(ctx, updateInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstancePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "amd", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "instance_group_membership": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "id": "r006-32c8210b-fd1a-409f-8966-de85bbfd3741", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "name": "my-instance-group-membership"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "automatic", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "volume_bandwidth_qos_mode": "pooled", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateInstance successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateInstance(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceAvailabilityPolicyPatch model
				instanceAvailabilityPolicyPatchModel := new(vpcv1.InstanceAvailabilityPolicyPatch)
				instanceAvailabilityPolicyPatchModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the InstanceMetadataServicePatch model
				instanceMetadataServicePatchModel := new(vpcv1.InstanceMetadataServicePatch)
				instanceMetadataServicePatchModel.Enabled = core.BoolPtr(true)
				instanceMetadataServicePatchModel.Protocol = core.StringPtr("http")
				instanceMetadataServicePatchModel.ResponseHopLimit = core.Int64Ptr(int64(1))

				// Construct an instance of the InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPatchModel := new(vpcv1.InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPatchModel.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

				// Construct an instance of the InstancePatchProfileInstanceProfileIdentityByName model
				instancePatchProfileModel := new(vpcv1.InstancePatchProfileInstanceProfileIdentityByName)
				instancePatchProfileModel.Name = core.StringPtr("bx2-4x16")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPatch model
				instanceReservationAffinityPatchModel := new(vpcv1.InstanceReservationAffinityPatch)
				instanceReservationAffinityPatchModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPatchModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the InstancePatch model
				instancePatchModel := new(vpcv1.InstancePatch)
				instancePatchModel.AvailabilityPolicy = instanceAvailabilityPolicyPatchModel
				instancePatchModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instancePatchModel.EnableSecureBoot = core.BoolPtr(true)
				instancePatchModel.MetadataService = instanceMetadataServicePatchModel
				instancePatchModel.Name = core.StringPtr("my-instance")
				instancePatchModel.PlacementTarget = instancePlacementTargetPatchModel
				instancePatchModel.Profile = instancePatchProfileModel
				instancePatchModel.ReservationAffinity = instanceReservationAffinityPatchModel
				instancePatchModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instancePatchModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instancePatchModelAsPatch, asPatchErr := instancePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceOptions model
				updateInstanceOptionsModel := new(vpcv1.UpdateInstanceOptions)
				updateInstanceOptionsModel.ID = core.StringPtr("testString")
				updateInstanceOptionsModel.InstancePatch = instancePatchModelAsPatch
				updateInstanceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateInstance(updateInstanceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateInstance with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceAvailabilityPolicyPatch model
				instanceAvailabilityPolicyPatchModel := new(vpcv1.InstanceAvailabilityPolicyPatch)
				instanceAvailabilityPolicyPatchModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the InstanceMetadataServicePatch model
				instanceMetadataServicePatchModel := new(vpcv1.InstanceMetadataServicePatch)
				instanceMetadataServicePatchModel.Enabled = core.BoolPtr(true)
				instanceMetadataServicePatchModel.Protocol = core.StringPtr("http")
				instanceMetadataServicePatchModel.ResponseHopLimit = core.Int64Ptr(int64(1))

				// Construct an instance of the InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPatchModel := new(vpcv1.InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPatchModel.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

				// Construct an instance of the InstancePatchProfileInstanceProfileIdentityByName model
				instancePatchProfileModel := new(vpcv1.InstancePatchProfileInstanceProfileIdentityByName)
				instancePatchProfileModel.Name = core.StringPtr("bx2-4x16")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPatch model
				instanceReservationAffinityPatchModel := new(vpcv1.InstanceReservationAffinityPatch)
				instanceReservationAffinityPatchModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPatchModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the InstancePatch model
				instancePatchModel := new(vpcv1.InstancePatch)
				instancePatchModel.AvailabilityPolicy = instanceAvailabilityPolicyPatchModel
				instancePatchModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instancePatchModel.EnableSecureBoot = core.BoolPtr(true)
				instancePatchModel.MetadataService = instanceMetadataServicePatchModel
				instancePatchModel.Name = core.StringPtr("my-instance")
				instancePatchModel.PlacementTarget = instancePlacementTargetPatchModel
				instancePatchModel.Profile = instancePatchProfileModel
				instancePatchModel.ReservationAffinity = instanceReservationAffinityPatchModel
				instancePatchModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instancePatchModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instancePatchModelAsPatch, asPatchErr := instancePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceOptions model
				updateInstanceOptionsModel := new(vpcv1.UpdateInstanceOptions)
				updateInstanceOptionsModel.ID = core.StringPtr("testString")
				updateInstanceOptionsModel.InstancePatch = instancePatchModelAsPatch
				updateInstanceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateInstance(updateInstanceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateInstanceOptions model with no property values
				updateInstanceOptionsModelNew := new(vpcv1.UpdateInstanceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateInstance(updateInstanceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateInstance successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceAvailabilityPolicyPatch model
				instanceAvailabilityPolicyPatchModel := new(vpcv1.InstanceAvailabilityPolicyPatch)
				instanceAvailabilityPolicyPatchModel.HostFailure = core.StringPtr("restart")

				// Construct an instance of the InstanceMetadataServicePatch model
				instanceMetadataServicePatchModel := new(vpcv1.InstanceMetadataServicePatch)
				instanceMetadataServicePatchModel.Enabled = core.BoolPtr(true)
				instanceMetadataServicePatchModel.Protocol = core.StringPtr("http")
				instanceMetadataServicePatchModel.ResponseHopLimit = core.Int64Ptr(int64(1))

				// Construct an instance of the InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPatchModel := new(vpcv1.InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID)
				instancePlacementTargetPatchModel.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

				// Construct an instance of the InstancePatchProfileInstanceProfileIdentityByName model
				instancePatchProfileModel := new(vpcv1.InstancePatchProfileInstanceProfileIdentityByName)
				instancePatchProfileModel.Name = core.StringPtr("bx2-4x16")

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

				// Construct an instance of the InstanceReservationAffinityPatch model
				instanceReservationAffinityPatchModel := new(vpcv1.InstanceReservationAffinityPatch)
				instanceReservationAffinityPatchModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPatchModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}

				// Construct an instance of the InstancePatch model
				instancePatchModel := new(vpcv1.InstancePatch)
				instancePatchModel.AvailabilityPolicy = instanceAvailabilityPolicyPatchModel
				instancePatchModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instancePatchModel.EnableSecureBoot = core.BoolPtr(true)
				instancePatchModel.MetadataService = instanceMetadataServicePatchModel
				instancePatchModel.Name = core.StringPtr("my-instance")
				instancePatchModel.PlacementTarget = instancePlacementTargetPatchModel
				instancePatchModel.Profile = instancePatchProfileModel
				instancePatchModel.ReservationAffinity = instanceReservationAffinityPatchModel
				instancePatchModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instancePatchModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instancePatchModelAsPatch, asPatchErr := instancePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceOptions model
				updateInstanceOptionsModel := new(vpcv1.UpdateInstanceOptions)
				updateInstanceOptionsModel.ID = core.StringPtr("testString")
				updateInstanceOptionsModel.InstancePatch = instancePatchModelAsPatch
				updateInstanceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateInstance(updateInstanceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceInitialization(getInstanceInitializationOptions *GetInstanceInitializationOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceInitializationPath := "/instances/testString/initialization"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceInitializationPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceInitialization with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceInitializationOptions model
				getInstanceInitializationOptionsModel := new(vpcv1.GetInstanceInitializationOptions)
				getInstanceInitializationOptionsModel.ID = core.StringPtr("testString")
				getInstanceInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceInitialization(getInstanceInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceInitialization(getInstanceInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceInitialization(getInstanceInitializationOptions *GetInstanceInitializationOptions)`, func() {
		version := "2024-06-23"
		getInstanceInitializationPath := "/instances/testString/initialization"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceInitializationPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "resource_type": "trusted_profile"}}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "password": {"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}`)
				}))
			})
			It(`Invoke GetInstanceInitialization successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceInitializationOptions model
				getInstanceInitializationOptionsModel := new(vpcv1.GetInstanceInitializationOptions)
				getInstanceInitializationOptionsModel.ID = core.StringPtr("testString")
				getInstanceInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceInitializationWithContext(ctx, getInstanceInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceInitialization(getInstanceInitializationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceInitializationWithContext(ctx, getInstanceInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceInitializationPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "resource_type": "trusted_profile"}}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "password": {"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}`)
				}))
			})
			It(`Invoke GetInstanceInitialization successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceInitialization(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceInitializationOptions model
				getInstanceInitializationOptionsModel := new(vpcv1.GetInstanceInitializationOptions)
				getInstanceInitializationOptionsModel.ID = core.StringPtr("testString")
				getInstanceInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceInitialization(getInstanceInitializationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceInitialization with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceInitializationOptions model
				getInstanceInitializationOptionsModel := new(vpcv1.GetInstanceInitializationOptions)
				getInstanceInitializationOptionsModel.ID = core.StringPtr("testString")
				getInstanceInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceInitialization(getInstanceInitializationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceInitializationOptions model with no property values
				getInstanceInitializationOptionsModelNew := new(vpcv1.GetInstanceInitializationOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceInitialization(getInstanceInitializationOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceInitialization successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceInitializationOptions model
				getInstanceInitializationOptionsModel := new(vpcv1.GetInstanceInitializationOptions)
				getInstanceInitializationOptionsModel.ID = core.StringPtr("testString")
				getInstanceInitializationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceInitialization(getInstanceInitializationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceAction(createInstanceActionOptions *CreateInstanceActionOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createInstanceActionPath := "/instances/testString/actions"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceActionPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateInstanceAction with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateInstanceActionOptions model
				createInstanceActionOptionsModel := new(vpcv1.CreateInstanceActionOptions)
				createInstanceActionOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceActionOptionsModel.Type = core.StringPtr("reboot")
				createInstanceActionOptionsModel.Force = core.BoolPtr(true)
				createInstanceActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateInstanceAction(createInstanceActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateInstanceAction(createInstanceActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceAction(createInstanceActionOptions *CreateInstanceActionOptions)`, func() {
		version := "2024-06-23"
		createInstanceActionPath := "/instances/testString/actions"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceActionPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "force": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/actions/109a1b6e-1242-4de1-be44-38705e9474ed", "id": "109a1b6e-1242-4de1-be44-38705e9474ed", "started_at": "2019-01-01T12:00:00.000Z", "status": "completed", "type": "reboot"}`)
				}))
			})
			It(`Invoke CreateInstanceAction successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the CreateInstanceActionOptions model
				createInstanceActionOptionsModel := new(vpcv1.CreateInstanceActionOptions)
				createInstanceActionOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceActionOptionsModel.Type = core.StringPtr("reboot")
				createInstanceActionOptionsModel.Force = core.BoolPtr(true)
				createInstanceActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateInstanceActionWithContext(ctx, createInstanceActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateInstanceAction(createInstanceActionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateInstanceActionWithContext(ctx, createInstanceActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceActionPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "force": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/actions/109a1b6e-1242-4de1-be44-38705e9474ed", "id": "109a1b6e-1242-4de1-be44-38705e9474ed", "started_at": "2019-01-01T12:00:00.000Z", "status": "completed", "type": "reboot"}`)
				}))
			})
			It(`Invoke CreateInstanceAction successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateInstanceAction(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the CreateInstanceActionOptions model
				createInstanceActionOptionsModel := new(vpcv1.CreateInstanceActionOptions)
				createInstanceActionOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceActionOptionsModel.Type = core.StringPtr("reboot")
				createInstanceActionOptionsModel.Force = core.BoolPtr(true)
				createInstanceActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateInstanceAction(createInstanceActionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateInstanceAction with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateInstanceActionOptions model
				createInstanceActionOptionsModel := new(vpcv1.CreateInstanceActionOptions)
				createInstanceActionOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceActionOptionsModel.Type = core.StringPtr("reboot")
				createInstanceActionOptionsModel.Force = core.BoolPtr(true)
				createInstanceActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateInstanceAction(createInstanceActionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateInstanceActionOptions model with no property values
				createInstanceActionOptionsModelNew := new(vpcv1.CreateInstanceActionOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateInstanceAction(createInstanceActionOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateInstanceAction successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateInstanceActionOptions model
				createInstanceActionOptionsModel := new(vpcv1.CreateInstanceActionOptions)
				createInstanceActionOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceActionOptionsModel.Type = core.StringPtr("reboot")
				createInstanceActionOptionsModel.Force = core.BoolPtr(true)
				createInstanceActionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateInstanceAction(createInstanceActionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceClusterNetworkAttachments(listInstanceClusterNetworkAttachmentsOptions *ListInstanceClusterNetworkAttachmentsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstanceClusterNetworkAttachmentsPath := "/instances/testString/cluster_network_attachments"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceClusterNetworkAttachmentsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstanceClusterNetworkAttachments with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceClusterNetworkAttachmentsOptions model
				listInstanceClusterNetworkAttachmentsOptionsModel := new(vpcv1.ListInstanceClusterNetworkAttachmentsOptions)
				listInstanceClusterNetworkAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceClusterNetworkAttachmentsOptionsModel.Start = core.StringPtr("testString")
				listInstanceClusterNetworkAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceClusterNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstanceClusterNetworkAttachments(listInstanceClusterNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstanceClusterNetworkAttachments(listInstanceClusterNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceClusterNetworkAttachments(listInstanceClusterNetworkAttachmentsOptions *ListInstanceClusterNetworkAttachmentsOptions)`, func() {
		version := "2024-06-23"
		listInstanceClusterNetworkAttachmentsPath := "/instances/testString/cluster_network_attachments"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceClusterNetworkAttachmentsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cluster_network_attachments": [{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceClusterNetworkAttachments successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstanceClusterNetworkAttachmentsOptions model
				listInstanceClusterNetworkAttachmentsOptionsModel := new(vpcv1.ListInstanceClusterNetworkAttachmentsOptions)
				listInstanceClusterNetworkAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceClusterNetworkAttachmentsOptionsModel.Start = core.StringPtr("testString")
				listInstanceClusterNetworkAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceClusterNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstanceClusterNetworkAttachmentsWithContext(ctx, listInstanceClusterNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstanceClusterNetworkAttachments(listInstanceClusterNetworkAttachmentsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstanceClusterNetworkAttachmentsWithContext(ctx, listInstanceClusterNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceClusterNetworkAttachmentsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cluster_network_attachments": [{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceClusterNetworkAttachments successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstanceClusterNetworkAttachments(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstanceClusterNetworkAttachmentsOptions model
				listInstanceClusterNetworkAttachmentsOptionsModel := new(vpcv1.ListInstanceClusterNetworkAttachmentsOptions)
				listInstanceClusterNetworkAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceClusterNetworkAttachmentsOptionsModel.Start = core.StringPtr("testString")
				listInstanceClusterNetworkAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceClusterNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstanceClusterNetworkAttachments(listInstanceClusterNetworkAttachmentsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstanceClusterNetworkAttachments with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceClusterNetworkAttachmentsOptions model
				listInstanceClusterNetworkAttachmentsOptionsModel := new(vpcv1.ListInstanceClusterNetworkAttachmentsOptions)
				listInstanceClusterNetworkAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceClusterNetworkAttachmentsOptionsModel.Start = core.StringPtr("testString")
				listInstanceClusterNetworkAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceClusterNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstanceClusterNetworkAttachments(listInstanceClusterNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListInstanceClusterNetworkAttachmentsOptions model with no property values
				listInstanceClusterNetworkAttachmentsOptionsModelNew := new(vpcv1.ListInstanceClusterNetworkAttachmentsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListInstanceClusterNetworkAttachments(listInstanceClusterNetworkAttachmentsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstanceClusterNetworkAttachments successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceClusterNetworkAttachmentsOptions model
				listInstanceClusterNetworkAttachmentsOptionsModel := new(vpcv1.ListInstanceClusterNetworkAttachmentsOptions)
				listInstanceClusterNetworkAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceClusterNetworkAttachmentsOptionsModel.Start = core.StringPtr("testString")
				listInstanceClusterNetworkAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceClusterNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstanceClusterNetworkAttachments(listInstanceClusterNetworkAttachmentsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.InstanceClusterNetworkAttachmentCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.InstanceClusterNetworkAttachmentCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.InstanceClusterNetworkAttachmentCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceClusterNetworkAttachmentsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"cluster_network_attachments":[{"before":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"},"cluster_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","name":"my-cluster-network-interface","primary_ip":{"address":"10.1.0.6","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117","id":"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117","name":"my-cluster-network-subnet-reserved-ip","resource_type":"cluster_network_subnet_reserved_ip"},"resource_type":"cluster_network_interface","subnet":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet"}},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"}],"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"cluster_network_attachments":[{"before":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"},"cluster_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","name":"my-cluster-network-interface","primary_ip":{"address":"10.1.0.6","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117","id":"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117","name":"my-cluster-network-subnet-reserved-ip","resource_type":"cluster_network_subnet_reserved_ip"},"resource_type":"cluster_network_interface","subnet":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet"}},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"}],"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use InstanceClusterNetworkAttachmentsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstanceClusterNetworkAttachmentsOptionsModel := &vpcv1.ListInstanceClusterNetworkAttachmentsOptions{
					InstanceID: core.StringPtr("testString"),
					Limit:      core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewInstanceClusterNetworkAttachmentsPager(listInstanceClusterNetworkAttachmentsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.InstanceClusterNetworkAttachment
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use InstanceClusterNetworkAttachmentsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstanceClusterNetworkAttachmentsOptionsModel := &vpcv1.ListInstanceClusterNetworkAttachmentsOptions{
					InstanceID: core.StringPtr("testString"),
					Limit:      core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewInstanceClusterNetworkAttachmentsPager(listInstanceClusterNetworkAttachmentsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateClusterNetworkAttachment(createClusterNetworkAttachmentOptions *CreateClusterNetworkAttachmentOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createClusterNetworkAttachmentPath := "/instances/testString/cluster_network_attachments"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkAttachmentPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateClusterNetworkAttachment with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID model
				instanceClusterNetworkAttachmentBeforePrototypeModel := new(vpcv1.InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID)
				instanceClusterNetworkAttachmentBeforePrototypeModel.ID = core.StringPtr("0717-fb880975-db45-4459-8548-64e3995ac213")

				// Construct an instance of the CreateClusterNetworkAttachmentOptions model
				createClusterNetworkAttachmentOptionsModel := new(vpcv1.CreateClusterNetworkAttachmentOptions)
				createClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createClusterNetworkAttachmentOptionsModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				createClusterNetworkAttachmentOptionsModel.Before = instanceClusterNetworkAttachmentBeforePrototypeModel
				createClusterNetworkAttachmentOptionsModel.Name = core.StringPtr("my-instance-network-attachment")
				createClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateClusterNetworkAttachment(createClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateClusterNetworkAttachment(createClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateClusterNetworkAttachment(createClusterNetworkAttachmentOptions *CreateClusterNetworkAttachmentOptions)`, func() {
		version := "2024-06-23"
		createClusterNetworkAttachmentPath := "/instances/testString/cluster_network_attachments"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkAttachmentPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}`)
				}))
			})
			It(`Invoke CreateClusterNetworkAttachment successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID model
				instanceClusterNetworkAttachmentBeforePrototypeModel := new(vpcv1.InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID)
				instanceClusterNetworkAttachmentBeforePrototypeModel.ID = core.StringPtr("0717-fb880975-db45-4459-8548-64e3995ac213")

				// Construct an instance of the CreateClusterNetworkAttachmentOptions model
				createClusterNetworkAttachmentOptionsModel := new(vpcv1.CreateClusterNetworkAttachmentOptions)
				createClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createClusterNetworkAttachmentOptionsModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				createClusterNetworkAttachmentOptionsModel.Before = instanceClusterNetworkAttachmentBeforePrototypeModel
				createClusterNetworkAttachmentOptionsModel.Name = core.StringPtr("my-instance-network-attachment")
				createClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateClusterNetworkAttachmentWithContext(ctx, createClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateClusterNetworkAttachment(createClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateClusterNetworkAttachmentWithContext(ctx, createClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createClusterNetworkAttachmentPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}`)
				}))
			})
			It(`Invoke CreateClusterNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateClusterNetworkAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID model
				instanceClusterNetworkAttachmentBeforePrototypeModel := new(vpcv1.InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID)
				instanceClusterNetworkAttachmentBeforePrototypeModel.ID = core.StringPtr("0717-fb880975-db45-4459-8548-64e3995ac213")

				// Construct an instance of the CreateClusterNetworkAttachmentOptions model
				createClusterNetworkAttachmentOptionsModel := new(vpcv1.CreateClusterNetworkAttachmentOptions)
				createClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createClusterNetworkAttachmentOptionsModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				createClusterNetworkAttachmentOptionsModel.Before = instanceClusterNetworkAttachmentBeforePrototypeModel
				createClusterNetworkAttachmentOptionsModel.Name = core.StringPtr("my-instance-network-attachment")
				createClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateClusterNetworkAttachment(createClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateClusterNetworkAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID model
				instanceClusterNetworkAttachmentBeforePrototypeModel := new(vpcv1.InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID)
				instanceClusterNetworkAttachmentBeforePrototypeModel.ID = core.StringPtr("0717-fb880975-db45-4459-8548-64e3995ac213")

				// Construct an instance of the CreateClusterNetworkAttachmentOptions model
				createClusterNetworkAttachmentOptionsModel := new(vpcv1.CreateClusterNetworkAttachmentOptions)
				createClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createClusterNetworkAttachmentOptionsModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				createClusterNetworkAttachmentOptionsModel.Before = instanceClusterNetworkAttachmentBeforePrototypeModel
				createClusterNetworkAttachmentOptionsModel.Name = core.StringPtr("my-instance-network-attachment")
				createClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateClusterNetworkAttachment(createClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateClusterNetworkAttachmentOptions model with no property values
				createClusterNetworkAttachmentOptionsModelNew := new(vpcv1.CreateClusterNetworkAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateClusterNetworkAttachment(createClusterNetworkAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateClusterNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel

				// Construct an instance of the InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID model
				instanceClusterNetworkAttachmentBeforePrototypeModel := new(vpcv1.InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID)
				instanceClusterNetworkAttachmentBeforePrototypeModel.ID = core.StringPtr("0717-fb880975-db45-4459-8548-64e3995ac213")

				// Construct an instance of the CreateClusterNetworkAttachmentOptions model
				createClusterNetworkAttachmentOptionsModel := new(vpcv1.CreateClusterNetworkAttachmentOptions)
				createClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createClusterNetworkAttachmentOptionsModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				createClusterNetworkAttachmentOptionsModel.Before = instanceClusterNetworkAttachmentBeforePrototypeModel
				createClusterNetworkAttachmentOptionsModel.Name = core.StringPtr("my-instance-network-attachment")
				createClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateClusterNetworkAttachment(createClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteInstanceClusterNetworkAttachment(deleteInstanceClusterNetworkAttachmentOptions *DeleteInstanceClusterNetworkAttachmentOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deleteInstanceClusterNetworkAttachmentPath := "/instances/testString/cluster_network_attachments/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstanceClusterNetworkAttachmentPath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeleteInstanceClusterNetworkAttachment with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceClusterNetworkAttachmentOptions model
				deleteInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.DeleteInstanceClusterNetworkAttachmentOptions)
				deleteInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				deleteInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeleteInstanceClusterNetworkAttachment(deleteInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeleteInstanceClusterNetworkAttachment(deleteInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteInstanceClusterNetworkAttachment(deleteInstanceClusterNetworkAttachmentOptions *DeleteInstanceClusterNetworkAttachmentOptions)`, func() {
		version := "2024-06-23"
		deleteInstanceClusterNetworkAttachmentPath := "/instances/testString/cluster_network_attachments/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstanceClusterNetworkAttachmentPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}`)
				}))
			})
			It(`Invoke DeleteInstanceClusterNetworkAttachment successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeleteInstanceClusterNetworkAttachmentOptions model
				deleteInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.DeleteInstanceClusterNetworkAttachmentOptions)
				deleteInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				deleteInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeleteInstanceClusterNetworkAttachmentWithContext(ctx, deleteInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeleteInstanceClusterNetworkAttachment(deleteInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeleteInstanceClusterNetworkAttachmentWithContext(ctx, deleteInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstanceClusterNetworkAttachmentPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}`)
				}))
			})
			It(`Invoke DeleteInstanceClusterNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeleteInstanceClusterNetworkAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeleteInstanceClusterNetworkAttachmentOptions model
				deleteInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.DeleteInstanceClusterNetworkAttachmentOptions)
				deleteInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				deleteInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeleteInstanceClusterNetworkAttachment(deleteInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeleteInstanceClusterNetworkAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceClusterNetworkAttachmentOptions model
				deleteInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.DeleteInstanceClusterNetworkAttachmentOptions)
				deleteInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				deleteInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeleteInstanceClusterNetworkAttachment(deleteInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeleteInstanceClusterNetworkAttachmentOptions model with no property values
				deleteInstanceClusterNetworkAttachmentOptionsModelNew := new(vpcv1.DeleteInstanceClusterNetworkAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeleteInstanceClusterNetworkAttachment(deleteInstanceClusterNetworkAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteInstanceClusterNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceClusterNetworkAttachmentOptions model
				deleteInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.DeleteInstanceClusterNetworkAttachmentOptions)
				deleteInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				deleteInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeleteInstanceClusterNetworkAttachment(deleteInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceClusterNetworkAttachment(getInstanceClusterNetworkAttachmentOptions *GetInstanceClusterNetworkAttachmentOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceClusterNetworkAttachmentPath := "/instances/testString/cluster_network_attachments/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceClusterNetworkAttachmentPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceClusterNetworkAttachment with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceClusterNetworkAttachmentOptions model
				getInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.GetInstanceClusterNetworkAttachmentOptions)
				getInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceClusterNetworkAttachment(getInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceClusterNetworkAttachment(getInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceClusterNetworkAttachment(getInstanceClusterNetworkAttachmentOptions *GetInstanceClusterNetworkAttachmentOptions)`, func() {
		version := "2024-06-23"
		getInstanceClusterNetworkAttachmentPath := "/instances/testString/cluster_network_attachments/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceClusterNetworkAttachmentPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}`)
				}))
			})
			It(`Invoke GetInstanceClusterNetworkAttachment successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceClusterNetworkAttachmentOptions model
				getInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.GetInstanceClusterNetworkAttachmentOptions)
				getInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceClusterNetworkAttachmentWithContext(ctx, getInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceClusterNetworkAttachment(getInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceClusterNetworkAttachmentWithContext(ctx, getInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceClusterNetworkAttachmentPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}`)
				}))
			})
			It(`Invoke GetInstanceClusterNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceClusterNetworkAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceClusterNetworkAttachmentOptions model
				getInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.GetInstanceClusterNetworkAttachmentOptions)
				getInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceClusterNetworkAttachment(getInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceClusterNetworkAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceClusterNetworkAttachmentOptions model
				getInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.GetInstanceClusterNetworkAttachmentOptions)
				getInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceClusterNetworkAttachment(getInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceClusterNetworkAttachmentOptions model with no property values
				getInstanceClusterNetworkAttachmentOptionsModelNew := new(vpcv1.GetInstanceClusterNetworkAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceClusterNetworkAttachment(getInstanceClusterNetworkAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceClusterNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceClusterNetworkAttachmentOptions model
				getInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.GetInstanceClusterNetworkAttachmentOptions)
				getInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceClusterNetworkAttachment(getInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceClusterNetworkAttachment(updateInstanceClusterNetworkAttachmentOptions *UpdateInstanceClusterNetworkAttachmentOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateInstanceClusterNetworkAttachmentPath := "/instances/testString/cluster_network_attachments/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceClusterNetworkAttachmentPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateInstanceClusterNetworkAttachment with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceClusterNetworkAttachmentPatch model
				instanceClusterNetworkAttachmentPatchModel := new(vpcv1.InstanceClusterNetworkAttachmentPatch)
				instanceClusterNetworkAttachmentPatchModel.Name = core.StringPtr("my-instance-network-attachment-updated")
				instanceClusterNetworkAttachmentPatchModelAsPatch, asPatchErr := instanceClusterNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceClusterNetworkAttachmentOptions model
				updateInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.UpdateInstanceClusterNetworkAttachmentOptions)
				updateInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceClusterNetworkAttachmentOptionsModel.InstanceClusterNetworkAttachmentPatch = instanceClusterNetworkAttachmentPatchModelAsPatch
				updateInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateInstanceClusterNetworkAttachment(updateInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateInstanceClusterNetworkAttachment(updateInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceClusterNetworkAttachment(updateInstanceClusterNetworkAttachmentOptions *UpdateInstanceClusterNetworkAttachmentOptions)`, func() {
		version := "2024-06-23"
		updateInstanceClusterNetworkAttachmentPath := "/instances/testString/cluster_network_attachments/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceClusterNetworkAttachmentPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}`)
				}))
			})
			It(`Invoke UpdateInstanceClusterNetworkAttachment successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceClusterNetworkAttachmentPatch model
				instanceClusterNetworkAttachmentPatchModel := new(vpcv1.InstanceClusterNetworkAttachmentPatch)
				instanceClusterNetworkAttachmentPatchModel.Name = core.StringPtr("my-instance-network-attachment-updated")
				instanceClusterNetworkAttachmentPatchModelAsPatch, asPatchErr := instanceClusterNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceClusterNetworkAttachmentOptions model
				updateInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.UpdateInstanceClusterNetworkAttachmentOptions)
				updateInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceClusterNetworkAttachmentOptionsModel.InstanceClusterNetworkAttachmentPatch = instanceClusterNetworkAttachmentPatchModelAsPatch
				updateInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateInstanceClusterNetworkAttachmentWithContext(ctx, updateInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateInstanceClusterNetworkAttachment(updateInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateInstanceClusterNetworkAttachmentWithContext(ctx, updateInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceClusterNetworkAttachmentPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "id": "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}`)
				}))
			})
			It(`Invoke UpdateInstanceClusterNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateInstanceClusterNetworkAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceClusterNetworkAttachmentPatch model
				instanceClusterNetworkAttachmentPatchModel := new(vpcv1.InstanceClusterNetworkAttachmentPatch)
				instanceClusterNetworkAttachmentPatchModel.Name = core.StringPtr("my-instance-network-attachment-updated")
				instanceClusterNetworkAttachmentPatchModelAsPatch, asPatchErr := instanceClusterNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceClusterNetworkAttachmentOptions model
				updateInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.UpdateInstanceClusterNetworkAttachmentOptions)
				updateInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceClusterNetworkAttachmentOptionsModel.InstanceClusterNetworkAttachmentPatch = instanceClusterNetworkAttachmentPatchModelAsPatch
				updateInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateInstanceClusterNetworkAttachment(updateInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateInstanceClusterNetworkAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceClusterNetworkAttachmentPatch model
				instanceClusterNetworkAttachmentPatchModel := new(vpcv1.InstanceClusterNetworkAttachmentPatch)
				instanceClusterNetworkAttachmentPatchModel.Name = core.StringPtr("my-instance-network-attachment-updated")
				instanceClusterNetworkAttachmentPatchModelAsPatch, asPatchErr := instanceClusterNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceClusterNetworkAttachmentOptions model
				updateInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.UpdateInstanceClusterNetworkAttachmentOptions)
				updateInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceClusterNetworkAttachmentOptionsModel.InstanceClusterNetworkAttachmentPatch = instanceClusterNetworkAttachmentPatchModelAsPatch
				updateInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateInstanceClusterNetworkAttachment(updateInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateInstanceClusterNetworkAttachmentOptions model with no property values
				updateInstanceClusterNetworkAttachmentOptionsModelNew := new(vpcv1.UpdateInstanceClusterNetworkAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateInstanceClusterNetworkAttachment(updateInstanceClusterNetworkAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateInstanceClusterNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceClusterNetworkAttachmentPatch model
				instanceClusterNetworkAttachmentPatchModel := new(vpcv1.InstanceClusterNetworkAttachmentPatch)
				instanceClusterNetworkAttachmentPatchModel.Name = core.StringPtr("my-instance-network-attachment-updated")
				instanceClusterNetworkAttachmentPatchModelAsPatch, asPatchErr := instanceClusterNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceClusterNetworkAttachmentOptions model
				updateInstanceClusterNetworkAttachmentOptionsModel := new(vpcv1.UpdateInstanceClusterNetworkAttachmentOptions)
				updateInstanceClusterNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceClusterNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceClusterNetworkAttachmentOptionsModel.InstanceClusterNetworkAttachmentPatch = instanceClusterNetworkAttachmentPatchModelAsPatch
				updateInstanceClusterNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateInstanceClusterNetworkAttachment(updateInstanceClusterNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptions *CreateInstanceConsoleAccessTokenOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createInstanceConsoleAccessTokenPath := "/instances/testString/console_access_token"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceConsoleAccessTokenPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateInstanceConsoleAccessToken with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateInstanceConsoleAccessTokenOptions model
				createInstanceConsoleAccessTokenOptionsModel := new(vpcv1.CreateInstanceConsoleAccessTokenOptions)
				createInstanceConsoleAccessTokenOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceConsoleAccessTokenOptionsModel.ConsoleType = core.StringPtr("serial")
				createInstanceConsoleAccessTokenOptionsModel.Force = core.BoolPtr(false)
				createInstanceConsoleAccessTokenOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptions *CreateInstanceConsoleAccessTokenOptions)`, func() {
		version := "2024-06-23"
		createInstanceConsoleAccessTokenPath := "/instances/testString/console_access_token"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceConsoleAccessTokenPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI"}`)
				}))
			})
			It(`Invoke CreateInstanceConsoleAccessToken successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the CreateInstanceConsoleAccessTokenOptions model
				createInstanceConsoleAccessTokenOptionsModel := new(vpcv1.CreateInstanceConsoleAccessTokenOptions)
				createInstanceConsoleAccessTokenOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceConsoleAccessTokenOptionsModel.ConsoleType = core.StringPtr("serial")
				createInstanceConsoleAccessTokenOptionsModel.Force = core.BoolPtr(false)
				createInstanceConsoleAccessTokenOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateInstanceConsoleAccessTokenWithContext(ctx, createInstanceConsoleAccessTokenOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateInstanceConsoleAccessTokenWithContext(ctx, createInstanceConsoleAccessTokenOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceConsoleAccessTokenPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI"}`)
				}))
			})
			It(`Invoke CreateInstanceConsoleAccessToken successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateInstanceConsoleAccessToken(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the CreateInstanceConsoleAccessTokenOptions model
				createInstanceConsoleAccessTokenOptionsModel := new(vpcv1.CreateInstanceConsoleAccessTokenOptions)
				createInstanceConsoleAccessTokenOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceConsoleAccessTokenOptionsModel.ConsoleType = core.StringPtr("serial")
				createInstanceConsoleAccessTokenOptionsModel.Force = core.BoolPtr(false)
				createInstanceConsoleAccessTokenOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateInstanceConsoleAccessToken with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateInstanceConsoleAccessTokenOptions model
				createInstanceConsoleAccessTokenOptionsModel := new(vpcv1.CreateInstanceConsoleAccessTokenOptions)
				createInstanceConsoleAccessTokenOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceConsoleAccessTokenOptionsModel.ConsoleType = core.StringPtr("serial")
				createInstanceConsoleAccessTokenOptionsModel.Force = core.BoolPtr(false)
				createInstanceConsoleAccessTokenOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateInstanceConsoleAccessTokenOptions model with no property values
				createInstanceConsoleAccessTokenOptionsModelNew := new(vpcv1.CreateInstanceConsoleAccessTokenOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke CreateInstanceConsoleAccessToken successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateInstanceConsoleAccessTokenOptions model
				createInstanceConsoleAccessTokenOptionsModel := new(vpcv1.CreateInstanceConsoleAccessTokenOptions)
				createInstanceConsoleAccessTokenOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceConsoleAccessTokenOptionsModel.ConsoleType = core.StringPtr("serial")
				createInstanceConsoleAccessTokenOptionsModel.Force = core.BoolPtr(false)
				createInstanceConsoleAccessTokenOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceDisks(listInstanceDisksOptions *ListInstanceDisksOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstanceDisksPath := "/instances/testString/disks"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceDisksPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstanceDisks with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceDisksOptions model
				listInstanceDisksOptionsModel := new(vpcv1.ListInstanceDisksOptions)
				listInstanceDisksOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstanceDisks(listInstanceDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstanceDisks(listInstanceDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceDisks(listInstanceDisksOptions *ListInstanceDisksOptions)`, func() {
		version := "2024-06-23"
		listInstanceDisksPath := "/instances/testString/disks"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceDisksPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}]}`)
				}))
			})
			It(`Invoke ListInstanceDisks successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstanceDisksOptions model
				listInstanceDisksOptionsModel := new(vpcv1.ListInstanceDisksOptions)
				listInstanceDisksOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstanceDisksWithContext(ctx, listInstanceDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstanceDisks(listInstanceDisksOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstanceDisksWithContext(ctx, listInstanceDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceDisksPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}]}`)
				}))
			})
			It(`Invoke ListInstanceDisks successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstanceDisks(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstanceDisksOptions model
				listInstanceDisksOptionsModel := new(vpcv1.ListInstanceDisksOptions)
				listInstanceDisksOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstanceDisks(listInstanceDisksOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstanceDisks with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceDisksOptions model
				listInstanceDisksOptionsModel := new(vpcv1.ListInstanceDisksOptions)
				listInstanceDisksOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstanceDisks(listInstanceDisksOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListInstanceDisksOptions model with no property values
				listInstanceDisksOptionsModelNew := new(vpcv1.ListInstanceDisksOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListInstanceDisks(listInstanceDisksOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstanceDisks successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceDisksOptions model
				listInstanceDisksOptionsModel := new(vpcv1.ListInstanceDisksOptions)
				listInstanceDisksOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceDisksOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstanceDisks(listInstanceDisksOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceDisk(getInstanceDiskOptions *GetInstanceDiskOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceDiskPath := "/instances/testString/disks/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceDiskPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceDisk with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceDiskOptions model
				getInstanceDiskOptionsModel := new(vpcv1.GetInstanceDiskOptions)
				getInstanceDiskOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceDiskOptionsModel.ID = core.StringPtr("testString")
				getInstanceDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceDisk(getInstanceDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceDisk(getInstanceDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceDisk(getInstanceDiskOptions *GetInstanceDiskOptions)`, func() {
		version := "2024-06-23"
		getInstanceDiskPath := "/instances/testString/disks/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceDiskPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}`)
				}))
			})
			It(`Invoke GetInstanceDisk successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceDiskOptions model
				getInstanceDiskOptionsModel := new(vpcv1.GetInstanceDiskOptions)
				getInstanceDiskOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceDiskOptionsModel.ID = core.StringPtr("testString")
				getInstanceDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceDiskWithContext(ctx, getInstanceDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceDisk(getInstanceDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceDiskWithContext(ctx, getInstanceDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceDiskPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}`)
				}))
			})
			It(`Invoke GetInstanceDisk successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceDisk(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceDiskOptions model
				getInstanceDiskOptionsModel := new(vpcv1.GetInstanceDiskOptions)
				getInstanceDiskOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceDiskOptionsModel.ID = core.StringPtr("testString")
				getInstanceDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceDisk(getInstanceDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceDisk with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceDiskOptions model
				getInstanceDiskOptionsModel := new(vpcv1.GetInstanceDiskOptions)
				getInstanceDiskOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceDiskOptionsModel.ID = core.StringPtr("testString")
				getInstanceDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceDisk(getInstanceDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceDiskOptions model with no property values
				getInstanceDiskOptionsModelNew := new(vpcv1.GetInstanceDiskOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceDisk(getInstanceDiskOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceDisk successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceDiskOptions model
				getInstanceDiskOptionsModel := new(vpcv1.GetInstanceDiskOptions)
				getInstanceDiskOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceDiskOptionsModel.ID = core.StringPtr("testString")
				getInstanceDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceDisk(getInstanceDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceDisk(updateInstanceDiskOptions *UpdateInstanceDiskOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateInstanceDiskPath := "/instances/testString/disks/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceDiskPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateInstanceDisk with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceDiskPatch model
				instanceDiskPatchModel := new(vpcv1.InstanceDiskPatch)
				instanceDiskPatchModel.Name = core.StringPtr("my-instance-disk-updated")
				instanceDiskPatchModelAsPatch, asPatchErr := instanceDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceDiskOptions model
				updateInstanceDiskOptionsModel := new(vpcv1.UpdateInstanceDiskOptions)
				updateInstanceDiskOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceDiskOptionsModel.ID = core.StringPtr("testString")
				updateInstanceDiskOptionsModel.InstanceDiskPatch = instanceDiskPatchModelAsPatch
				updateInstanceDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateInstanceDisk(updateInstanceDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateInstanceDisk(updateInstanceDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceDisk(updateInstanceDiskOptions *UpdateInstanceDiskOptions)`, func() {
		version := "2024-06-23"
		updateInstanceDiskPath := "/instances/testString/disks/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceDiskPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}`)
				}))
			})
			It(`Invoke UpdateInstanceDisk successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceDiskPatch model
				instanceDiskPatchModel := new(vpcv1.InstanceDiskPatch)
				instanceDiskPatchModel.Name = core.StringPtr("my-instance-disk-updated")
				instanceDiskPatchModelAsPatch, asPatchErr := instanceDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceDiskOptions model
				updateInstanceDiskOptionsModel := new(vpcv1.UpdateInstanceDiskOptions)
				updateInstanceDiskOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceDiskOptionsModel.ID = core.StringPtr("testString")
				updateInstanceDiskOptionsModel.InstanceDiskPatch = instanceDiskPatchModelAsPatch
				updateInstanceDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateInstanceDiskWithContext(ctx, updateInstanceDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateInstanceDisk(updateInstanceDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateInstanceDiskWithContext(ctx, updateInstanceDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceDiskPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}`)
				}))
			})
			It(`Invoke UpdateInstanceDisk successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateInstanceDisk(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceDiskPatch model
				instanceDiskPatchModel := new(vpcv1.InstanceDiskPatch)
				instanceDiskPatchModel.Name = core.StringPtr("my-instance-disk-updated")
				instanceDiskPatchModelAsPatch, asPatchErr := instanceDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceDiskOptions model
				updateInstanceDiskOptionsModel := new(vpcv1.UpdateInstanceDiskOptions)
				updateInstanceDiskOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceDiskOptionsModel.ID = core.StringPtr("testString")
				updateInstanceDiskOptionsModel.InstanceDiskPatch = instanceDiskPatchModelAsPatch
				updateInstanceDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateInstanceDisk(updateInstanceDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateInstanceDisk with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceDiskPatch model
				instanceDiskPatchModel := new(vpcv1.InstanceDiskPatch)
				instanceDiskPatchModel.Name = core.StringPtr("my-instance-disk-updated")
				instanceDiskPatchModelAsPatch, asPatchErr := instanceDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceDiskOptions model
				updateInstanceDiskOptionsModel := new(vpcv1.UpdateInstanceDiskOptions)
				updateInstanceDiskOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceDiskOptionsModel.ID = core.StringPtr("testString")
				updateInstanceDiskOptionsModel.InstanceDiskPatch = instanceDiskPatchModelAsPatch
				updateInstanceDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateInstanceDisk(updateInstanceDiskOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateInstanceDiskOptions model with no property values
				updateInstanceDiskOptionsModelNew := new(vpcv1.UpdateInstanceDiskOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateInstanceDisk(updateInstanceDiskOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateInstanceDisk successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceDiskPatch model
				instanceDiskPatchModel := new(vpcv1.InstanceDiskPatch)
				instanceDiskPatchModel.Name = core.StringPtr("my-instance-disk-updated")
				instanceDiskPatchModelAsPatch, asPatchErr := instanceDiskPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceDiskOptions model
				updateInstanceDiskOptionsModel := new(vpcv1.UpdateInstanceDiskOptions)
				updateInstanceDiskOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceDiskOptionsModel.ID = core.StringPtr("testString")
				updateInstanceDiskOptionsModel.InstanceDiskPatch = instanceDiskPatchModelAsPatch
				updateInstanceDiskOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateInstanceDisk(updateInstanceDiskOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptions *ListInstanceNetworkAttachmentsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstanceNetworkAttachmentsPath := "/instances/testString/network_attachments"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceNetworkAttachmentsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstanceNetworkAttachments with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceNetworkAttachmentsOptions model
				listInstanceNetworkAttachmentsOptionsModel := new(vpcv1.ListInstanceNetworkAttachmentsOptions)
				listInstanceNetworkAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptions *ListInstanceNetworkAttachmentsOptions)`, func() {
		version := "2024-06-23"
		listInstanceNetworkAttachmentsPath := "/instances/testString/network_attachments"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceNetworkAttachmentsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}]}`)
				}))
			})
			It(`Invoke ListInstanceNetworkAttachments successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstanceNetworkAttachmentsOptions model
				listInstanceNetworkAttachmentsOptionsModel := new(vpcv1.ListInstanceNetworkAttachmentsOptions)
				listInstanceNetworkAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstanceNetworkAttachmentsWithContext(ctx, listInstanceNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstanceNetworkAttachmentsWithContext(ctx, listInstanceNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceNetworkAttachmentsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}]}`)
				}))
			})
			It(`Invoke ListInstanceNetworkAttachments successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstanceNetworkAttachments(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstanceNetworkAttachmentsOptions model
				listInstanceNetworkAttachmentsOptionsModel := new(vpcv1.ListInstanceNetworkAttachmentsOptions)
				listInstanceNetworkAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstanceNetworkAttachments with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceNetworkAttachmentsOptions model
				listInstanceNetworkAttachmentsOptionsModel := new(vpcv1.ListInstanceNetworkAttachmentsOptions)
				listInstanceNetworkAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListInstanceNetworkAttachmentsOptions model with no property values
				listInstanceNetworkAttachmentsOptionsModelNew := new(vpcv1.ListInstanceNetworkAttachmentsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstanceNetworkAttachments successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceNetworkAttachmentsOptions model
				listInstanceNetworkAttachmentsOptionsModel := new(vpcv1.ListInstanceNetworkAttachmentsOptions)
				listInstanceNetworkAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceNetworkAttachment(createInstanceNetworkAttachmentOptions *CreateInstanceNetworkAttachmentOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createInstanceNetworkAttachmentPath := "/instances/testString/network_attachments"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceNetworkAttachmentPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateInstanceNetworkAttachment with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.7")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the CreateInstanceNetworkAttachmentOptions model
				createInstanceNetworkAttachmentOptionsModel := new(vpcv1.CreateInstanceNetworkAttachmentOptions)
				createInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceNetworkAttachmentOptionsModel.VirtualNetworkInterface = instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				createInstanceNetworkAttachmentOptionsModel.Name = core.StringPtr("testString")
				createInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateInstanceNetworkAttachment(createInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateInstanceNetworkAttachment(createInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceNetworkAttachment(createInstanceNetworkAttachmentOptions *CreateInstanceNetworkAttachmentOptions)`, func() {
		version := "2024-06-23"
		createInstanceNetworkAttachmentPath := "/instances/testString/network_attachments"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceNetworkAttachmentPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}`)
				}))
			})
			It(`Invoke CreateInstanceNetworkAttachment successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.7")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the CreateInstanceNetworkAttachmentOptions model
				createInstanceNetworkAttachmentOptionsModel := new(vpcv1.CreateInstanceNetworkAttachmentOptions)
				createInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceNetworkAttachmentOptionsModel.VirtualNetworkInterface = instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				createInstanceNetworkAttachmentOptionsModel.Name = core.StringPtr("testString")
				createInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateInstanceNetworkAttachmentWithContext(ctx, createInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateInstanceNetworkAttachment(createInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateInstanceNetworkAttachmentWithContext(ctx, createInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceNetworkAttachmentPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}`)
				}))
			})
			It(`Invoke CreateInstanceNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateInstanceNetworkAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.7")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the CreateInstanceNetworkAttachmentOptions model
				createInstanceNetworkAttachmentOptionsModel := new(vpcv1.CreateInstanceNetworkAttachmentOptions)
				createInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceNetworkAttachmentOptionsModel.VirtualNetworkInterface = instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				createInstanceNetworkAttachmentOptionsModel.Name = core.StringPtr("testString")
				createInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateInstanceNetworkAttachment(createInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateInstanceNetworkAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.7")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the CreateInstanceNetworkAttachmentOptions model
				createInstanceNetworkAttachmentOptionsModel := new(vpcv1.CreateInstanceNetworkAttachmentOptions)
				createInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceNetworkAttachmentOptionsModel.VirtualNetworkInterface = instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				createInstanceNetworkAttachmentOptionsModel.Name = core.StringPtr("testString")
				createInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateInstanceNetworkAttachment(createInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateInstanceNetworkAttachmentOptions model with no property values
				createInstanceNetworkAttachmentOptionsModelNew := new(vpcv1.CreateInstanceNetworkAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateInstanceNetworkAttachment(createInstanceNetworkAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateInstanceNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.7")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel

				// Construct an instance of the CreateInstanceNetworkAttachmentOptions model
				createInstanceNetworkAttachmentOptionsModel := new(vpcv1.CreateInstanceNetworkAttachmentOptions)
				createInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceNetworkAttachmentOptionsModel.VirtualNetworkInterface = instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				createInstanceNetworkAttachmentOptionsModel.Name = core.StringPtr("testString")
				createInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateInstanceNetworkAttachment(createInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteInstanceNetworkAttachment(deleteInstanceNetworkAttachmentOptions *DeleteInstanceNetworkAttachmentOptions)`, func() {
		version := "2024-06-23"
		deleteInstanceNetworkAttachmentPath := "/instances/testString/network_attachments/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstanceNetworkAttachmentPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteInstanceNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteInstanceNetworkAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteInstanceNetworkAttachmentOptions model
				deleteInstanceNetworkAttachmentOptionsModel := new(vpcv1.DeleteInstanceNetworkAttachmentOptions)
				deleteInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				deleteInstanceNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteInstanceNetworkAttachment(deleteInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteInstanceNetworkAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceNetworkAttachmentOptions model
				deleteInstanceNetworkAttachmentOptionsModel := new(vpcv1.DeleteInstanceNetworkAttachmentOptions)
				deleteInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				deleteInstanceNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteInstanceNetworkAttachment(deleteInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteInstanceNetworkAttachmentOptions model with no property values
				deleteInstanceNetworkAttachmentOptionsModelNew := new(vpcv1.DeleteInstanceNetworkAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteInstanceNetworkAttachment(deleteInstanceNetworkAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceNetworkAttachment(getInstanceNetworkAttachmentOptions *GetInstanceNetworkAttachmentOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceNetworkAttachmentPath := "/instances/testString/network_attachments/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceNetworkAttachmentPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceNetworkAttachment with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceNetworkAttachmentOptions model
				getInstanceNetworkAttachmentOptionsModel := new(vpcv1.GetInstanceNetworkAttachmentOptions)
				getInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceNetworkAttachment(getInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceNetworkAttachment(getInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceNetworkAttachment(getInstanceNetworkAttachmentOptions *GetInstanceNetworkAttachmentOptions)`, func() {
		version := "2024-06-23"
		getInstanceNetworkAttachmentPath := "/instances/testString/network_attachments/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceNetworkAttachmentPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}`)
				}))
			})
			It(`Invoke GetInstanceNetworkAttachment successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceNetworkAttachmentOptions model
				getInstanceNetworkAttachmentOptionsModel := new(vpcv1.GetInstanceNetworkAttachmentOptions)
				getInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceNetworkAttachmentWithContext(ctx, getInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceNetworkAttachment(getInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceNetworkAttachmentWithContext(ctx, getInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceNetworkAttachmentPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}`)
				}))
			})
			It(`Invoke GetInstanceNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceNetworkAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceNetworkAttachmentOptions model
				getInstanceNetworkAttachmentOptionsModel := new(vpcv1.GetInstanceNetworkAttachmentOptions)
				getInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceNetworkAttachment(getInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceNetworkAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceNetworkAttachmentOptions model
				getInstanceNetworkAttachmentOptionsModel := new(vpcv1.GetInstanceNetworkAttachmentOptions)
				getInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceNetworkAttachment(getInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceNetworkAttachmentOptions model with no property values
				getInstanceNetworkAttachmentOptionsModelNew := new(vpcv1.GetInstanceNetworkAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceNetworkAttachment(getInstanceNetworkAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceNetworkAttachmentOptions model
				getInstanceNetworkAttachmentOptionsModel := new(vpcv1.GetInstanceNetworkAttachmentOptions)
				getInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceNetworkAttachment(getInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptions *UpdateInstanceNetworkAttachmentOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateInstanceNetworkAttachmentPath := "/instances/testString/network_attachments/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceNetworkAttachmentPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateInstanceNetworkAttachment with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceNetworkAttachmentPatch model
				instanceNetworkAttachmentPatchModel := new(vpcv1.InstanceNetworkAttachmentPatch)
				instanceNetworkAttachmentPatchModel.Name = core.StringPtr("my-instance-network-attachment-updated")
				instanceNetworkAttachmentPatchModelAsPatch, asPatchErr := instanceNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceNetworkAttachmentOptions model
				updateInstanceNetworkAttachmentOptionsModel := new(vpcv1.UpdateInstanceNetworkAttachmentOptions)
				updateInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceNetworkAttachmentOptionsModel.InstanceNetworkAttachmentPatch = instanceNetworkAttachmentPatchModelAsPatch
				updateInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptions *UpdateInstanceNetworkAttachmentOptions)`, func() {
		version := "2024-06-23"
		updateInstanceNetworkAttachmentPath := "/instances/testString/network_attachments/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceNetworkAttachmentPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}`)
				}))
			})
			It(`Invoke UpdateInstanceNetworkAttachment successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the InstanceNetworkAttachmentPatch model
				instanceNetworkAttachmentPatchModel := new(vpcv1.InstanceNetworkAttachmentPatch)
				instanceNetworkAttachmentPatchModel.Name = core.StringPtr("my-instance-network-attachment-updated")
				instanceNetworkAttachmentPatchModelAsPatch, asPatchErr := instanceNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceNetworkAttachmentOptions model
				updateInstanceNetworkAttachmentOptionsModel := new(vpcv1.UpdateInstanceNetworkAttachmentOptions)
				updateInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceNetworkAttachmentOptionsModel.InstanceNetworkAttachmentPatch = instanceNetworkAttachmentPatchModelAsPatch
				updateInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateInstanceNetworkAttachmentWithContext(ctx, updateInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateInstanceNetworkAttachmentWithContext(ctx, updateInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceNetworkAttachmentPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}`)
				}))
			})
			It(`Invoke UpdateInstanceNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateInstanceNetworkAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the InstanceNetworkAttachmentPatch model
				instanceNetworkAttachmentPatchModel := new(vpcv1.InstanceNetworkAttachmentPatch)
				instanceNetworkAttachmentPatchModel.Name = core.StringPtr("my-instance-network-attachment-updated")
				instanceNetworkAttachmentPatchModelAsPatch, asPatchErr := instanceNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceNetworkAttachmentOptions model
				updateInstanceNetworkAttachmentOptionsModel := new(vpcv1.UpdateInstanceNetworkAttachmentOptions)
				updateInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceNetworkAttachmentOptionsModel.InstanceNetworkAttachmentPatch = instanceNetworkAttachmentPatchModelAsPatch
				updateInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateInstanceNetworkAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceNetworkAttachmentPatch model
				instanceNetworkAttachmentPatchModel := new(vpcv1.InstanceNetworkAttachmentPatch)
				instanceNetworkAttachmentPatchModel.Name = core.StringPtr("my-instance-network-attachment-updated")
				instanceNetworkAttachmentPatchModelAsPatch, asPatchErr := instanceNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceNetworkAttachmentOptions model
				updateInstanceNetworkAttachmentOptionsModel := new(vpcv1.UpdateInstanceNetworkAttachmentOptions)
				updateInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceNetworkAttachmentOptionsModel.InstanceNetworkAttachmentPatch = instanceNetworkAttachmentPatchModelAsPatch
				updateInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateInstanceNetworkAttachmentOptions model with no property values
				updateInstanceNetworkAttachmentOptionsModelNew := new(vpcv1.UpdateInstanceNetworkAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateInstanceNetworkAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the InstanceNetworkAttachmentPatch model
				instanceNetworkAttachmentPatchModel := new(vpcv1.InstanceNetworkAttachmentPatch)
				instanceNetworkAttachmentPatchModel.Name = core.StringPtr("my-instance-network-attachment-updated")
				instanceNetworkAttachmentPatchModelAsPatch, asPatchErr := instanceNetworkAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceNetworkAttachmentOptions model
				updateInstanceNetworkAttachmentOptionsModel := new(vpcv1.UpdateInstanceNetworkAttachmentOptions)
				updateInstanceNetworkAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceNetworkAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceNetworkAttachmentOptionsModel.InstanceNetworkAttachmentPatch = instanceNetworkAttachmentPatchModelAsPatch
				updateInstanceNetworkAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptions *ListInstanceNetworkInterfacesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstanceNetworkInterfacesPath := "/instances/testString/network_interfaces"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstanceNetworkInterfaces with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceNetworkInterfacesOptions model
				listInstanceNetworkInterfacesOptionsModel := new(vpcv1.ListInstanceNetworkInterfacesOptions)
				listInstanceNetworkInterfacesOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptions *ListInstanceNetworkInterfacesOptions)`, func() {
		version := "2024-06-23"
		listInstanceNetworkInterfacesPath := "/instances/testString/network_interfaces"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}]}`)
				}))
			})
			It(`Invoke ListInstanceNetworkInterfaces successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstanceNetworkInterfacesOptions model
				listInstanceNetworkInterfacesOptionsModel := new(vpcv1.ListInstanceNetworkInterfacesOptions)
				listInstanceNetworkInterfacesOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstanceNetworkInterfacesWithContext(ctx, listInstanceNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstanceNetworkInterfacesWithContext(ctx, listInstanceNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}]}`)
				}))
			})
			It(`Invoke ListInstanceNetworkInterfaces successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaces(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstanceNetworkInterfacesOptions model
				listInstanceNetworkInterfacesOptionsModel := new(vpcv1.ListInstanceNetworkInterfacesOptions)
				listInstanceNetworkInterfacesOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstanceNetworkInterfaces with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceNetworkInterfacesOptions model
				listInstanceNetworkInterfacesOptionsModel := new(vpcv1.ListInstanceNetworkInterfacesOptions)
				listInstanceNetworkInterfacesOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListInstanceNetworkInterfacesOptions model with no property values
				listInstanceNetworkInterfacesOptionsModelNew := new(vpcv1.ListInstanceNetworkInterfacesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstanceNetworkInterfaces successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceNetworkInterfacesOptions model
				listInstanceNetworkInterfacesOptionsModel := new(vpcv1.ListInstanceNetworkInterfacesOptions)
				listInstanceNetworkInterfacesOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceNetworkInterface(createInstanceNetworkInterfaceOptions *CreateInstanceNetworkInterfaceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createInstanceNetworkInterfacePath := "/instances/testString/network_interfaces"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceNetworkInterfacePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateInstanceNetworkInterface with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateInstanceNetworkInterfaceOptions model
				createInstanceNetworkInterfaceOptionsModel := new(vpcv1.CreateInstanceNetworkInterfaceOptions)
				createInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceNetworkInterfaceOptionsModel.Subnet = subnetIdentityModel
				createInstanceNetworkInterfaceOptionsModel.AllowIPSpoofing = core.BoolPtr(true)
				createInstanceNetworkInterfaceOptionsModel.Name = core.StringPtr("my-instance-network-interface")
				createInstanceNetworkInterfaceOptionsModel.PrimaryIP = networkInterfaceIPPrototypeModel
				createInstanceNetworkInterfaceOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateInstanceNetworkInterface(createInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateInstanceNetworkInterface(createInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceNetworkInterface(createInstanceNetworkInterfaceOptions *CreateInstanceNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		createInstanceNetworkInterfacePath := "/instances/testString/network_interfaces"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceNetworkInterfacePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}`)
				}))
			})
			It(`Invoke CreateInstanceNetworkInterface successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateInstanceNetworkInterfaceOptions model
				createInstanceNetworkInterfaceOptionsModel := new(vpcv1.CreateInstanceNetworkInterfaceOptions)
				createInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceNetworkInterfaceOptionsModel.Subnet = subnetIdentityModel
				createInstanceNetworkInterfaceOptionsModel.AllowIPSpoofing = core.BoolPtr(true)
				createInstanceNetworkInterfaceOptionsModel.Name = core.StringPtr("my-instance-network-interface")
				createInstanceNetworkInterfaceOptionsModel.PrimaryIP = networkInterfaceIPPrototypeModel
				createInstanceNetworkInterfaceOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateInstanceNetworkInterfaceWithContext(ctx, createInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateInstanceNetworkInterface(createInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateInstanceNetworkInterfaceWithContext(ctx, createInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceNetworkInterfacePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}`)
				}))
			})
			It(`Invoke CreateInstanceNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateInstanceNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateInstanceNetworkInterfaceOptions model
				createInstanceNetworkInterfaceOptionsModel := new(vpcv1.CreateInstanceNetworkInterfaceOptions)
				createInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceNetworkInterfaceOptionsModel.Subnet = subnetIdentityModel
				createInstanceNetworkInterfaceOptionsModel.AllowIPSpoofing = core.BoolPtr(true)
				createInstanceNetworkInterfaceOptionsModel.Name = core.StringPtr("my-instance-network-interface")
				createInstanceNetworkInterfaceOptionsModel.PrimaryIP = networkInterfaceIPPrototypeModel
				createInstanceNetworkInterfaceOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateInstanceNetworkInterface(createInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateInstanceNetworkInterface with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateInstanceNetworkInterfaceOptions model
				createInstanceNetworkInterfaceOptionsModel := new(vpcv1.CreateInstanceNetworkInterfaceOptions)
				createInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceNetworkInterfaceOptionsModel.Subnet = subnetIdentityModel
				createInstanceNetworkInterfaceOptionsModel.AllowIPSpoofing = core.BoolPtr(true)
				createInstanceNetworkInterfaceOptionsModel.Name = core.StringPtr("my-instance-network-interface")
				createInstanceNetworkInterfaceOptionsModel.PrimaryIP = networkInterfaceIPPrototypeModel
				createInstanceNetworkInterfaceOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateInstanceNetworkInterface(createInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateInstanceNetworkInterfaceOptions model with no property values
				createInstanceNetworkInterfaceOptionsModelNew := new(vpcv1.CreateInstanceNetworkInterfaceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateInstanceNetworkInterface(createInstanceNetworkInterfaceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateInstanceNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateInstanceNetworkInterfaceOptions model
				createInstanceNetworkInterfaceOptionsModel := new(vpcv1.CreateInstanceNetworkInterfaceOptions)
				createInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceNetworkInterfaceOptionsModel.Subnet = subnetIdentityModel
				createInstanceNetworkInterfaceOptionsModel.AllowIPSpoofing = core.BoolPtr(true)
				createInstanceNetworkInterfaceOptionsModel.Name = core.StringPtr("my-instance-network-interface")
				createInstanceNetworkInterfaceOptionsModel.PrimaryIP = networkInterfaceIPPrototypeModel
				createInstanceNetworkInterfaceOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateInstanceNetworkInterface(createInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteInstanceNetworkInterface(deleteInstanceNetworkInterfaceOptions *DeleteInstanceNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		deleteInstanceNetworkInterfacePath := "/instances/testString/network_interfaces/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstanceNetworkInterfacePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteInstanceNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteInstanceNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteInstanceNetworkInterfaceOptions model
				deleteInstanceNetworkInterfaceOptionsModel := new(vpcv1.DeleteInstanceNetworkInterfaceOptions)
				deleteInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				deleteInstanceNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteInstanceNetworkInterface(deleteInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteInstanceNetworkInterface with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceNetworkInterfaceOptions model
				deleteInstanceNetworkInterfaceOptionsModel := new(vpcv1.DeleteInstanceNetworkInterfaceOptions)
				deleteInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				deleteInstanceNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteInstanceNetworkInterface(deleteInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteInstanceNetworkInterfaceOptions model with no property values
				deleteInstanceNetworkInterfaceOptionsModelNew := new(vpcv1.DeleteInstanceNetworkInterfaceOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteInstanceNetworkInterface(deleteInstanceNetworkInterfaceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceNetworkInterface(getInstanceNetworkInterfaceOptions *GetInstanceNetworkInterfaceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceNetworkInterfacePath := "/instances/testString/network_interfaces/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceNetworkInterfacePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceNetworkInterface with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceNetworkInterfaceOptions model
				getInstanceNetworkInterfaceOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceOptions)
				getInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceNetworkInterface(getInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceNetworkInterface(getInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceNetworkInterface(getInstanceNetworkInterfaceOptions *GetInstanceNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		getInstanceNetworkInterfacePath := "/instances/testString/network_interfaces/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceNetworkInterfacePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}`)
				}))
			})
			It(`Invoke GetInstanceNetworkInterface successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceNetworkInterfaceOptions model
				getInstanceNetworkInterfaceOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceOptions)
				getInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceNetworkInterfaceWithContext(ctx, getInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceNetworkInterface(getInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceNetworkInterfaceWithContext(ctx, getInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceNetworkInterfacePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}`)
				}))
			})
			It(`Invoke GetInstanceNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceNetworkInterfaceOptions model
				getInstanceNetworkInterfaceOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceOptions)
				getInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceNetworkInterface(getInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceNetworkInterface with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceNetworkInterfaceOptions model
				getInstanceNetworkInterfaceOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceOptions)
				getInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceNetworkInterface(getInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceNetworkInterfaceOptions model with no property values
				getInstanceNetworkInterfaceOptionsModelNew := new(vpcv1.GetInstanceNetworkInterfaceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceNetworkInterface(getInstanceNetworkInterfaceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceNetworkInterfaceOptions model
				getInstanceNetworkInterfaceOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceOptions)
				getInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceNetworkInterface(getInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptions *UpdateInstanceNetworkInterfaceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateInstanceNetworkInterfacePath := "/instances/testString/network_interfaces/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceNetworkInterfacePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateInstanceNetworkInterface with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkInterfacePatch model
				networkInterfacePatchModel := new(vpcv1.NetworkInterfacePatch)
				networkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				networkInterfacePatchModel.Name = core.StringPtr("my-network-interface-updated")
				networkInterfacePatchModelAsPatch, asPatchErr := networkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceNetworkInterfaceOptions model
				updateInstanceNetworkInterfaceOptionsModel := new(vpcv1.UpdateInstanceNetworkInterfaceOptions)
				updateInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateInstanceNetworkInterfaceOptionsModel.NetworkInterfacePatch = networkInterfacePatchModelAsPatch
				updateInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptions *UpdateInstanceNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		updateInstanceNetworkInterfacePath := "/instances/testString/network_interfaces/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceNetworkInterfacePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}`)
				}))
			})
			It(`Invoke UpdateInstanceNetworkInterface successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the NetworkInterfacePatch model
				networkInterfacePatchModel := new(vpcv1.NetworkInterfacePatch)
				networkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				networkInterfacePatchModel.Name = core.StringPtr("my-network-interface-updated")
				networkInterfacePatchModelAsPatch, asPatchErr := networkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceNetworkInterfaceOptions model
				updateInstanceNetworkInterfaceOptionsModel := new(vpcv1.UpdateInstanceNetworkInterfaceOptions)
				updateInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateInstanceNetworkInterfaceOptionsModel.NetworkInterfacePatch = networkInterfacePatchModelAsPatch
				updateInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateInstanceNetworkInterfaceWithContext(ctx, updateInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateInstanceNetworkInterfaceWithContext(ctx, updateInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceNetworkInterfacePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}`)
				}))
			})
			It(`Invoke UpdateInstanceNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateInstanceNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the NetworkInterfacePatch model
				networkInterfacePatchModel := new(vpcv1.NetworkInterfacePatch)
				networkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				networkInterfacePatchModel.Name = core.StringPtr("my-network-interface-updated")
				networkInterfacePatchModelAsPatch, asPatchErr := networkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceNetworkInterfaceOptions model
				updateInstanceNetworkInterfaceOptionsModel := new(vpcv1.UpdateInstanceNetworkInterfaceOptions)
				updateInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateInstanceNetworkInterfaceOptionsModel.NetworkInterfacePatch = networkInterfacePatchModelAsPatch
				updateInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateInstanceNetworkInterface with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkInterfacePatch model
				networkInterfacePatchModel := new(vpcv1.NetworkInterfacePatch)
				networkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				networkInterfacePatchModel.Name = core.StringPtr("my-network-interface-updated")
				networkInterfacePatchModelAsPatch, asPatchErr := networkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceNetworkInterfaceOptions model
				updateInstanceNetworkInterfaceOptionsModel := new(vpcv1.UpdateInstanceNetworkInterfaceOptions)
				updateInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateInstanceNetworkInterfaceOptionsModel.NetworkInterfacePatch = networkInterfacePatchModelAsPatch
				updateInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateInstanceNetworkInterfaceOptions model with no property values
				updateInstanceNetworkInterfaceOptionsModelNew := new(vpcv1.UpdateInstanceNetworkInterfaceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateInstanceNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkInterfacePatch model
				networkInterfacePatchModel := new(vpcv1.NetworkInterfacePatch)
				networkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				networkInterfacePatchModel.Name = core.StringPtr("my-network-interface-updated")
				networkInterfacePatchModelAsPatch, asPatchErr := networkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceNetworkInterfaceOptions model
				updateInstanceNetworkInterfaceOptionsModel := new(vpcv1.UpdateInstanceNetworkInterfaceOptions)
				updateInstanceNetworkInterfaceOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateInstanceNetworkInterfaceOptionsModel.NetworkInterfacePatch = networkInterfacePatchModelAsPatch
				updateInstanceNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptions *ListInstanceNetworkInterfaceFloatingIpsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstanceNetworkInterfaceFloatingIpsPath := "/instances/testString/network_interfaces/testString/floating_ips"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceNetworkInterfaceFloatingIpsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstanceNetworkInterfaceFloatingIps with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceNetworkInterfaceFloatingIpsOptions model
				listInstanceNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListInstanceNetworkInterfaceFloatingIpsOptions)
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptions *ListInstanceNetworkInterfaceFloatingIpsOptions)`, func() {
		version := "2024-06-23"
		listInstanceNetworkInterfaceFloatingIpsPath := "/instances/testString/network_interfaces/testString/floating_ips"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceNetworkInterfaceFloatingIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}`)
				}))
			})
			It(`Invoke ListInstanceNetworkInterfaceFloatingIps successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstanceNetworkInterfaceFloatingIpsOptions model
				listInstanceNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListInstanceNetworkInterfaceFloatingIpsOptions)
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstanceNetworkInterfaceFloatingIpsWithContext(ctx, listInstanceNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstanceNetworkInterfaceFloatingIpsWithContext(ctx, listInstanceNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceNetworkInterfaceFloatingIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}`)
				}))
			})
			It(`Invoke ListInstanceNetworkInterfaceFloatingIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaceFloatingIps(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstanceNetworkInterfaceFloatingIpsOptions model
				listInstanceNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListInstanceNetworkInterfaceFloatingIpsOptions)
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstanceNetworkInterfaceFloatingIps with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceNetworkInterfaceFloatingIpsOptions model
				listInstanceNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListInstanceNetworkInterfaceFloatingIpsOptions)
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListInstanceNetworkInterfaceFloatingIpsOptions model with no property values
				listInstanceNetworkInterfaceFloatingIpsOptionsModelNew := new(vpcv1.ListInstanceNetworkInterfaceFloatingIpsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstanceNetworkInterfaceFloatingIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceNetworkInterfaceFloatingIpsOptions model
				listInstanceNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListInstanceNetworkInterfaceFloatingIpsOptions)
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`RemoveInstanceNetworkInterfaceFloatingIP(removeInstanceNetworkInterfaceFloatingIPOptions *RemoveInstanceNetworkInterfaceFloatingIPOptions)`, func() {
		version := "2024-06-23"
		removeInstanceNetworkInterfaceFloatingIPPath := "/instances/testString/network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(removeInstanceNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke RemoveInstanceNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.RemoveInstanceNetworkInterfaceFloatingIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the RemoveInstanceNetworkInterfaceFloatingIPOptions model
				removeInstanceNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.RemoveInstanceNetworkInterfaceFloatingIPOptions)
				removeInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID = core.StringPtr("testString")
				removeInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				removeInstanceNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				removeInstanceNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.RemoveInstanceNetworkInterfaceFloatingIP(removeInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke RemoveInstanceNetworkInterfaceFloatingIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RemoveInstanceNetworkInterfaceFloatingIPOptions model
				removeInstanceNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.RemoveInstanceNetworkInterfaceFloatingIPOptions)
				removeInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID = core.StringPtr("testString")
				removeInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				removeInstanceNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				removeInstanceNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.RemoveInstanceNetworkInterfaceFloatingIP(removeInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the RemoveInstanceNetworkInterfaceFloatingIPOptions model with no property values
				removeInstanceNetworkInterfaceFloatingIPOptionsModelNew := new(vpcv1.RemoveInstanceNetworkInterfaceFloatingIPOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.RemoveInstanceNetworkInterfaceFloatingIP(removeInstanceNetworkInterfaceFloatingIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceNetworkInterfaceFloatingIP(getInstanceNetworkInterfaceFloatingIPOptions *GetInstanceNetworkInterfaceFloatingIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceNetworkInterfaceFloatingIPPath := "/instances/testString/network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceNetworkInterfaceFloatingIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceNetworkInterfaceFloatingIPOptions model
				getInstanceNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceFloatingIPOptions)
				getInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceNetworkInterfaceFloatingIP(getInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceNetworkInterfaceFloatingIP(getInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceNetworkInterfaceFloatingIP(getInstanceNetworkInterfaceFloatingIPOptions *GetInstanceNetworkInterfaceFloatingIPOptions)`, func() {
		version := "2024-06-23"
		getInstanceNetworkInterfaceFloatingIPPath := "/instances/testString/network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetInstanceNetworkInterfaceFloatingIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceNetworkInterfaceFloatingIPOptions model
				getInstanceNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceFloatingIPOptions)
				getInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceNetworkInterfaceFloatingIPWithContext(ctx, getInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceNetworkInterfaceFloatingIP(getInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceNetworkInterfaceFloatingIPWithContext(ctx, getInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetInstanceNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceNetworkInterfaceFloatingIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceNetworkInterfaceFloatingIPOptions model
				getInstanceNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceFloatingIPOptions)
				getInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceNetworkInterfaceFloatingIP(getInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceNetworkInterfaceFloatingIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceNetworkInterfaceFloatingIPOptions model
				getInstanceNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceFloatingIPOptions)
				getInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceNetworkInterfaceFloatingIP(getInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceNetworkInterfaceFloatingIPOptions model with no property values
				getInstanceNetworkInterfaceFloatingIPOptionsModelNew := new(vpcv1.GetInstanceNetworkInterfaceFloatingIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceNetworkInterfaceFloatingIP(getInstanceNetworkInterfaceFloatingIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceNetworkInterfaceFloatingIPOptions model
				getInstanceNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceFloatingIPOptions)
				getInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceNetworkInterfaceFloatingIP(getInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`AddInstanceNetworkInterfaceFloatingIP(addInstanceNetworkInterfaceFloatingIPOptions *AddInstanceNetworkInterfaceFloatingIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		addInstanceNetworkInterfaceFloatingIPPath := "/instances/testString/network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addInstanceNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("PUT"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke AddInstanceNetworkInterfaceFloatingIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddInstanceNetworkInterfaceFloatingIPOptions model
				addInstanceNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddInstanceNetworkInterfaceFloatingIPOptions)
				addInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.AddInstanceNetworkInterfaceFloatingIP(addInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.AddInstanceNetworkInterfaceFloatingIP(addInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`AddInstanceNetworkInterfaceFloatingIP(addInstanceNetworkInterfaceFloatingIPOptions *AddInstanceNetworkInterfaceFloatingIPOptions)`, func() {
		version := "2024-06-23"
		addInstanceNetworkInterfaceFloatingIPPath := "/instances/testString/network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addInstanceNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke AddInstanceNetworkInterfaceFloatingIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the AddInstanceNetworkInterfaceFloatingIPOptions model
				addInstanceNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddInstanceNetworkInterfaceFloatingIPOptions)
				addInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.AddInstanceNetworkInterfaceFloatingIPWithContext(ctx, addInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.AddInstanceNetworkInterfaceFloatingIP(addInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.AddInstanceNetworkInterfaceFloatingIPWithContext(ctx, addInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addInstanceNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke AddInstanceNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.AddInstanceNetworkInterfaceFloatingIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the AddInstanceNetworkInterfaceFloatingIPOptions model
				addInstanceNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddInstanceNetworkInterfaceFloatingIPOptions)
				addInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.AddInstanceNetworkInterfaceFloatingIP(addInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke AddInstanceNetworkInterfaceFloatingIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddInstanceNetworkInterfaceFloatingIPOptions model
				addInstanceNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddInstanceNetworkInterfaceFloatingIPOptions)
				addInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.AddInstanceNetworkInterfaceFloatingIP(addInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the AddInstanceNetworkInterfaceFloatingIPOptions model with no property values
				addInstanceNetworkInterfaceFloatingIPOptionsModelNew := new(vpcv1.AddInstanceNetworkInterfaceFloatingIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.AddInstanceNetworkInterfaceFloatingIP(addInstanceNetworkInterfaceFloatingIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke AddInstanceNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddInstanceNetworkInterfaceFloatingIPOptions model
				addInstanceNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddInstanceNetworkInterfaceFloatingIPOptions)
				addInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.AddInstanceNetworkInterfaceFloatingIP(addInstanceNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptions *ListInstanceNetworkInterfaceIpsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstanceNetworkInterfaceIpsPath := "/instances/testString/network_interfaces/testString/ips"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceNetworkInterfaceIpsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstanceNetworkInterfaceIps with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceNetworkInterfaceIpsOptions model
				listInstanceNetworkInterfaceIpsOptionsModel := new(vpcv1.ListInstanceNetworkInterfaceIpsOptions)
				listInstanceNetworkInterfaceIpsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.Start = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptions *ListInstanceNetworkInterfaceIpsOptions)`, func() {
		version := "2024-06-23"
		listInstanceNetworkInterfaceIpsPath := "/instances/testString/network_interfaces/testString/ips"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceNetworkInterfaceIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceNetworkInterfaceIps successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstanceNetworkInterfaceIpsOptions model
				listInstanceNetworkInterfaceIpsOptionsModel := new(vpcv1.ListInstanceNetworkInterfaceIpsOptions)
				listInstanceNetworkInterfaceIpsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.Start = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstanceNetworkInterfaceIpsWithContext(ctx, listInstanceNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstanceNetworkInterfaceIpsWithContext(ctx, listInstanceNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceNetworkInterfaceIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListInstanceNetworkInterfaceIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaceIps(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstanceNetworkInterfaceIpsOptions model
				listInstanceNetworkInterfaceIpsOptionsModel := new(vpcv1.ListInstanceNetworkInterfaceIpsOptions)
				listInstanceNetworkInterfaceIpsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.Start = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstanceNetworkInterfaceIps with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceNetworkInterfaceIpsOptions model
				listInstanceNetworkInterfaceIpsOptionsModel := new(vpcv1.ListInstanceNetworkInterfaceIpsOptions)
				listInstanceNetworkInterfaceIpsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.Start = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListInstanceNetworkInterfaceIpsOptions model with no property values
				listInstanceNetworkInterfaceIpsOptionsModelNew := new(vpcv1.ListInstanceNetworkInterfaceIpsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstanceNetworkInterfaceIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceNetworkInterfaceIpsOptions model
				listInstanceNetworkInterfaceIpsOptionsModel := new(vpcv1.ListInstanceNetworkInterfaceIpsOptions)
				listInstanceNetworkInterfaceIpsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.Start = core.StringPtr("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listInstanceNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ReservedIPCollectionInstanceNetworkInterfaceContext)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ReservedIPCollectionInstanceNetworkInterfaceContext)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ReservedIPCollectionInstanceNetworkInterfaceContext)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceNetworkInterfaceIpsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"provider","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","id":"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"provider","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","id":"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use InstanceNetworkInterfaceIpsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstanceNetworkInterfaceIpsOptionsModel := &vpcv1.ListInstanceNetworkInterfaceIpsOptions{
					InstanceID:         core.StringPtr("testString"),
					NetworkInterfaceID: core.StringPtr("testString"),
					Limit:              core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewInstanceNetworkInterfaceIpsPager(listInstanceNetworkInterfaceIpsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.ReservedIP
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use InstanceNetworkInterfaceIpsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listInstanceNetworkInterfaceIpsOptionsModel := &vpcv1.ListInstanceNetworkInterfaceIpsOptions{
					InstanceID:         core.StringPtr("testString"),
					NetworkInterfaceID: core.StringPtr("testString"),
					Limit:              core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewInstanceNetworkInterfaceIpsPager(listInstanceNetworkInterfaceIpsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`GetInstanceNetworkInterfaceIP(getInstanceNetworkInterfaceIPOptions *GetInstanceNetworkInterfaceIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceNetworkInterfaceIPPath := "/instances/testString/network_interfaces/testString/ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceNetworkInterfaceIPPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceNetworkInterfaceIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceNetworkInterfaceIPOptions model
				getInstanceNetworkInterfaceIPOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceIPOptions)
				getInstanceNetworkInterfaceIPOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceNetworkInterfaceIP(getInstanceNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceNetworkInterfaceIP(getInstanceNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceNetworkInterfaceIP(getInstanceNetworkInterfaceIPOptions *GetInstanceNetworkInterfaceIPOptions)`, func() {
		version := "2024-06-23"
		getInstanceNetworkInterfaceIPPath := "/instances/testString/network_interfaces/testString/ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceNetworkInterfaceIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}`)
				}))
			})
			It(`Invoke GetInstanceNetworkInterfaceIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceNetworkInterfaceIPOptions model
				getInstanceNetworkInterfaceIPOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceIPOptions)
				getInstanceNetworkInterfaceIPOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceNetworkInterfaceIPWithContext(ctx, getInstanceNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceNetworkInterfaceIP(getInstanceNetworkInterfaceIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceNetworkInterfaceIPWithContext(ctx, getInstanceNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceNetworkInterfaceIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}`)
				}))
			})
			It(`Invoke GetInstanceNetworkInterfaceIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceNetworkInterfaceIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceNetworkInterfaceIPOptions model
				getInstanceNetworkInterfaceIPOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceIPOptions)
				getInstanceNetworkInterfaceIPOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceNetworkInterfaceIP(getInstanceNetworkInterfaceIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceNetworkInterfaceIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceNetworkInterfaceIPOptions model
				getInstanceNetworkInterfaceIPOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceIPOptions)
				getInstanceNetworkInterfaceIPOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceNetworkInterfaceIP(getInstanceNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceNetworkInterfaceIPOptions model with no property values
				getInstanceNetworkInterfaceIPOptionsModelNew := new(vpcv1.GetInstanceNetworkInterfaceIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceNetworkInterfaceIP(getInstanceNetworkInterfaceIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceNetworkInterfaceIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceNetworkInterfaceIPOptions model
				getInstanceNetworkInterfaceIPOptionsModel := new(vpcv1.GetInstanceNetworkInterfaceIPOptions)
				getInstanceNetworkInterfaceIPOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.NetworkInterfaceID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getInstanceNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceNetworkInterfaceIP(getInstanceNetworkInterfaceIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptions *ListInstanceVolumeAttachmentsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listInstanceVolumeAttachmentsPath := "/instances/testString/volume_attachments"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceVolumeAttachmentsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListInstanceVolumeAttachments with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceVolumeAttachmentsOptions model
				listInstanceVolumeAttachmentsOptionsModel := new(vpcv1.ListInstanceVolumeAttachmentsOptions)
				listInstanceVolumeAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceVolumeAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptions *ListInstanceVolumeAttachmentsOptions)`, func() {
		version := "2024-06-23"
		listInstanceVolumeAttachmentsPath := "/instances/testString/volume_attachments"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceVolumeAttachmentsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"volume_attachments": [{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}]}`)
				}))
			})
			It(`Invoke ListInstanceVolumeAttachments successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListInstanceVolumeAttachmentsOptions model
				listInstanceVolumeAttachmentsOptionsModel := new(vpcv1.ListInstanceVolumeAttachmentsOptions)
				listInstanceVolumeAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceVolumeAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListInstanceVolumeAttachmentsWithContext(ctx, listInstanceVolumeAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListInstanceVolumeAttachmentsWithContext(ctx, listInstanceVolumeAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listInstanceVolumeAttachmentsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"volume_attachments": [{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}]}`)
				}))
			})
			It(`Invoke ListInstanceVolumeAttachments successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListInstanceVolumeAttachments(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListInstanceVolumeAttachmentsOptions model
				listInstanceVolumeAttachmentsOptionsModel := new(vpcv1.ListInstanceVolumeAttachmentsOptions)
				listInstanceVolumeAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceVolumeAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListInstanceVolumeAttachments with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceVolumeAttachmentsOptions model
				listInstanceVolumeAttachmentsOptionsModel := new(vpcv1.ListInstanceVolumeAttachmentsOptions)
				listInstanceVolumeAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceVolumeAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListInstanceVolumeAttachmentsOptions model with no property values
				listInstanceVolumeAttachmentsOptionsModelNew := new(vpcv1.ListInstanceVolumeAttachmentsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListInstanceVolumeAttachments successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListInstanceVolumeAttachmentsOptions model
				listInstanceVolumeAttachmentsOptionsModel := new(vpcv1.ListInstanceVolumeAttachmentsOptions)
				listInstanceVolumeAttachmentsOptionsModel.InstanceID = core.StringPtr("testString")
				listInstanceVolumeAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceVolumeAttachment(createInstanceVolumeAttachmentOptions *CreateInstanceVolumeAttachmentOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createInstanceVolumeAttachmentPath := "/instances/testString/volume_attachments"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceVolumeAttachmentPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateInstanceVolumeAttachment with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID)
				volumeAttachmentPrototypeVolumeModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the CreateInstanceVolumeAttachmentOptions model
				createInstanceVolumeAttachmentOptionsModel := new(vpcv1.CreateInstanceVolumeAttachmentOptions)
				createInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceVolumeAttachmentOptionsModel.Volume = volumeAttachmentPrototypeVolumeModel
				createInstanceVolumeAttachmentOptionsModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				createInstanceVolumeAttachmentOptionsModel.Name = core.StringPtr("my-volume-attachment")
				createInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateInstanceVolumeAttachment(createInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateInstanceVolumeAttachment(createInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateInstanceVolumeAttachment(createInstanceVolumeAttachmentOptions *CreateInstanceVolumeAttachmentOptions)`, func() {
		version := "2024-06-23"
		createInstanceVolumeAttachmentPath := "/instances/testString/volume_attachments"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceVolumeAttachmentPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}`)
				}))
			})
			It(`Invoke CreateInstanceVolumeAttachment successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID)
				volumeAttachmentPrototypeVolumeModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the CreateInstanceVolumeAttachmentOptions model
				createInstanceVolumeAttachmentOptionsModel := new(vpcv1.CreateInstanceVolumeAttachmentOptions)
				createInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceVolumeAttachmentOptionsModel.Volume = volumeAttachmentPrototypeVolumeModel
				createInstanceVolumeAttachmentOptionsModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				createInstanceVolumeAttachmentOptionsModel.Name = core.StringPtr("my-volume-attachment")
				createInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateInstanceVolumeAttachmentWithContext(ctx, createInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateInstanceVolumeAttachment(createInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateInstanceVolumeAttachmentWithContext(ctx, createInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createInstanceVolumeAttachmentPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}`)
				}))
			})
			It(`Invoke CreateInstanceVolumeAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateInstanceVolumeAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID)
				volumeAttachmentPrototypeVolumeModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the CreateInstanceVolumeAttachmentOptions model
				createInstanceVolumeAttachmentOptionsModel := new(vpcv1.CreateInstanceVolumeAttachmentOptions)
				createInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceVolumeAttachmentOptionsModel.Volume = volumeAttachmentPrototypeVolumeModel
				createInstanceVolumeAttachmentOptionsModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				createInstanceVolumeAttachmentOptionsModel.Name = core.StringPtr("my-volume-attachment")
				createInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateInstanceVolumeAttachment(createInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateInstanceVolumeAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID)
				volumeAttachmentPrototypeVolumeModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the CreateInstanceVolumeAttachmentOptions model
				createInstanceVolumeAttachmentOptionsModel := new(vpcv1.CreateInstanceVolumeAttachmentOptions)
				createInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceVolumeAttachmentOptionsModel.Volume = volumeAttachmentPrototypeVolumeModel
				createInstanceVolumeAttachmentOptionsModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				createInstanceVolumeAttachmentOptionsModel.Name = core.StringPtr("my-volume-attachment")
				createInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateInstanceVolumeAttachment(createInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateInstanceVolumeAttachmentOptions model with no property values
				createInstanceVolumeAttachmentOptionsModelNew := new(vpcv1.CreateInstanceVolumeAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateInstanceVolumeAttachment(createInstanceVolumeAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateInstanceVolumeAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID)
				volumeAttachmentPrototypeVolumeModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the CreateInstanceVolumeAttachmentOptions model
				createInstanceVolumeAttachmentOptionsModel := new(vpcv1.CreateInstanceVolumeAttachmentOptions)
				createInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				createInstanceVolumeAttachmentOptionsModel.Volume = volumeAttachmentPrototypeVolumeModel
				createInstanceVolumeAttachmentOptionsModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				createInstanceVolumeAttachmentOptionsModel.Name = core.StringPtr("my-volume-attachment")
				createInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateInstanceVolumeAttachment(createInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteInstanceVolumeAttachment(deleteInstanceVolumeAttachmentOptions *DeleteInstanceVolumeAttachmentOptions)`, func() {
		version := "2024-06-23"
		deleteInstanceVolumeAttachmentPath := "/instances/testString/volume_attachments/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteInstanceVolumeAttachmentPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteInstanceVolumeAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteInstanceVolumeAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteInstanceVolumeAttachmentOptions model
				deleteInstanceVolumeAttachmentOptionsModel := new(vpcv1.DeleteInstanceVolumeAttachmentOptions)
				deleteInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				deleteInstanceVolumeAttachmentOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteInstanceVolumeAttachment(deleteInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteInstanceVolumeAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteInstanceVolumeAttachmentOptions model
				deleteInstanceVolumeAttachmentOptionsModel := new(vpcv1.DeleteInstanceVolumeAttachmentOptions)
				deleteInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				deleteInstanceVolumeAttachmentOptionsModel.ID = core.StringPtr("testString")
				deleteInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteInstanceVolumeAttachment(deleteInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteInstanceVolumeAttachmentOptions model with no property values
				deleteInstanceVolumeAttachmentOptionsModelNew := new(vpcv1.DeleteInstanceVolumeAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteInstanceVolumeAttachment(deleteInstanceVolumeAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceVolumeAttachment(getInstanceVolumeAttachmentOptions *GetInstanceVolumeAttachmentOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getInstanceVolumeAttachmentPath := "/instances/testString/volume_attachments/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceVolumeAttachmentPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetInstanceVolumeAttachment with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceVolumeAttachmentOptions model
				getInstanceVolumeAttachmentOptionsModel := new(vpcv1.GetInstanceVolumeAttachmentOptions)
				getInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceVolumeAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetInstanceVolumeAttachment(getInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetInstanceVolumeAttachment(getInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetInstanceVolumeAttachment(getInstanceVolumeAttachmentOptions *GetInstanceVolumeAttachmentOptions)`, func() {
		version := "2024-06-23"
		getInstanceVolumeAttachmentPath := "/instances/testString/volume_attachments/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceVolumeAttachmentPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}`)
				}))
			})
			It(`Invoke GetInstanceVolumeAttachment successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetInstanceVolumeAttachmentOptions model
				getInstanceVolumeAttachmentOptionsModel := new(vpcv1.GetInstanceVolumeAttachmentOptions)
				getInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceVolumeAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetInstanceVolumeAttachmentWithContext(ctx, getInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetInstanceVolumeAttachment(getInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetInstanceVolumeAttachmentWithContext(ctx, getInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getInstanceVolumeAttachmentPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}`)
				}))
			})
			It(`Invoke GetInstanceVolumeAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetInstanceVolumeAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetInstanceVolumeAttachmentOptions model
				getInstanceVolumeAttachmentOptionsModel := new(vpcv1.GetInstanceVolumeAttachmentOptions)
				getInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceVolumeAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetInstanceVolumeAttachment(getInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetInstanceVolumeAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceVolumeAttachmentOptions model
				getInstanceVolumeAttachmentOptionsModel := new(vpcv1.GetInstanceVolumeAttachmentOptions)
				getInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceVolumeAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetInstanceVolumeAttachment(getInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetInstanceVolumeAttachmentOptions model with no property values
				getInstanceVolumeAttachmentOptionsModelNew := new(vpcv1.GetInstanceVolumeAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetInstanceVolumeAttachment(getInstanceVolumeAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetInstanceVolumeAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetInstanceVolumeAttachmentOptions model
				getInstanceVolumeAttachmentOptionsModel := new(vpcv1.GetInstanceVolumeAttachmentOptions)
				getInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				getInstanceVolumeAttachmentOptionsModel.ID = core.StringPtr("testString")
				getInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetInstanceVolumeAttachment(getInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptions *UpdateInstanceVolumeAttachmentOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateInstanceVolumeAttachmentPath := "/instances/testString/volume_attachments/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceVolumeAttachmentPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateInstanceVolumeAttachment with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VolumeAttachmentPatch model
				volumeAttachmentPatchModel := new(vpcv1.VolumeAttachmentPatch)
				volumeAttachmentPatchModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPatchModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPatchModelAsPatch, asPatchErr := volumeAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceVolumeAttachmentOptions model
				updateInstanceVolumeAttachmentOptionsModel := new(vpcv1.UpdateInstanceVolumeAttachmentOptions)
				updateInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceVolumeAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceVolumeAttachmentOptionsModel.VolumeAttachmentPatch = volumeAttachmentPatchModelAsPatch
				updateInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptions *UpdateInstanceVolumeAttachmentOptions)`, func() {
		version := "2024-06-23"
		updateInstanceVolumeAttachmentPath := "/instances/testString/volume_attachments/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceVolumeAttachmentPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}`)
				}))
			})
			It(`Invoke UpdateInstanceVolumeAttachment successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VolumeAttachmentPatch model
				volumeAttachmentPatchModel := new(vpcv1.VolumeAttachmentPatch)
				volumeAttachmentPatchModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPatchModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPatchModelAsPatch, asPatchErr := volumeAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceVolumeAttachmentOptions model
				updateInstanceVolumeAttachmentOptionsModel := new(vpcv1.UpdateInstanceVolumeAttachmentOptions)
				updateInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceVolumeAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceVolumeAttachmentOptionsModel.VolumeAttachmentPatch = volumeAttachmentPatchModelAsPatch
				updateInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateInstanceVolumeAttachmentWithContext(ctx, updateInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateInstanceVolumeAttachmentWithContext(ctx, updateInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateInstanceVolumeAttachmentPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}`)
				}))
			})
			It(`Invoke UpdateInstanceVolumeAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateInstanceVolumeAttachment(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VolumeAttachmentPatch model
				volumeAttachmentPatchModel := new(vpcv1.VolumeAttachmentPatch)
				volumeAttachmentPatchModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPatchModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPatchModelAsPatch, asPatchErr := volumeAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceVolumeAttachmentOptions model
				updateInstanceVolumeAttachmentOptionsModel := new(vpcv1.UpdateInstanceVolumeAttachmentOptions)
				updateInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceVolumeAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceVolumeAttachmentOptionsModel.VolumeAttachmentPatch = volumeAttachmentPatchModelAsPatch
				updateInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateInstanceVolumeAttachment with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VolumeAttachmentPatch model
				volumeAttachmentPatchModel := new(vpcv1.VolumeAttachmentPatch)
				volumeAttachmentPatchModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPatchModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPatchModelAsPatch, asPatchErr := volumeAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceVolumeAttachmentOptions model
				updateInstanceVolumeAttachmentOptionsModel := new(vpcv1.UpdateInstanceVolumeAttachmentOptions)
				updateInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceVolumeAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceVolumeAttachmentOptionsModel.VolumeAttachmentPatch = volumeAttachmentPatchModelAsPatch
				updateInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateInstanceVolumeAttachmentOptions model with no property values
				updateInstanceVolumeAttachmentOptionsModelNew := new(vpcv1.UpdateInstanceVolumeAttachmentOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateInstanceVolumeAttachment successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VolumeAttachmentPatch model
				volumeAttachmentPatchModel := new(vpcv1.VolumeAttachmentPatch)
				volumeAttachmentPatchModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPatchModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPatchModelAsPatch, asPatchErr := volumeAttachmentPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateInstanceVolumeAttachmentOptions model
				updateInstanceVolumeAttachmentOptionsModel := new(vpcv1.UpdateInstanceVolumeAttachmentOptions)
				updateInstanceVolumeAttachmentOptionsModel.InstanceID = core.StringPtr("testString")
				updateInstanceVolumeAttachmentOptionsModel.ID = core.StringPtr("testString")
				updateInstanceVolumeAttachmentOptionsModel.VolumeAttachmentPatch = volumeAttachmentPatchModelAsPatch
				updateInstanceVolumeAttachmentOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListKeys(listKeysOptions *ListKeysOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listKeysPath := "/keys"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listKeysPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListKeys with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListKeysOptions model
				listKeysOptionsModel := new(vpcv1.ListKeysOptions)
				listKeysOptionsModel.Start = core.StringPtr("testString")
				listKeysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listKeysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listKeysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListKeys(listKeysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListKeys(listKeysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListKeys(listKeysOptions *ListKeysOptions)`, func() {
		version := "2024-06-23"
		listKeysPath := "/keys"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listKeysPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListKeys successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListKeysOptions model
				listKeysOptionsModel := new(vpcv1.ListKeysOptions)
				listKeysOptionsModel.Start = core.StringPtr("testString")
				listKeysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listKeysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listKeysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListKeysWithContext(ctx, listKeysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListKeys(listKeysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListKeysWithContext(ctx, listKeysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listKeysPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListKeys successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListKeys(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListKeysOptions model
				listKeysOptionsModel := new(vpcv1.ListKeysOptions)
				listKeysOptionsModel.Start = core.StringPtr("testString")
				listKeysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listKeysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listKeysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListKeys(listKeysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListKeys with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListKeysOptions model
				listKeysOptionsModel := new(vpcv1.ListKeysOptions)
				listKeysOptionsModel.Start = core.StringPtr("testString")
				listKeysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listKeysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listKeysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListKeys(listKeysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListKeys successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListKeysOptions model
				listKeysOptionsModel := new(vpcv1.ListKeysOptions)
				listKeysOptionsModel.Start = core.StringPtr("testString")
				listKeysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listKeysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listKeysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListKeys(listKeysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.KeyCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.KeyCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.KeyCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listKeysPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"keys":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45","fingerprint":"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY","href":"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45","id":"r006-82679077-ac3b-4c10-be16-63e9c21f0f45","length":2048,"name":"my-key-1","public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"type":"ed25519"}],"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"keys":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45","fingerprint":"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY","href":"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45","id":"r006-82679077-ac3b-4c10-be16-63e9c21f0f45","length":2048,"name":"my-key-1","public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"type":"ed25519"}],"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use KeysPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listKeysOptionsModel := &vpcv1.ListKeysOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewKeysPager(listKeysOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.Key
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use KeysPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listKeysOptionsModel := &vpcv1.ListKeysOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewKeysPager(listKeysOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateKey(createKeyOptions *CreateKeyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createKeyPath := "/keys"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createKeyPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateKey with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateKeyOptions model
				createKeyOptionsModel := new(vpcv1.CreateKeyOptions)
				createKeyOptionsModel.PublicKey = core.StringPtr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En")
				createKeyOptionsModel.Name = core.StringPtr("my-key-1")
				createKeyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createKeyOptionsModel.Type = core.StringPtr("rsa")
				createKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateKey(createKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateKey(createKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateKey(createKeyOptions *CreateKeyOptions)`, func() {
		version := "2024-06-23"
		createKeyPath := "/keys"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createKeyPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}`)
				}))
			})
			It(`Invoke CreateKey successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateKeyOptions model
				createKeyOptionsModel := new(vpcv1.CreateKeyOptions)
				createKeyOptionsModel.PublicKey = core.StringPtr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En")
				createKeyOptionsModel.Name = core.StringPtr("my-key-1")
				createKeyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createKeyOptionsModel.Type = core.StringPtr("rsa")
				createKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateKeyWithContext(ctx, createKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateKey(createKeyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateKeyWithContext(ctx, createKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createKeyPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}`)
				}))
			})
			It(`Invoke CreateKey successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateKey(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateKeyOptions model
				createKeyOptionsModel := new(vpcv1.CreateKeyOptions)
				createKeyOptionsModel.PublicKey = core.StringPtr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En")
				createKeyOptionsModel.Name = core.StringPtr("my-key-1")
				createKeyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createKeyOptionsModel.Type = core.StringPtr("rsa")
				createKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateKey(createKeyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateKey with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateKeyOptions model
				createKeyOptionsModel := new(vpcv1.CreateKeyOptions)
				createKeyOptionsModel.PublicKey = core.StringPtr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En")
				createKeyOptionsModel.Name = core.StringPtr("my-key-1")
				createKeyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createKeyOptionsModel.Type = core.StringPtr("rsa")
				createKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateKey(createKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateKeyOptions model with no property values
				createKeyOptionsModelNew := new(vpcv1.CreateKeyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateKey(createKeyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateKey successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateKeyOptions model
				createKeyOptionsModel := new(vpcv1.CreateKeyOptions)
				createKeyOptionsModel.PublicKey = core.StringPtr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En")
				createKeyOptionsModel.Name = core.StringPtr("my-key-1")
				createKeyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createKeyOptionsModel.Type = core.StringPtr("rsa")
				createKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateKey(createKeyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteKey(deleteKeyOptions *DeleteKeyOptions)`, func() {
		version := "2024-06-23"
		deleteKeyPath := "/keys/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteKeyPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteKey successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteKey(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteKeyOptions model
				deleteKeyOptionsModel := new(vpcv1.DeleteKeyOptions)
				deleteKeyOptionsModel.ID = core.StringPtr("testString")
				deleteKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteKey(deleteKeyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteKey with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteKeyOptions model
				deleteKeyOptionsModel := new(vpcv1.DeleteKeyOptions)
				deleteKeyOptionsModel.ID = core.StringPtr("testString")
				deleteKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteKey(deleteKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteKeyOptions model with no property values
				deleteKeyOptionsModelNew := new(vpcv1.DeleteKeyOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteKey(deleteKeyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetKey(getKeyOptions *GetKeyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getKeyPath := "/keys/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getKeyPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetKey with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetKeyOptions model
				getKeyOptionsModel := new(vpcv1.GetKeyOptions)
				getKeyOptionsModel.ID = core.StringPtr("testString")
				getKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetKey(getKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetKey(getKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetKey(getKeyOptions *GetKeyOptions)`, func() {
		version := "2024-06-23"
		getKeyPath := "/keys/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getKeyPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}`)
				}))
			})
			It(`Invoke GetKey successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetKeyOptions model
				getKeyOptionsModel := new(vpcv1.GetKeyOptions)
				getKeyOptionsModel.ID = core.StringPtr("testString")
				getKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetKeyWithContext(ctx, getKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetKey(getKeyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetKeyWithContext(ctx, getKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getKeyPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}`)
				}))
			})
			It(`Invoke GetKey successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetKey(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetKeyOptions model
				getKeyOptionsModel := new(vpcv1.GetKeyOptions)
				getKeyOptionsModel.ID = core.StringPtr("testString")
				getKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetKey(getKeyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetKey with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetKeyOptions model
				getKeyOptionsModel := new(vpcv1.GetKeyOptions)
				getKeyOptionsModel.ID = core.StringPtr("testString")
				getKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetKey(getKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetKeyOptions model with no property values
				getKeyOptionsModelNew := new(vpcv1.GetKeyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetKey(getKeyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetKey successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetKeyOptions model
				getKeyOptionsModel := new(vpcv1.GetKeyOptions)
				getKeyOptionsModel.ID = core.StringPtr("testString")
				getKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetKey(getKeyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateKey(updateKeyOptions *UpdateKeyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateKeyPath := "/keys/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateKeyPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateKey with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the KeyPatch model
				keyPatchModel := new(vpcv1.KeyPatch)
				keyPatchModel.Name = core.StringPtr("my-key-1")
				keyPatchModelAsPatch, asPatchErr := keyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateKeyOptions model
				updateKeyOptionsModel := new(vpcv1.UpdateKeyOptions)
				updateKeyOptionsModel.ID = core.StringPtr("testString")
				updateKeyOptionsModel.KeyPatch = keyPatchModelAsPatch
				updateKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateKey(updateKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateKey(updateKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateKey(updateKeyOptions *UpdateKeyOptions)`, func() {
		version := "2024-06-23"
		updateKeyPath := "/keys/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateKeyPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}`)
				}))
			})
			It(`Invoke UpdateKey successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the KeyPatch model
				keyPatchModel := new(vpcv1.KeyPatch)
				keyPatchModel.Name = core.StringPtr("my-key-1")
				keyPatchModelAsPatch, asPatchErr := keyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateKeyOptions model
				updateKeyOptionsModel := new(vpcv1.UpdateKeyOptions)
				updateKeyOptionsModel.ID = core.StringPtr("testString")
				updateKeyOptionsModel.KeyPatch = keyPatchModelAsPatch
				updateKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateKeyWithContext(ctx, updateKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateKey(updateKeyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateKeyWithContext(ctx, updateKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateKeyPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}`)
				}))
			})
			It(`Invoke UpdateKey successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateKey(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the KeyPatch model
				keyPatchModel := new(vpcv1.KeyPatch)
				keyPatchModel.Name = core.StringPtr("my-key-1")
				keyPatchModelAsPatch, asPatchErr := keyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateKeyOptions model
				updateKeyOptionsModel := new(vpcv1.UpdateKeyOptions)
				updateKeyOptionsModel.ID = core.StringPtr("testString")
				updateKeyOptionsModel.KeyPatch = keyPatchModelAsPatch
				updateKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateKey(updateKeyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateKey with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the KeyPatch model
				keyPatchModel := new(vpcv1.KeyPatch)
				keyPatchModel.Name = core.StringPtr("my-key-1")
				keyPatchModelAsPatch, asPatchErr := keyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateKeyOptions model
				updateKeyOptionsModel := new(vpcv1.UpdateKeyOptions)
				updateKeyOptionsModel.ID = core.StringPtr("testString")
				updateKeyOptionsModel.KeyPatch = keyPatchModelAsPatch
				updateKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateKey(updateKeyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateKeyOptions model with no property values
				updateKeyOptionsModelNew := new(vpcv1.UpdateKeyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateKey(updateKeyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateKey successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the KeyPatch model
				keyPatchModel := new(vpcv1.KeyPatch)
				keyPatchModel.Name = core.StringPtr("my-key-1")
				keyPatchModelAsPatch, asPatchErr := keyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateKeyOptions model
				updateKeyOptionsModel := new(vpcv1.UpdateKeyOptions)
				updateKeyOptionsModel.ID = core.StringPtr("testString")
				updateKeyOptionsModel.KeyPatch = keyPatchModelAsPatch
				updateKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateKey(updateKeyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListLoadBalancerProfiles(listLoadBalancerProfilesOptions *ListLoadBalancerProfilesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listLoadBalancerProfilesPath := "/load_balancer/profiles"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerProfilesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListLoadBalancerProfiles with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerProfilesOptions model
				listLoadBalancerProfilesOptionsModel := new(vpcv1.ListLoadBalancerProfilesOptions)
				listLoadBalancerProfilesOptionsModel.Start = core.StringPtr("testString")
				listLoadBalancerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listLoadBalancerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListLoadBalancerProfiles(listLoadBalancerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListLoadBalancerProfiles(listLoadBalancerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListLoadBalancerProfiles(listLoadBalancerProfilesOptions *ListLoadBalancerProfilesOptions)`, func() {
		version := "2024-06-23"
		listLoadBalancerProfilesPath := "/load_balancer/profiles"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "profiles": [{"access_modes": {"type": "enum", "values": ["private"]}, "availability": {"type": "fixed", "value": "region"}, "failsafe_policy_actions": {"default": "fail", "type": "enum", "values": ["forward"]}, "family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "source_ip_session_persistence_supported": {"type": "fixed", "value": true}, "targetable_load_balancer_profiles": [{"family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}], "targetable_resource_types": {"type": "enum", "values": ["instance"]}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListLoadBalancerProfiles successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListLoadBalancerProfilesOptions model
				listLoadBalancerProfilesOptionsModel := new(vpcv1.ListLoadBalancerProfilesOptions)
				listLoadBalancerProfilesOptionsModel.Start = core.StringPtr("testString")
				listLoadBalancerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listLoadBalancerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListLoadBalancerProfilesWithContext(ctx, listLoadBalancerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListLoadBalancerProfiles(listLoadBalancerProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListLoadBalancerProfilesWithContext(ctx, listLoadBalancerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "profiles": [{"access_modes": {"type": "enum", "values": ["private"]}, "availability": {"type": "fixed", "value": "region"}, "failsafe_policy_actions": {"default": "fail", "type": "enum", "values": ["forward"]}, "family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "source_ip_session_persistence_supported": {"type": "fixed", "value": true}, "targetable_load_balancer_profiles": [{"family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}], "targetable_resource_types": {"type": "enum", "values": ["instance"]}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListLoadBalancerProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListLoadBalancerProfiles(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListLoadBalancerProfilesOptions model
				listLoadBalancerProfilesOptionsModel := new(vpcv1.ListLoadBalancerProfilesOptions)
				listLoadBalancerProfilesOptionsModel.Start = core.StringPtr("testString")
				listLoadBalancerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listLoadBalancerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListLoadBalancerProfiles(listLoadBalancerProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListLoadBalancerProfiles with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerProfilesOptions model
				listLoadBalancerProfilesOptionsModel := new(vpcv1.ListLoadBalancerProfilesOptions)
				listLoadBalancerProfilesOptionsModel.Start = core.StringPtr("testString")
				listLoadBalancerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listLoadBalancerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListLoadBalancerProfiles(listLoadBalancerProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListLoadBalancerProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerProfilesOptions model
				listLoadBalancerProfilesOptionsModel := new(vpcv1.ListLoadBalancerProfilesOptions)
				listLoadBalancerProfilesOptionsModel.Start = core.StringPtr("testString")
				listLoadBalancerProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listLoadBalancerProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListLoadBalancerProfiles(listLoadBalancerProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.LoadBalancerProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.LoadBalancerProfileCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.LoadBalancerProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"access_modes":{"type":"enum","values":["private"]},"availability":{"type":"fixed","value":"region"},"failsafe_policy_actions":{"default":"fail","type":"enum","values":["forward"]},"family":"application","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"source_ip_session_persistence_supported":{"type":"fixed","value":true},"targetable_load_balancer_profiles":[{"family":"application","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"}],"targetable_resource_types":{"type":"enum","values":["instance"]},"udp_supported":{"type":"fixed","value":true}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"profiles":[{"access_modes":{"type":"enum","values":["private"]},"availability":{"type":"fixed","value":"region"},"failsafe_policy_actions":{"default":"fail","type":"enum","values":["forward"]},"family":"application","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"source_ip_session_persistence_supported":{"type":"fixed","value":true},"targetable_load_balancer_profiles":[{"family":"application","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"}],"targetable_resource_types":{"type":"enum","values":["instance"]},"udp_supported":{"type":"fixed","value":true}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use LoadBalancerProfilesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listLoadBalancerProfilesOptionsModel := &vpcv1.ListLoadBalancerProfilesOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewLoadBalancerProfilesPager(listLoadBalancerProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.LoadBalancerProfile
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use LoadBalancerProfilesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listLoadBalancerProfilesOptionsModel := &vpcv1.ListLoadBalancerProfilesOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewLoadBalancerProfilesPager(listLoadBalancerProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`GetLoadBalancerProfile(getLoadBalancerProfileOptions *GetLoadBalancerProfileOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getLoadBalancerProfilePath := "/load_balancer/profiles/network-fixed"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerProfilePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetLoadBalancerProfile with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerProfileOptions model
				getLoadBalancerProfileOptionsModel := new(vpcv1.GetLoadBalancerProfileOptions)
				getLoadBalancerProfileOptionsModel.Name = core.StringPtr("network-fixed")
				getLoadBalancerProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetLoadBalancerProfile(getLoadBalancerProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetLoadBalancerProfile(getLoadBalancerProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancerProfile(getLoadBalancerProfileOptions *GetLoadBalancerProfileOptions)`, func() {
		version := "2024-06-23"
		getLoadBalancerProfilePath := "/load_balancer/profiles/network-fixed"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerProfilePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_modes": {"type": "enum", "values": ["private"]}, "availability": {"type": "fixed", "value": "region"}, "failsafe_policy_actions": {"default": "fail", "type": "enum", "values": ["forward"]}, "family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "source_ip_session_persistence_supported": {"type": "fixed", "value": true}, "targetable_load_balancer_profiles": [{"family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}], "targetable_resource_types": {"type": "enum", "values": ["instance"]}, "udp_supported": {"type": "fixed", "value": true}}`)
				}))
			})
			It(`Invoke GetLoadBalancerProfile successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetLoadBalancerProfileOptions model
				getLoadBalancerProfileOptionsModel := new(vpcv1.GetLoadBalancerProfileOptions)
				getLoadBalancerProfileOptionsModel.Name = core.StringPtr("network-fixed")
				getLoadBalancerProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetLoadBalancerProfileWithContext(ctx, getLoadBalancerProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetLoadBalancerProfile(getLoadBalancerProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetLoadBalancerProfileWithContext(ctx, getLoadBalancerProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerProfilePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_modes": {"type": "enum", "values": ["private"]}, "availability": {"type": "fixed", "value": "region"}, "failsafe_policy_actions": {"default": "fail", "type": "enum", "values": ["forward"]}, "family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "source_ip_session_persistence_supported": {"type": "fixed", "value": true}, "targetable_load_balancer_profiles": [{"family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}], "targetable_resource_types": {"type": "enum", "values": ["instance"]}, "udp_supported": {"type": "fixed", "value": true}}`)
				}))
			})
			It(`Invoke GetLoadBalancerProfile successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetLoadBalancerProfile(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetLoadBalancerProfileOptions model
				getLoadBalancerProfileOptionsModel := new(vpcv1.GetLoadBalancerProfileOptions)
				getLoadBalancerProfileOptionsModel.Name = core.StringPtr("network-fixed")
				getLoadBalancerProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetLoadBalancerProfile(getLoadBalancerProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetLoadBalancerProfile with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerProfileOptions model
				getLoadBalancerProfileOptionsModel := new(vpcv1.GetLoadBalancerProfileOptions)
				getLoadBalancerProfileOptionsModel.Name = core.StringPtr("network-fixed")
				getLoadBalancerProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetLoadBalancerProfile(getLoadBalancerProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetLoadBalancerProfileOptions model with no property values
				getLoadBalancerProfileOptionsModelNew := new(vpcv1.GetLoadBalancerProfileOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetLoadBalancerProfile(getLoadBalancerProfileOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetLoadBalancerProfile successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerProfileOptions model
				getLoadBalancerProfileOptionsModel := new(vpcv1.GetLoadBalancerProfileOptions)
				getLoadBalancerProfileOptionsModel.Name = core.StringPtr("network-fixed")
				getLoadBalancerProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetLoadBalancerProfile(getLoadBalancerProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListLoadBalancers(listLoadBalancersOptions *ListLoadBalancersOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listLoadBalancersPath := "/load_balancers"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancersPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListLoadBalancers with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancersOptions model
				listLoadBalancersOptionsModel := new(vpcv1.ListLoadBalancersOptions)
				listLoadBalancersOptionsModel.Start = core.StringPtr("testString")
				listLoadBalancersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listLoadBalancersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListLoadBalancers(listLoadBalancersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListLoadBalancers(listLoadBalancersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListLoadBalancers(listLoadBalancersOptions *ListLoadBalancersOptions)`, func() {
		version := "2024-06-23"
		listLoadBalancersPath := "/load_balancers"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancersPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "load_balancers": [{"access_mode": "private", "attached_load_balancer_pool_members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "failsafe_policy_actions": ["forward"], "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}], "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListLoadBalancers successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListLoadBalancersOptions model
				listLoadBalancersOptionsModel := new(vpcv1.ListLoadBalancersOptions)
				listLoadBalancersOptionsModel.Start = core.StringPtr("testString")
				listLoadBalancersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listLoadBalancersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListLoadBalancersWithContext(ctx, listLoadBalancersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListLoadBalancers(listLoadBalancersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListLoadBalancersWithContext(ctx, listLoadBalancersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancersPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "load_balancers": [{"access_mode": "private", "attached_load_balancer_pool_members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "failsafe_policy_actions": ["forward"], "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}], "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListLoadBalancers successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListLoadBalancers(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListLoadBalancersOptions model
				listLoadBalancersOptionsModel := new(vpcv1.ListLoadBalancersOptions)
				listLoadBalancersOptionsModel.Start = core.StringPtr("testString")
				listLoadBalancersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listLoadBalancersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListLoadBalancers(listLoadBalancersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListLoadBalancers with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancersOptions model
				listLoadBalancersOptionsModel := new(vpcv1.ListLoadBalancersOptions)
				listLoadBalancersOptionsModel.Start = core.StringPtr("testString")
				listLoadBalancersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listLoadBalancersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListLoadBalancers(listLoadBalancersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListLoadBalancers successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancersOptions model
				listLoadBalancersOptionsModel := new(vpcv1.ListLoadBalancersOptions)
				listLoadBalancersOptionsModel.Start = core.StringPtr("testString")
				listLoadBalancersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listLoadBalancersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListLoadBalancers(listLoadBalancersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.LoadBalancerCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.LoadBalancerCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.LoadBalancerCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancersPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"load_balancers":[{"access_mode":"private","attached_load_balancer_pool_members":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a","id":"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}],"availability":"region","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"failsafe_policy_actions":["forward"],"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":true,"is_private_path":true,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091","id":"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004","id":"r006-70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"application","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"source_ip_session_persistence_supported":true,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"load_balancers":[{"access_mode":"private","attached_load_balancer_pool_members":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a","id":"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}],"availability":"region","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"failsafe_policy_actions":["forward"],"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":true,"is_private_path":true,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091","id":"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004","id":"r006-70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"application","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"source_ip_session_persistence_supported":true,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use LoadBalancersPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listLoadBalancersOptionsModel := &vpcv1.ListLoadBalancersOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewLoadBalancersPager(listLoadBalancersOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.LoadBalancer
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use LoadBalancersPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listLoadBalancersOptionsModel := &vpcv1.ListLoadBalancersOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewLoadBalancersPager(listLoadBalancersOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateLoadBalancer(createLoadBalancerOptions *CreateLoadBalancerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createLoadBalancerPath := "/load_balancers"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateLoadBalancer with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the DnsInstanceIdentityByCRN model
				dnsInstanceIdentityModel := new(vpcv1.DnsInstanceIdentityByCRN)
				dnsInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::")

				// Construct an instance of the DnsZoneIdentityByID model
				dnsZoneIdentityModel := new(vpcv1.DnsZoneIdentityByID)
				dnsZoneIdentityModel.ID = core.StringPtr("d66662cc-aa23-4fe1-9987-858487a61f45")

				// Construct an instance of the LoadBalancerDnsPrototype model
				loadBalancerDnsPrototypeModel := new(vpcv1.LoadBalancerDnsPrototype)
				loadBalancerDnsPrototypeModel.Instance = dnsInstanceIdentityModel
				loadBalancerDnsPrototypeModel.Zone = dnsZoneIdentityModel

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerPoolIdentityByName model
				loadBalancerPoolIdentityByNameModel := new(vpcv1.LoadBalancerPoolIdentityByName)
				loadBalancerPoolIdentityByNameModel.Name = core.StringPtr("my-load-balancer-pool")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model
				loadBalancerListenerHTTPSRedirectPrototypeModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPrototype)
				loadBalancerListenerHTTPSRedirectPrototypeModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPrototypeModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPrototypeModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPrototypeLoadBalancerContext model
				loadBalancerListenerPrototypeLoadBalancerContextModel := new(vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext)
				loadBalancerListenerPrototypeLoadBalancerContextModel.AcceptProxyProtocol = core.BoolPtr(true)
				loadBalancerListenerPrototypeLoadBalancerContextModel.CertificateInstance = certificateInstanceIdentityModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				loadBalancerListenerPrototypeLoadBalancerContextModel.DefaultPool = loadBalancerPoolIdentityByNameModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPrototypeModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				loadBalancerListenerPrototypeLoadBalancerContextModel.Port = core.Int64Ptr(int64(443))
				loadBalancerListenerPrototypeLoadBalancerContextModel.PortMax = core.Int64Ptr(int64(499))
				loadBalancerListenerPrototypeLoadBalancerContextModel.PortMin = core.Int64Ptr(int64(443))
				loadBalancerListenerPrototypeLoadBalancerContextModel.Protocol = core.StringPtr("http")

				// Construct an instance of the LoadBalancerLoggingDatapathPrototype model
				loadBalancerLoggingDatapathPrototypeModel := new(vpcv1.LoadBalancerLoggingDatapathPrototype)
				loadBalancerLoggingDatapathPrototypeModel.Active = core.BoolPtr(true)

				// Construct an instance of the LoadBalancerLoggingPrototype model
				loadBalancerLoggingPrototypeModel := new(vpcv1.LoadBalancerLoggingPrototype)
				loadBalancerLoggingPrototypeModel.Datapath = loadBalancerLoggingDatapathPrototypeModel

				// Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model
				loadBalancerPoolHealthMonitorPrototypeModel := new(vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype)
				loadBalancerPoolHealthMonitorPrototypeModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPrototypeModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPrototypeModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Type = core.StringPtr("tcp")

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model
				loadBalancerPoolSessionPersistencePrototypeModel := new(vpcv1.LoadBalancerPoolSessionPersistencePrototype)
				loadBalancerPoolSessionPersistencePrototypeModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePrototypeModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the LoadBalancerPoolPrototypeLoadBalancerContext model
				loadBalancerPoolPrototypeLoadBalancerContextModel := new(vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext)
				loadBalancerPoolPrototypeLoadBalancerContextModel.Algorithm = core.StringPtr("least_connections")
				loadBalancerPoolPrototypeLoadBalancerContextModel.HealthMonitor = loadBalancerPoolHealthMonitorPrototypeModel
				loadBalancerPoolPrototypeLoadBalancerContextModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				loadBalancerPoolPrototypeLoadBalancerContextModel.Name = core.StringPtr("my-load-balancer-pool")
				loadBalancerPoolPrototypeLoadBalancerContextModel.Protocol = core.StringPtr("http")
				loadBalancerPoolPrototypeLoadBalancerContextModel.ProxyProtocol = core.StringPtr("disabled")
				loadBalancerPoolPrototypeLoadBalancerContextModel.SessionPersistence = loadBalancerPoolSessionPersistencePrototypeModel

				// Construct an instance of the LoadBalancerProfileIdentityByName model
				loadBalancerProfileIdentityModel := new(vpcv1.LoadBalancerProfileIdentityByName)
				loadBalancerProfileIdentityModel.Name = core.StringPtr("network-fixed")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateLoadBalancerOptions model
				createLoadBalancerOptionsModel := new(vpcv1.CreateLoadBalancerOptions)
				createLoadBalancerOptionsModel.IsPublic = core.BoolPtr(true)
				createLoadBalancerOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createLoadBalancerOptionsModel.Dns = loadBalancerDnsPrototypeModel
				createLoadBalancerOptionsModel.IsPrivatePath = core.BoolPtr(true)
				createLoadBalancerOptionsModel.Listeners = []vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext{*loadBalancerListenerPrototypeLoadBalancerContextModel}
				createLoadBalancerOptionsModel.Logging = loadBalancerLoggingPrototypeModel
				createLoadBalancerOptionsModel.Name = core.StringPtr("my-load-balancer")
				createLoadBalancerOptionsModel.Pools = []vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext{*loadBalancerPoolPrototypeLoadBalancerContextModel}
				createLoadBalancerOptionsModel.Profile = loadBalancerProfileIdentityModel
				createLoadBalancerOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createLoadBalancerOptionsModel.RouteMode = core.BoolPtr(true)
				createLoadBalancerOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateLoadBalancer(createLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateLoadBalancer(createLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateLoadBalancer(createLoadBalancerOptions *CreateLoadBalancerOptions)`, func() {
		version := "2024-06-23"
		createLoadBalancerPath := "/load_balancers"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"access_mode": "private", "attached_load_balancer_pool_members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "failsafe_policy_actions": ["forward"], "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}`)
				}))
			})
			It(`Invoke CreateLoadBalancer successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the DnsInstanceIdentityByCRN model
				dnsInstanceIdentityModel := new(vpcv1.DnsInstanceIdentityByCRN)
				dnsInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::")

				// Construct an instance of the DnsZoneIdentityByID model
				dnsZoneIdentityModel := new(vpcv1.DnsZoneIdentityByID)
				dnsZoneIdentityModel.ID = core.StringPtr("d66662cc-aa23-4fe1-9987-858487a61f45")

				// Construct an instance of the LoadBalancerDnsPrototype model
				loadBalancerDnsPrototypeModel := new(vpcv1.LoadBalancerDnsPrototype)
				loadBalancerDnsPrototypeModel.Instance = dnsInstanceIdentityModel
				loadBalancerDnsPrototypeModel.Zone = dnsZoneIdentityModel

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerPoolIdentityByName model
				loadBalancerPoolIdentityByNameModel := new(vpcv1.LoadBalancerPoolIdentityByName)
				loadBalancerPoolIdentityByNameModel.Name = core.StringPtr("my-load-balancer-pool")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model
				loadBalancerListenerHTTPSRedirectPrototypeModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPrototype)
				loadBalancerListenerHTTPSRedirectPrototypeModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPrototypeModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPrototypeModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPrototypeLoadBalancerContext model
				loadBalancerListenerPrototypeLoadBalancerContextModel := new(vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext)
				loadBalancerListenerPrototypeLoadBalancerContextModel.AcceptProxyProtocol = core.BoolPtr(true)
				loadBalancerListenerPrototypeLoadBalancerContextModel.CertificateInstance = certificateInstanceIdentityModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				loadBalancerListenerPrototypeLoadBalancerContextModel.DefaultPool = loadBalancerPoolIdentityByNameModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPrototypeModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				loadBalancerListenerPrototypeLoadBalancerContextModel.Port = core.Int64Ptr(int64(443))
				loadBalancerListenerPrototypeLoadBalancerContextModel.PortMax = core.Int64Ptr(int64(499))
				loadBalancerListenerPrototypeLoadBalancerContextModel.PortMin = core.Int64Ptr(int64(443))
				loadBalancerListenerPrototypeLoadBalancerContextModel.Protocol = core.StringPtr("http")

				// Construct an instance of the LoadBalancerLoggingDatapathPrototype model
				loadBalancerLoggingDatapathPrototypeModel := new(vpcv1.LoadBalancerLoggingDatapathPrototype)
				loadBalancerLoggingDatapathPrototypeModel.Active = core.BoolPtr(true)

				// Construct an instance of the LoadBalancerLoggingPrototype model
				loadBalancerLoggingPrototypeModel := new(vpcv1.LoadBalancerLoggingPrototype)
				loadBalancerLoggingPrototypeModel.Datapath = loadBalancerLoggingDatapathPrototypeModel

				// Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model
				loadBalancerPoolHealthMonitorPrototypeModel := new(vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype)
				loadBalancerPoolHealthMonitorPrototypeModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPrototypeModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPrototypeModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Type = core.StringPtr("tcp")

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model
				loadBalancerPoolSessionPersistencePrototypeModel := new(vpcv1.LoadBalancerPoolSessionPersistencePrototype)
				loadBalancerPoolSessionPersistencePrototypeModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePrototypeModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the LoadBalancerPoolPrototypeLoadBalancerContext model
				loadBalancerPoolPrototypeLoadBalancerContextModel := new(vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext)
				loadBalancerPoolPrototypeLoadBalancerContextModel.Algorithm = core.StringPtr("least_connections")
				loadBalancerPoolPrototypeLoadBalancerContextModel.HealthMonitor = loadBalancerPoolHealthMonitorPrototypeModel
				loadBalancerPoolPrototypeLoadBalancerContextModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				loadBalancerPoolPrototypeLoadBalancerContextModel.Name = core.StringPtr("my-load-balancer-pool")
				loadBalancerPoolPrototypeLoadBalancerContextModel.Protocol = core.StringPtr("http")
				loadBalancerPoolPrototypeLoadBalancerContextModel.ProxyProtocol = core.StringPtr("disabled")
				loadBalancerPoolPrototypeLoadBalancerContextModel.SessionPersistence = loadBalancerPoolSessionPersistencePrototypeModel

				// Construct an instance of the LoadBalancerProfileIdentityByName model
				loadBalancerProfileIdentityModel := new(vpcv1.LoadBalancerProfileIdentityByName)
				loadBalancerProfileIdentityModel.Name = core.StringPtr("network-fixed")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateLoadBalancerOptions model
				createLoadBalancerOptionsModel := new(vpcv1.CreateLoadBalancerOptions)
				createLoadBalancerOptionsModel.IsPublic = core.BoolPtr(true)
				createLoadBalancerOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createLoadBalancerOptionsModel.Dns = loadBalancerDnsPrototypeModel
				createLoadBalancerOptionsModel.IsPrivatePath = core.BoolPtr(true)
				createLoadBalancerOptionsModel.Listeners = []vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext{*loadBalancerListenerPrototypeLoadBalancerContextModel}
				createLoadBalancerOptionsModel.Logging = loadBalancerLoggingPrototypeModel
				createLoadBalancerOptionsModel.Name = core.StringPtr("my-load-balancer")
				createLoadBalancerOptionsModel.Pools = []vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext{*loadBalancerPoolPrototypeLoadBalancerContextModel}
				createLoadBalancerOptionsModel.Profile = loadBalancerProfileIdentityModel
				createLoadBalancerOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createLoadBalancerOptionsModel.RouteMode = core.BoolPtr(true)
				createLoadBalancerOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateLoadBalancerWithContext(ctx, createLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateLoadBalancer(createLoadBalancerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateLoadBalancerWithContext(ctx, createLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"access_mode": "private", "attached_load_balancer_pool_members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "failsafe_policy_actions": ["forward"], "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}`)
				}))
			})
			It(`Invoke CreateLoadBalancer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateLoadBalancer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the DnsInstanceIdentityByCRN model
				dnsInstanceIdentityModel := new(vpcv1.DnsInstanceIdentityByCRN)
				dnsInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::")

				// Construct an instance of the DnsZoneIdentityByID model
				dnsZoneIdentityModel := new(vpcv1.DnsZoneIdentityByID)
				dnsZoneIdentityModel.ID = core.StringPtr("d66662cc-aa23-4fe1-9987-858487a61f45")

				// Construct an instance of the LoadBalancerDnsPrototype model
				loadBalancerDnsPrototypeModel := new(vpcv1.LoadBalancerDnsPrototype)
				loadBalancerDnsPrototypeModel.Instance = dnsInstanceIdentityModel
				loadBalancerDnsPrototypeModel.Zone = dnsZoneIdentityModel

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerPoolIdentityByName model
				loadBalancerPoolIdentityByNameModel := new(vpcv1.LoadBalancerPoolIdentityByName)
				loadBalancerPoolIdentityByNameModel.Name = core.StringPtr("my-load-balancer-pool")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model
				loadBalancerListenerHTTPSRedirectPrototypeModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPrototype)
				loadBalancerListenerHTTPSRedirectPrototypeModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPrototypeModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPrototypeModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPrototypeLoadBalancerContext model
				loadBalancerListenerPrototypeLoadBalancerContextModel := new(vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext)
				loadBalancerListenerPrototypeLoadBalancerContextModel.AcceptProxyProtocol = core.BoolPtr(true)
				loadBalancerListenerPrototypeLoadBalancerContextModel.CertificateInstance = certificateInstanceIdentityModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				loadBalancerListenerPrototypeLoadBalancerContextModel.DefaultPool = loadBalancerPoolIdentityByNameModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPrototypeModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				loadBalancerListenerPrototypeLoadBalancerContextModel.Port = core.Int64Ptr(int64(443))
				loadBalancerListenerPrototypeLoadBalancerContextModel.PortMax = core.Int64Ptr(int64(499))
				loadBalancerListenerPrototypeLoadBalancerContextModel.PortMin = core.Int64Ptr(int64(443))
				loadBalancerListenerPrototypeLoadBalancerContextModel.Protocol = core.StringPtr("http")

				// Construct an instance of the LoadBalancerLoggingDatapathPrototype model
				loadBalancerLoggingDatapathPrototypeModel := new(vpcv1.LoadBalancerLoggingDatapathPrototype)
				loadBalancerLoggingDatapathPrototypeModel.Active = core.BoolPtr(true)

				// Construct an instance of the LoadBalancerLoggingPrototype model
				loadBalancerLoggingPrototypeModel := new(vpcv1.LoadBalancerLoggingPrototype)
				loadBalancerLoggingPrototypeModel.Datapath = loadBalancerLoggingDatapathPrototypeModel

				// Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model
				loadBalancerPoolHealthMonitorPrototypeModel := new(vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype)
				loadBalancerPoolHealthMonitorPrototypeModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPrototypeModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPrototypeModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Type = core.StringPtr("tcp")

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model
				loadBalancerPoolSessionPersistencePrototypeModel := new(vpcv1.LoadBalancerPoolSessionPersistencePrototype)
				loadBalancerPoolSessionPersistencePrototypeModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePrototypeModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the LoadBalancerPoolPrototypeLoadBalancerContext model
				loadBalancerPoolPrototypeLoadBalancerContextModel := new(vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext)
				loadBalancerPoolPrototypeLoadBalancerContextModel.Algorithm = core.StringPtr("least_connections")
				loadBalancerPoolPrototypeLoadBalancerContextModel.HealthMonitor = loadBalancerPoolHealthMonitorPrototypeModel
				loadBalancerPoolPrototypeLoadBalancerContextModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				loadBalancerPoolPrototypeLoadBalancerContextModel.Name = core.StringPtr("my-load-balancer-pool")
				loadBalancerPoolPrototypeLoadBalancerContextModel.Protocol = core.StringPtr("http")
				loadBalancerPoolPrototypeLoadBalancerContextModel.ProxyProtocol = core.StringPtr("disabled")
				loadBalancerPoolPrototypeLoadBalancerContextModel.SessionPersistence = loadBalancerPoolSessionPersistencePrototypeModel

				// Construct an instance of the LoadBalancerProfileIdentityByName model
				loadBalancerProfileIdentityModel := new(vpcv1.LoadBalancerProfileIdentityByName)
				loadBalancerProfileIdentityModel.Name = core.StringPtr("network-fixed")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateLoadBalancerOptions model
				createLoadBalancerOptionsModel := new(vpcv1.CreateLoadBalancerOptions)
				createLoadBalancerOptionsModel.IsPublic = core.BoolPtr(true)
				createLoadBalancerOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createLoadBalancerOptionsModel.Dns = loadBalancerDnsPrototypeModel
				createLoadBalancerOptionsModel.IsPrivatePath = core.BoolPtr(true)
				createLoadBalancerOptionsModel.Listeners = []vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext{*loadBalancerListenerPrototypeLoadBalancerContextModel}
				createLoadBalancerOptionsModel.Logging = loadBalancerLoggingPrototypeModel
				createLoadBalancerOptionsModel.Name = core.StringPtr("my-load-balancer")
				createLoadBalancerOptionsModel.Pools = []vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext{*loadBalancerPoolPrototypeLoadBalancerContextModel}
				createLoadBalancerOptionsModel.Profile = loadBalancerProfileIdentityModel
				createLoadBalancerOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createLoadBalancerOptionsModel.RouteMode = core.BoolPtr(true)
				createLoadBalancerOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateLoadBalancer(createLoadBalancerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateLoadBalancer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the DnsInstanceIdentityByCRN model
				dnsInstanceIdentityModel := new(vpcv1.DnsInstanceIdentityByCRN)
				dnsInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::")

				// Construct an instance of the DnsZoneIdentityByID model
				dnsZoneIdentityModel := new(vpcv1.DnsZoneIdentityByID)
				dnsZoneIdentityModel.ID = core.StringPtr("d66662cc-aa23-4fe1-9987-858487a61f45")

				// Construct an instance of the LoadBalancerDnsPrototype model
				loadBalancerDnsPrototypeModel := new(vpcv1.LoadBalancerDnsPrototype)
				loadBalancerDnsPrototypeModel.Instance = dnsInstanceIdentityModel
				loadBalancerDnsPrototypeModel.Zone = dnsZoneIdentityModel

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerPoolIdentityByName model
				loadBalancerPoolIdentityByNameModel := new(vpcv1.LoadBalancerPoolIdentityByName)
				loadBalancerPoolIdentityByNameModel.Name = core.StringPtr("my-load-balancer-pool")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model
				loadBalancerListenerHTTPSRedirectPrototypeModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPrototype)
				loadBalancerListenerHTTPSRedirectPrototypeModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPrototypeModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPrototypeModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPrototypeLoadBalancerContext model
				loadBalancerListenerPrototypeLoadBalancerContextModel := new(vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext)
				loadBalancerListenerPrototypeLoadBalancerContextModel.AcceptProxyProtocol = core.BoolPtr(true)
				loadBalancerListenerPrototypeLoadBalancerContextModel.CertificateInstance = certificateInstanceIdentityModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				loadBalancerListenerPrototypeLoadBalancerContextModel.DefaultPool = loadBalancerPoolIdentityByNameModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPrototypeModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				loadBalancerListenerPrototypeLoadBalancerContextModel.Port = core.Int64Ptr(int64(443))
				loadBalancerListenerPrototypeLoadBalancerContextModel.PortMax = core.Int64Ptr(int64(499))
				loadBalancerListenerPrototypeLoadBalancerContextModel.PortMin = core.Int64Ptr(int64(443))
				loadBalancerListenerPrototypeLoadBalancerContextModel.Protocol = core.StringPtr("http")

				// Construct an instance of the LoadBalancerLoggingDatapathPrototype model
				loadBalancerLoggingDatapathPrototypeModel := new(vpcv1.LoadBalancerLoggingDatapathPrototype)
				loadBalancerLoggingDatapathPrototypeModel.Active = core.BoolPtr(true)

				// Construct an instance of the LoadBalancerLoggingPrototype model
				loadBalancerLoggingPrototypeModel := new(vpcv1.LoadBalancerLoggingPrototype)
				loadBalancerLoggingPrototypeModel.Datapath = loadBalancerLoggingDatapathPrototypeModel

				// Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model
				loadBalancerPoolHealthMonitorPrototypeModel := new(vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype)
				loadBalancerPoolHealthMonitorPrototypeModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPrototypeModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPrototypeModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Type = core.StringPtr("tcp")

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model
				loadBalancerPoolSessionPersistencePrototypeModel := new(vpcv1.LoadBalancerPoolSessionPersistencePrototype)
				loadBalancerPoolSessionPersistencePrototypeModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePrototypeModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the LoadBalancerPoolPrototypeLoadBalancerContext model
				loadBalancerPoolPrototypeLoadBalancerContextModel := new(vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext)
				loadBalancerPoolPrototypeLoadBalancerContextModel.Algorithm = core.StringPtr("least_connections")
				loadBalancerPoolPrototypeLoadBalancerContextModel.HealthMonitor = loadBalancerPoolHealthMonitorPrototypeModel
				loadBalancerPoolPrototypeLoadBalancerContextModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				loadBalancerPoolPrototypeLoadBalancerContextModel.Name = core.StringPtr("my-load-balancer-pool")
				loadBalancerPoolPrototypeLoadBalancerContextModel.Protocol = core.StringPtr("http")
				loadBalancerPoolPrototypeLoadBalancerContextModel.ProxyProtocol = core.StringPtr("disabled")
				loadBalancerPoolPrototypeLoadBalancerContextModel.SessionPersistence = loadBalancerPoolSessionPersistencePrototypeModel

				// Construct an instance of the LoadBalancerProfileIdentityByName model
				loadBalancerProfileIdentityModel := new(vpcv1.LoadBalancerProfileIdentityByName)
				loadBalancerProfileIdentityModel.Name = core.StringPtr("network-fixed")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateLoadBalancerOptions model
				createLoadBalancerOptionsModel := new(vpcv1.CreateLoadBalancerOptions)
				createLoadBalancerOptionsModel.IsPublic = core.BoolPtr(true)
				createLoadBalancerOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createLoadBalancerOptionsModel.Dns = loadBalancerDnsPrototypeModel
				createLoadBalancerOptionsModel.IsPrivatePath = core.BoolPtr(true)
				createLoadBalancerOptionsModel.Listeners = []vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext{*loadBalancerListenerPrototypeLoadBalancerContextModel}
				createLoadBalancerOptionsModel.Logging = loadBalancerLoggingPrototypeModel
				createLoadBalancerOptionsModel.Name = core.StringPtr("my-load-balancer")
				createLoadBalancerOptionsModel.Pools = []vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext{*loadBalancerPoolPrototypeLoadBalancerContextModel}
				createLoadBalancerOptionsModel.Profile = loadBalancerProfileIdentityModel
				createLoadBalancerOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createLoadBalancerOptionsModel.RouteMode = core.BoolPtr(true)
				createLoadBalancerOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateLoadBalancer(createLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateLoadBalancerOptions model with no property values
				createLoadBalancerOptionsModelNew := new(vpcv1.CreateLoadBalancerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateLoadBalancer(createLoadBalancerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateLoadBalancer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the DnsInstanceIdentityByCRN model
				dnsInstanceIdentityModel := new(vpcv1.DnsInstanceIdentityByCRN)
				dnsInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::")

				// Construct an instance of the DnsZoneIdentityByID model
				dnsZoneIdentityModel := new(vpcv1.DnsZoneIdentityByID)
				dnsZoneIdentityModel.ID = core.StringPtr("d66662cc-aa23-4fe1-9987-858487a61f45")

				// Construct an instance of the LoadBalancerDnsPrototype model
				loadBalancerDnsPrototypeModel := new(vpcv1.LoadBalancerDnsPrototype)
				loadBalancerDnsPrototypeModel.Instance = dnsInstanceIdentityModel
				loadBalancerDnsPrototypeModel.Zone = dnsZoneIdentityModel

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerPoolIdentityByName model
				loadBalancerPoolIdentityByNameModel := new(vpcv1.LoadBalancerPoolIdentityByName)
				loadBalancerPoolIdentityByNameModel.Name = core.StringPtr("my-load-balancer-pool")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model
				loadBalancerListenerHTTPSRedirectPrototypeModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPrototype)
				loadBalancerListenerHTTPSRedirectPrototypeModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPrototypeModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPrototypeModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPrototypeLoadBalancerContext model
				loadBalancerListenerPrototypeLoadBalancerContextModel := new(vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext)
				loadBalancerListenerPrototypeLoadBalancerContextModel.AcceptProxyProtocol = core.BoolPtr(true)
				loadBalancerListenerPrototypeLoadBalancerContextModel.CertificateInstance = certificateInstanceIdentityModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				loadBalancerListenerPrototypeLoadBalancerContextModel.DefaultPool = loadBalancerPoolIdentityByNameModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPrototypeModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				loadBalancerListenerPrototypeLoadBalancerContextModel.Port = core.Int64Ptr(int64(443))
				loadBalancerListenerPrototypeLoadBalancerContextModel.PortMax = core.Int64Ptr(int64(499))
				loadBalancerListenerPrototypeLoadBalancerContextModel.PortMin = core.Int64Ptr(int64(443))
				loadBalancerListenerPrototypeLoadBalancerContextModel.Protocol = core.StringPtr("http")

				// Construct an instance of the LoadBalancerLoggingDatapathPrototype model
				loadBalancerLoggingDatapathPrototypeModel := new(vpcv1.LoadBalancerLoggingDatapathPrototype)
				loadBalancerLoggingDatapathPrototypeModel.Active = core.BoolPtr(true)

				// Construct an instance of the LoadBalancerLoggingPrototype model
				loadBalancerLoggingPrototypeModel := new(vpcv1.LoadBalancerLoggingPrototype)
				loadBalancerLoggingPrototypeModel.Datapath = loadBalancerLoggingDatapathPrototypeModel

				// Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model
				loadBalancerPoolHealthMonitorPrototypeModel := new(vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype)
				loadBalancerPoolHealthMonitorPrototypeModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPrototypeModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPrototypeModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Type = core.StringPtr("tcp")

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model
				loadBalancerPoolSessionPersistencePrototypeModel := new(vpcv1.LoadBalancerPoolSessionPersistencePrototype)
				loadBalancerPoolSessionPersistencePrototypeModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePrototypeModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the LoadBalancerPoolPrototypeLoadBalancerContext model
				loadBalancerPoolPrototypeLoadBalancerContextModel := new(vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext)
				loadBalancerPoolPrototypeLoadBalancerContextModel.Algorithm = core.StringPtr("least_connections")
				loadBalancerPoolPrototypeLoadBalancerContextModel.HealthMonitor = loadBalancerPoolHealthMonitorPrototypeModel
				loadBalancerPoolPrototypeLoadBalancerContextModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				loadBalancerPoolPrototypeLoadBalancerContextModel.Name = core.StringPtr("my-load-balancer-pool")
				loadBalancerPoolPrototypeLoadBalancerContextModel.Protocol = core.StringPtr("http")
				loadBalancerPoolPrototypeLoadBalancerContextModel.ProxyProtocol = core.StringPtr("disabled")
				loadBalancerPoolPrototypeLoadBalancerContextModel.SessionPersistence = loadBalancerPoolSessionPersistencePrototypeModel

				// Construct an instance of the LoadBalancerProfileIdentityByName model
				loadBalancerProfileIdentityModel := new(vpcv1.LoadBalancerProfileIdentityByName)
				loadBalancerProfileIdentityModel.Name = core.StringPtr("network-fixed")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateLoadBalancerOptions model
				createLoadBalancerOptionsModel := new(vpcv1.CreateLoadBalancerOptions)
				createLoadBalancerOptionsModel.IsPublic = core.BoolPtr(true)
				createLoadBalancerOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createLoadBalancerOptionsModel.Dns = loadBalancerDnsPrototypeModel
				createLoadBalancerOptionsModel.IsPrivatePath = core.BoolPtr(true)
				createLoadBalancerOptionsModel.Listeners = []vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext{*loadBalancerListenerPrototypeLoadBalancerContextModel}
				createLoadBalancerOptionsModel.Logging = loadBalancerLoggingPrototypeModel
				createLoadBalancerOptionsModel.Name = core.StringPtr("my-load-balancer")
				createLoadBalancerOptionsModel.Pools = []vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext{*loadBalancerPoolPrototypeLoadBalancerContextModel}
				createLoadBalancerOptionsModel.Profile = loadBalancerProfileIdentityModel
				createLoadBalancerOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createLoadBalancerOptionsModel.RouteMode = core.BoolPtr(true)
				createLoadBalancerOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateLoadBalancer(createLoadBalancerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteLoadBalancer(deleteLoadBalancerOptions *DeleteLoadBalancerOptions)`, func() {
		version := "2024-06-23"
		deleteLoadBalancerPath := "/load_balancers/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteLoadBalancerPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteLoadBalancer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteLoadBalancer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteLoadBalancerOptions model
				deleteLoadBalancerOptionsModel := new(vpcv1.DeleteLoadBalancerOptions)
				deleteLoadBalancerOptionsModel.ID = core.StringPtr("testString")
				deleteLoadBalancerOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteLoadBalancer(deleteLoadBalancerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteLoadBalancer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteLoadBalancerOptions model
				deleteLoadBalancerOptionsModel := new(vpcv1.DeleteLoadBalancerOptions)
				deleteLoadBalancerOptionsModel.ID = core.StringPtr("testString")
				deleteLoadBalancerOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteLoadBalancer(deleteLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteLoadBalancerOptions model with no property values
				deleteLoadBalancerOptionsModelNew := new(vpcv1.DeleteLoadBalancerOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteLoadBalancer(deleteLoadBalancerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancer(getLoadBalancerOptions *GetLoadBalancerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getLoadBalancerPath := "/load_balancers/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetLoadBalancer with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerOptions model
				getLoadBalancerOptionsModel := new(vpcv1.GetLoadBalancerOptions)
				getLoadBalancerOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetLoadBalancer(getLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetLoadBalancer(getLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancer(getLoadBalancerOptions *GetLoadBalancerOptions)`, func() {
		version := "2024-06-23"
		getLoadBalancerPath := "/load_balancers/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_mode": "private", "attached_load_balancer_pool_members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "failsafe_policy_actions": ["forward"], "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}`)
				}))
			})
			It(`Invoke GetLoadBalancer successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetLoadBalancerOptions model
				getLoadBalancerOptionsModel := new(vpcv1.GetLoadBalancerOptions)
				getLoadBalancerOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetLoadBalancerWithContext(ctx, getLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetLoadBalancer(getLoadBalancerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetLoadBalancerWithContext(ctx, getLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_mode": "private", "attached_load_balancer_pool_members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "failsafe_policy_actions": ["forward"], "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}`)
				}))
			})
			It(`Invoke GetLoadBalancer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetLoadBalancer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetLoadBalancerOptions model
				getLoadBalancerOptionsModel := new(vpcv1.GetLoadBalancerOptions)
				getLoadBalancerOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetLoadBalancer(getLoadBalancerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetLoadBalancer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerOptions model
				getLoadBalancerOptionsModel := new(vpcv1.GetLoadBalancerOptions)
				getLoadBalancerOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetLoadBalancer(getLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetLoadBalancerOptions model with no property values
				getLoadBalancerOptionsModelNew := new(vpcv1.GetLoadBalancerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetLoadBalancer(getLoadBalancerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetLoadBalancer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerOptions model
				getLoadBalancerOptionsModel := new(vpcv1.GetLoadBalancerOptions)
				getLoadBalancerOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetLoadBalancer(getLoadBalancerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateLoadBalancer(updateLoadBalancerOptions *UpdateLoadBalancerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateLoadBalancerPath := "/load_balancers/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateLoadBalancer with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DnsInstanceIdentityByCRN model
				dnsInstanceIdentityModel := new(vpcv1.DnsInstanceIdentityByCRN)
				dnsInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::")

				// Construct an instance of the DnsZoneIdentityByID model
				dnsZoneIdentityModel := new(vpcv1.DnsZoneIdentityByID)
				dnsZoneIdentityModel.ID = core.StringPtr("d66662cc-aa23-4fe1-9987-858487a61f45")

				// Construct an instance of the LoadBalancerDnsPatch model
				loadBalancerDnsPatchModel := new(vpcv1.LoadBalancerDnsPatch)
				loadBalancerDnsPatchModel.Instance = dnsInstanceIdentityModel
				loadBalancerDnsPatchModel.Zone = dnsZoneIdentityModel

				// Construct an instance of the LoadBalancerLoggingDatapathPatch model
				loadBalancerLoggingDatapathPatchModel := new(vpcv1.LoadBalancerLoggingDatapathPatch)
				loadBalancerLoggingDatapathPatchModel.Active = core.BoolPtr(true)

				// Construct an instance of the LoadBalancerLoggingPatch model
				loadBalancerLoggingPatchModel := new(vpcv1.LoadBalancerLoggingPatch)
				loadBalancerLoggingPatchModel.Datapath = loadBalancerLoggingDatapathPatchModel

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the LoadBalancerPatch model
				loadBalancerPatchModel := new(vpcv1.LoadBalancerPatch)
				loadBalancerPatchModel.Dns = loadBalancerDnsPatchModel
				loadBalancerPatchModel.Logging = loadBalancerLoggingPatchModel
				loadBalancerPatchModel.Name = core.StringPtr("my-load-balancer")
				loadBalancerPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				loadBalancerPatchModelAsPatch, asPatchErr := loadBalancerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerOptions model
				updateLoadBalancerOptionsModel := new(vpcv1.UpdateLoadBalancerOptions)
				updateLoadBalancerOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerOptionsModel.LoadBalancerPatch = loadBalancerPatchModelAsPatch
				updateLoadBalancerOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateLoadBalancer(updateLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateLoadBalancer(updateLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateLoadBalancer(updateLoadBalancerOptions *UpdateLoadBalancerOptions)`, func() {
		version := "2024-06-23"
		updateLoadBalancerPath := "/load_balancers/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_mode": "private", "attached_load_balancer_pool_members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "failsafe_policy_actions": ["forward"], "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}`)
				}))
			})
			It(`Invoke UpdateLoadBalancer successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DnsInstanceIdentityByCRN model
				dnsInstanceIdentityModel := new(vpcv1.DnsInstanceIdentityByCRN)
				dnsInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::")

				// Construct an instance of the DnsZoneIdentityByID model
				dnsZoneIdentityModel := new(vpcv1.DnsZoneIdentityByID)
				dnsZoneIdentityModel.ID = core.StringPtr("d66662cc-aa23-4fe1-9987-858487a61f45")

				// Construct an instance of the LoadBalancerDnsPatch model
				loadBalancerDnsPatchModel := new(vpcv1.LoadBalancerDnsPatch)
				loadBalancerDnsPatchModel.Instance = dnsInstanceIdentityModel
				loadBalancerDnsPatchModel.Zone = dnsZoneIdentityModel

				// Construct an instance of the LoadBalancerLoggingDatapathPatch model
				loadBalancerLoggingDatapathPatchModel := new(vpcv1.LoadBalancerLoggingDatapathPatch)
				loadBalancerLoggingDatapathPatchModel.Active = core.BoolPtr(true)

				// Construct an instance of the LoadBalancerLoggingPatch model
				loadBalancerLoggingPatchModel := new(vpcv1.LoadBalancerLoggingPatch)
				loadBalancerLoggingPatchModel.Datapath = loadBalancerLoggingDatapathPatchModel

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the LoadBalancerPatch model
				loadBalancerPatchModel := new(vpcv1.LoadBalancerPatch)
				loadBalancerPatchModel.Dns = loadBalancerDnsPatchModel
				loadBalancerPatchModel.Logging = loadBalancerLoggingPatchModel
				loadBalancerPatchModel.Name = core.StringPtr("my-load-balancer")
				loadBalancerPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				loadBalancerPatchModelAsPatch, asPatchErr := loadBalancerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerOptions model
				updateLoadBalancerOptionsModel := new(vpcv1.UpdateLoadBalancerOptions)
				updateLoadBalancerOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerOptionsModel.LoadBalancerPatch = loadBalancerPatchModelAsPatch
				updateLoadBalancerOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateLoadBalancerWithContext(ctx, updateLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateLoadBalancer(updateLoadBalancerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateLoadBalancerWithContext(ctx, updateLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_mode": "private", "attached_load_balancer_pool_members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "failsafe_policy_actions": ["forward"], "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "application", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}`)
				}))
			})
			It(`Invoke UpdateLoadBalancer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateLoadBalancer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DnsInstanceIdentityByCRN model
				dnsInstanceIdentityModel := new(vpcv1.DnsInstanceIdentityByCRN)
				dnsInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::")

				// Construct an instance of the DnsZoneIdentityByID model
				dnsZoneIdentityModel := new(vpcv1.DnsZoneIdentityByID)
				dnsZoneIdentityModel.ID = core.StringPtr("d66662cc-aa23-4fe1-9987-858487a61f45")

				// Construct an instance of the LoadBalancerDnsPatch model
				loadBalancerDnsPatchModel := new(vpcv1.LoadBalancerDnsPatch)
				loadBalancerDnsPatchModel.Instance = dnsInstanceIdentityModel
				loadBalancerDnsPatchModel.Zone = dnsZoneIdentityModel

				// Construct an instance of the LoadBalancerLoggingDatapathPatch model
				loadBalancerLoggingDatapathPatchModel := new(vpcv1.LoadBalancerLoggingDatapathPatch)
				loadBalancerLoggingDatapathPatchModel.Active = core.BoolPtr(true)

				// Construct an instance of the LoadBalancerLoggingPatch model
				loadBalancerLoggingPatchModel := new(vpcv1.LoadBalancerLoggingPatch)
				loadBalancerLoggingPatchModel.Datapath = loadBalancerLoggingDatapathPatchModel

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the LoadBalancerPatch model
				loadBalancerPatchModel := new(vpcv1.LoadBalancerPatch)
				loadBalancerPatchModel.Dns = loadBalancerDnsPatchModel
				loadBalancerPatchModel.Logging = loadBalancerLoggingPatchModel
				loadBalancerPatchModel.Name = core.StringPtr("my-load-balancer")
				loadBalancerPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				loadBalancerPatchModelAsPatch, asPatchErr := loadBalancerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerOptions model
				updateLoadBalancerOptionsModel := new(vpcv1.UpdateLoadBalancerOptions)
				updateLoadBalancerOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerOptionsModel.LoadBalancerPatch = loadBalancerPatchModelAsPatch
				updateLoadBalancerOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateLoadBalancer(updateLoadBalancerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateLoadBalancer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DnsInstanceIdentityByCRN model
				dnsInstanceIdentityModel := new(vpcv1.DnsInstanceIdentityByCRN)
				dnsInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::")

				// Construct an instance of the DnsZoneIdentityByID model
				dnsZoneIdentityModel := new(vpcv1.DnsZoneIdentityByID)
				dnsZoneIdentityModel.ID = core.StringPtr("d66662cc-aa23-4fe1-9987-858487a61f45")

				// Construct an instance of the LoadBalancerDnsPatch model
				loadBalancerDnsPatchModel := new(vpcv1.LoadBalancerDnsPatch)
				loadBalancerDnsPatchModel.Instance = dnsInstanceIdentityModel
				loadBalancerDnsPatchModel.Zone = dnsZoneIdentityModel

				// Construct an instance of the LoadBalancerLoggingDatapathPatch model
				loadBalancerLoggingDatapathPatchModel := new(vpcv1.LoadBalancerLoggingDatapathPatch)
				loadBalancerLoggingDatapathPatchModel.Active = core.BoolPtr(true)

				// Construct an instance of the LoadBalancerLoggingPatch model
				loadBalancerLoggingPatchModel := new(vpcv1.LoadBalancerLoggingPatch)
				loadBalancerLoggingPatchModel.Datapath = loadBalancerLoggingDatapathPatchModel

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the LoadBalancerPatch model
				loadBalancerPatchModel := new(vpcv1.LoadBalancerPatch)
				loadBalancerPatchModel.Dns = loadBalancerDnsPatchModel
				loadBalancerPatchModel.Logging = loadBalancerLoggingPatchModel
				loadBalancerPatchModel.Name = core.StringPtr("my-load-balancer")
				loadBalancerPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				loadBalancerPatchModelAsPatch, asPatchErr := loadBalancerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerOptions model
				updateLoadBalancerOptionsModel := new(vpcv1.UpdateLoadBalancerOptions)
				updateLoadBalancerOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerOptionsModel.LoadBalancerPatch = loadBalancerPatchModelAsPatch
				updateLoadBalancerOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateLoadBalancer(updateLoadBalancerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateLoadBalancerOptions model with no property values
				updateLoadBalancerOptionsModelNew := new(vpcv1.UpdateLoadBalancerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateLoadBalancer(updateLoadBalancerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateLoadBalancer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DnsInstanceIdentityByCRN model
				dnsInstanceIdentityModel := new(vpcv1.DnsInstanceIdentityByCRN)
				dnsInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::")

				// Construct an instance of the DnsZoneIdentityByID model
				dnsZoneIdentityModel := new(vpcv1.DnsZoneIdentityByID)
				dnsZoneIdentityModel.ID = core.StringPtr("d66662cc-aa23-4fe1-9987-858487a61f45")

				// Construct an instance of the LoadBalancerDnsPatch model
				loadBalancerDnsPatchModel := new(vpcv1.LoadBalancerDnsPatch)
				loadBalancerDnsPatchModel.Instance = dnsInstanceIdentityModel
				loadBalancerDnsPatchModel.Zone = dnsZoneIdentityModel

				// Construct an instance of the LoadBalancerLoggingDatapathPatch model
				loadBalancerLoggingDatapathPatchModel := new(vpcv1.LoadBalancerLoggingDatapathPatch)
				loadBalancerLoggingDatapathPatchModel.Active = core.BoolPtr(true)

				// Construct an instance of the LoadBalancerLoggingPatch model
				loadBalancerLoggingPatchModel := new(vpcv1.LoadBalancerLoggingPatch)
				loadBalancerLoggingPatchModel.Datapath = loadBalancerLoggingDatapathPatchModel

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the LoadBalancerPatch model
				loadBalancerPatchModel := new(vpcv1.LoadBalancerPatch)
				loadBalancerPatchModel.Dns = loadBalancerDnsPatchModel
				loadBalancerPatchModel.Logging = loadBalancerLoggingPatchModel
				loadBalancerPatchModel.Name = core.StringPtr("my-load-balancer")
				loadBalancerPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				loadBalancerPatchModelAsPatch, asPatchErr := loadBalancerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerOptions model
				updateLoadBalancerOptionsModel := new(vpcv1.UpdateLoadBalancerOptions)
				updateLoadBalancerOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerOptionsModel.LoadBalancerPatch = loadBalancerPatchModelAsPatch
				updateLoadBalancerOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateLoadBalancerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateLoadBalancer(updateLoadBalancerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancerStatistics(getLoadBalancerStatisticsOptions *GetLoadBalancerStatisticsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getLoadBalancerStatisticsPath := "/load_balancers/testString/statistics"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerStatisticsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetLoadBalancerStatistics with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerStatisticsOptions model
				getLoadBalancerStatisticsOptionsModel := new(vpcv1.GetLoadBalancerStatisticsOptions)
				getLoadBalancerStatisticsOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerStatisticsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetLoadBalancerStatistics(getLoadBalancerStatisticsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetLoadBalancerStatistics(getLoadBalancerStatisticsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancerStatistics(getLoadBalancerStatisticsOptions *GetLoadBalancerStatisticsOptions)`, func() {
		version := "2024-06-23"
		getLoadBalancerStatisticsPath := "/load_balancers/testString/statistics"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerStatisticsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"active_connections": 797, "connection_rate": 91.121, "data_processed_this_month": 10093173145, "throughput": 167.278}`)
				}))
			})
			It(`Invoke GetLoadBalancerStatistics successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetLoadBalancerStatisticsOptions model
				getLoadBalancerStatisticsOptionsModel := new(vpcv1.GetLoadBalancerStatisticsOptions)
				getLoadBalancerStatisticsOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerStatisticsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetLoadBalancerStatisticsWithContext(ctx, getLoadBalancerStatisticsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetLoadBalancerStatistics(getLoadBalancerStatisticsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetLoadBalancerStatisticsWithContext(ctx, getLoadBalancerStatisticsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerStatisticsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"active_connections": 797, "connection_rate": 91.121, "data_processed_this_month": 10093173145, "throughput": 167.278}`)
				}))
			})
			It(`Invoke GetLoadBalancerStatistics successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetLoadBalancerStatistics(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetLoadBalancerStatisticsOptions model
				getLoadBalancerStatisticsOptionsModel := new(vpcv1.GetLoadBalancerStatisticsOptions)
				getLoadBalancerStatisticsOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerStatisticsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetLoadBalancerStatistics(getLoadBalancerStatisticsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetLoadBalancerStatistics with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerStatisticsOptions model
				getLoadBalancerStatisticsOptionsModel := new(vpcv1.GetLoadBalancerStatisticsOptions)
				getLoadBalancerStatisticsOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerStatisticsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetLoadBalancerStatistics(getLoadBalancerStatisticsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetLoadBalancerStatisticsOptions model with no property values
				getLoadBalancerStatisticsOptionsModelNew := new(vpcv1.GetLoadBalancerStatisticsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetLoadBalancerStatistics(getLoadBalancerStatisticsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetLoadBalancerStatistics successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerStatisticsOptions model
				getLoadBalancerStatisticsOptionsModel := new(vpcv1.GetLoadBalancerStatisticsOptions)
				getLoadBalancerStatisticsOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerStatisticsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetLoadBalancerStatistics(getLoadBalancerStatisticsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListLoadBalancerListeners(listLoadBalancerListenersOptions *ListLoadBalancerListenersOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listLoadBalancerListenersPath := "/load_balancers/testString/listeners"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerListenersPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListLoadBalancerListeners with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerListenersOptions model
				listLoadBalancerListenersOptionsModel := new(vpcv1.ListLoadBalancerListenersOptions)
				listLoadBalancerListenersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListLoadBalancerListeners(listLoadBalancerListenersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListLoadBalancerListeners(listLoadBalancerListenersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListLoadBalancerListeners(listLoadBalancerListenersOptions *ListLoadBalancerListenersOptions)`, func() {
		version := "2024-06-23"
		listLoadBalancerListenersPath := "/load_balancers/testString/listeners"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerListenersPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}, "uri": "/example?doc=get"}, "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}`)
				}))
			})
			It(`Invoke ListLoadBalancerListeners successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListLoadBalancerListenersOptions model
				listLoadBalancerListenersOptionsModel := new(vpcv1.ListLoadBalancerListenersOptions)
				listLoadBalancerListenersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListLoadBalancerListenersWithContext(ctx, listLoadBalancerListenersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListLoadBalancerListeners(listLoadBalancerListenersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListLoadBalancerListenersWithContext(ctx, listLoadBalancerListenersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerListenersPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}, "uri": "/example?doc=get"}, "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}`)
				}))
			})
			It(`Invoke ListLoadBalancerListeners successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListLoadBalancerListeners(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListLoadBalancerListenersOptions model
				listLoadBalancerListenersOptionsModel := new(vpcv1.ListLoadBalancerListenersOptions)
				listLoadBalancerListenersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListLoadBalancerListeners(listLoadBalancerListenersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListLoadBalancerListeners with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerListenersOptions model
				listLoadBalancerListenersOptionsModel := new(vpcv1.ListLoadBalancerListenersOptions)
				listLoadBalancerListenersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListLoadBalancerListeners(listLoadBalancerListenersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListLoadBalancerListenersOptions model with no property values
				listLoadBalancerListenersOptionsModelNew := new(vpcv1.ListLoadBalancerListenersOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListLoadBalancerListeners(listLoadBalancerListenersOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListLoadBalancerListeners successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerListenersOptions model
				listLoadBalancerListenersOptionsModel := new(vpcv1.ListLoadBalancerListenersOptions)
				listLoadBalancerListenersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListLoadBalancerListeners(listLoadBalancerListenersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateLoadBalancerListener(createLoadBalancerListenerOptions *CreateLoadBalancerListenerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createLoadBalancerListenerPath := "/load_balancers/testString/listeners"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerListenerPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateLoadBalancerListener with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model
				loadBalancerListenerHTTPSRedirectPrototypeModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPrototype)
				loadBalancerListenerHTTPSRedirectPrototypeModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPrototypeModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPrototypeModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPolicyRulePrototype model
				loadBalancerListenerPolicyRulePrototypeModel := new(vpcv1.LoadBalancerListenerPolicyRulePrototype)
				loadBalancerListenerPolicyRulePrototypeModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePrototypeModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePrototypeModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePrototypeModel.Value = core.StringPtr("testString")

				// Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPrototypeModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerPolicyPrototype model
				loadBalancerListenerPolicyPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyPrototype)
				loadBalancerListenerPolicyPrototypeModel.Action = core.StringPtr("forward_to_listener")
				loadBalancerListenerPolicyPrototypeModel.Name = core.StringPtr("my-load-balancer-listener-policy")
				loadBalancerListenerPolicyPrototypeModel.Priority = core.Int64Ptr(int64(5))
				loadBalancerListenerPolicyPrototypeModel.Rules = []vpcv1.LoadBalancerListenerPolicyRulePrototype{*loadBalancerListenerPolicyRulePrototypeModel}
				loadBalancerListenerPolicyPrototypeModel.Target = loadBalancerListenerPolicyTargetPrototypeModel

				// Construct an instance of the CreateLoadBalancerListenerOptions model
				createLoadBalancerListenerOptionsModel := new(vpcv1.CreateLoadBalancerListenerOptions)
				createLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerOptionsModel.Protocol = core.StringPtr("http")
				createLoadBalancerListenerOptionsModel.AcceptProxyProtocol = core.BoolPtr(true)
				createLoadBalancerListenerOptionsModel.CertificateInstance = certificateInstanceIdentityModel
				createLoadBalancerListenerOptionsModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				createLoadBalancerListenerOptionsModel.DefaultPool = loadBalancerPoolIdentityModel
				createLoadBalancerListenerOptionsModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPrototypeModel
				createLoadBalancerListenerOptionsModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				createLoadBalancerListenerOptionsModel.Policies = []vpcv1.LoadBalancerListenerPolicyPrototype{*loadBalancerListenerPolicyPrototypeModel}
				createLoadBalancerListenerOptionsModel.Port = core.Int64Ptr(int64(443))
				createLoadBalancerListenerOptionsModel.PortMax = core.Int64Ptr(int64(499))
				createLoadBalancerListenerOptionsModel.PortMin = core.Int64Ptr(int64(443))
				createLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateLoadBalancerListener(createLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateLoadBalancerListener(createLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateLoadBalancerListener(createLoadBalancerListenerOptions *CreateLoadBalancerListenerOptions)`, func() {
		version := "2024-06-23"
		createLoadBalancerListenerPath := "/load_balancers/testString/listeners"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerListenerPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}, "uri": "/example?doc=get"}, "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}`)
				}))
			})
			It(`Invoke CreateLoadBalancerListener successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model
				loadBalancerListenerHTTPSRedirectPrototypeModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPrototype)
				loadBalancerListenerHTTPSRedirectPrototypeModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPrototypeModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPrototypeModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPolicyRulePrototype model
				loadBalancerListenerPolicyRulePrototypeModel := new(vpcv1.LoadBalancerListenerPolicyRulePrototype)
				loadBalancerListenerPolicyRulePrototypeModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePrototypeModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePrototypeModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePrototypeModel.Value = core.StringPtr("testString")

				// Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPrototypeModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerPolicyPrototype model
				loadBalancerListenerPolicyPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyPrototype)
				loadBalancerListenerPolicyPrototypeModel.Action = core.StringPtr("forward_to_listener")
				loadBalancerListenerPolicyPrototypeModel.Name = core.StringPtr("my-load-balancer-listener-policy")
				loadBalancerListenerPolicyPrototypeModel.Priority = core.Int64Ptr(int64(5))
				loadBalancerListenerPolicyPrototypeModel.Rules = []vpcv1.LoadBalancerListenerPolicyRulePrototype{*loadBalancerListenerPolicyRulePrototypeModel}
				loadBalancerListenerPolicyPrototypeModel.Target = loadBalancerListenerPolicyTargetPrototypeModel

				// Construct an instance of the CreateLoadBalancerListenerOptions model
				createLoadBalancerListenerOptionsModel := new(vpcv1.CreateLoadBalancerListenerOptions)
				createLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerOptionsModel.Protocol = core.StringPtr("http")
				createLoadBalancerListenerOptionsModel.AcceptProxyProtocol = core.BoolPtr(true)
				createLoadBalancerListenerOptionsModel.CertificateInstance = certificateInstanceIdentityModel
				createLoadBalancerListenerOptionsModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				createLoadBalancerListenerOptionsModel.DefaultPool = loadBalancerPoolIdentityModel
				createLoadBalancerListenerOptionsModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPrototypeModel
				createLoadBalancerListenerOptionsModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				createLoadBalancerListenerOptionsModel.Policies = []vpcv1.LoadBalancerListenerPolicyPrototype{*loadBalancerListenerPolicyPrototypeModel}
				createLoadBalancerListenerOptionsModel.Port = core.Int64Ptr(int64(443))
				createLoadBalancerListenerOptionsModel.PortMax = core.Int64Ptr(int64(499))
				createLoadBalancerListenerOptionsModel.PortMin = core.Int64Ptr(int64(443))
				createLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateLoadBalancerListenerWithContext(ctx, createLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateLoadBalancerListener(createLoadBalancerListenerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateLoadBalancerListenerWithContext(ctx, createLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerListenerPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}, "uri": "/example?doc=get"}, "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}`)
				}))
			})
			It(`Invoke CreateLoadBalancerListener successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateLoadBalancerListener(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model
				loadBalancerListenerHTTPSRedirectPrototypeModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPrototype)
				loadBalancerListenerHTTPSRedirectPrototypeModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPrototypeModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPrototypeModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPolicyRulePrototype model
				loadBalancerListenerPolicyRulePrototypeModel := new(vpcv1.LoadBalancerListenerPolicyRulePrototype)
				loadBalancerListenerPolicyRulePrototypeModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePrototypeModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePrototypeModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePrototypeModel.Value = core.StringPtr("testString")

				// Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPrototypeModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerPolicyPrototype model
				loadBalancerListenerPolicyPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyPrototype)
				loadBalancerListenerPolicyPrototypeModel.Action = core.StringPtr("forward_to_listener")
				loadBalancerListenerPolicyPrototypeModel.Name = core.StringPtr("my-load-balancer-listener-policy")
				loadBalancerListenerPolicyPrototypeModel.Priority = core.Int64Ptr(int64(5))
				loadBalancerListenerPolicyPrototypeModel.Rules = []vpcv1.LoadBalancerListenerPolicyRulePrototype{*loadBalancerListenerPolicyRulePrototypeModel}
				loadBalancerListenerPolicyPrototypeModel.Target = loadBalancerListenerPolicyTargetPrototypeModel

				// Construct an instance of the CreateLoadBalancerListenerOptions model
				createLoadBalancerListenerOptionsModel := new(vpcv1.CreateLoadBalancerListenerOptions)
				createLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerOptionsModel.Protocol = core.StringPtr("http")
				createLoadBalancerListenerOptionsModel.AcceptProxyProtocol = core.BoolPtr(true)
				createLoadBalancerListenerOptionsModel.CertificateInstance = certificateInstanceIdentityModel
				createLoadBalancerListenerOptionsModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				createLoadBalancerListenerOptionsModel.DefaultPool = loadBalancerPoolIdentityModel
				createLoadBalancerListenerOptionsModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPrototypeModel
				createLoadBalancerListenerOptionsModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				createLoadBalancerListenerOptionsModel.Policies = []vpcv1.LoadBalancerListenerPolicyPrototype{*loadBalancerListenerPolicyPrototypeModel}
				createLoadBalancerListenerOptionsModel.Port = core.Int64Ptr(int64(443))
				createLoadBalancerListenerOptionsModel.PortMax = core.Int64Ptr(int64(499))
				createLoadBalancerListenerOptionsModel.PortMin = core.Int64Ptr(int64(443))
				createLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateLoadBalancerListener(createLoadBalancerListenerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateLoadBalancerListener with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model
				loadBalancerListenerHTTPSRedirectPrototypeModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPrototype)
				loadBalancerListenerHTTPSRedirectPrototypeModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPrototypeModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPrototypeModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPolicyRulePrototype model
				loadBalancerListenerPolicyRulePrototypeModel := new(vpcv1.LoadBalancerListenerPolicyRulePrototype)
				loadBalancerListenerPolicyRulePrototypeModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePrototypeModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePrototypeModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePrototypeModel.Value = core.StringPtr("testString")

				// Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPrototypeModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerPolicyPrototype model
				loadBalancerListenerPolicyPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyPrototype)
				loadBalancerListenerPolicyPrototypeModel.Action = core.StringPtr("forward_to_listener")
				loadBalancerListenerPolicyPrototypeModel.Name = core.StringPtr("my-load-balancer-listener-policy")
				loadBalancerListenerPolicyPrototypeModel.Priority = core.Int64Ptr(int64(5))
				loadBalancerListenerPolicyPrototypeModel.Rules = []vpcv1.LoadBalancerListenerPolicyRulePrototype{*loadBalancerListenerPolicyRulePrototypeModel}
				loadBalancerListenerPolicyPrototypeModel.Target = loadBalancerListenerPolicyTargetPrototypeModel

				// Construct an instance of the CreateLoadBalancerListenerOptions model
				createLoadBalancerListenerOptionsModel := new(vpcv1.CreateLoadBalancerListenerOptions)
				createLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerOptionsModel.Protocol = core.StringPtr("http")
				createLoadBalancerListenerOptionsModel.AcceptProxyProtocol = core.BoolPtr(true)
				createLoadBalancerListenerOptionsModel.CertificateInstance = certificateInstanceIdentityModel
				createLoadBalancerListenerOptionsModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				createLoadBalancerListenerOptionsModel.DefaultPool = loadBalancerPoolIdentityModel
				createLoadBalancerListenerOptionsModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPrototypeModel
				createLoadBalancerListenerOptionsModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				createLoadBalancerListenerOptionsModel.Policies = []vpcv1.LoadBalancerListenerPolicyPrototype{*loadBalancerListenerPolicyPrototypeModel}
				createLoadBalancerListenerOptionsModel.Port = core.Int64Ptr(int64(443))
				createLoadBalancerListenerOptionsModel.PortMax = core.Int64Ptr(int64(499))
				createLoadBalancerListenerOptionsModel.PortMin = core.Int64Ptr(int64(443))
				createLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateLoadBalancerListener(createLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateLoadBalancerListenerOptions model with no property values
				createLoadBalancerListenerOptionsModelNew := new(vpcv1.CreateLoadBalancerListenerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateLoadBalancerListener(createLoadBalancerListenerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateLoadBalancerListener successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model
				loadBalancerListenerHTTPSRedirectPrototypeModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPrototype)
				loadBalancerListenerHTTPSRedirectPrototypeModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPrototypeModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPrototypeModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPolicyRulePrototype model
				loadBalancerListenerPolicyRulePrototypeModel := new(vpcv1.LoadBalancerListenerPolicyRulePrototype)
				loadBalancerListenerPolicyRulePrototypeModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePrototypeModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePrototypeModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePrototypeModel.Value = core.StringPtr("testString")

				// Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPrototypeModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerPolicyPrototype model
				loadBalancerListenerPolicyPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyPrototype)
				loadBalancerListenerPolicyPrototypeModel.Action = core.StringPtr("forward_to_listener")
				loadBalancerListenerPolicyPrototypeModel.Name = core.StringPtr("my-load-balancer-listener-policy")
				loadBalancerListenerPolicyPrototypeModel.Priority = core.Int64Ptr(int64(5))
				loadBalancerListenerPolicyPrototypeModel.Rules = []vpcv1.LoadBalancerListenerPolicyRulePrototype{*loadBalancerListenerPolicyRulePrototypeModel}
				loadBalancerListenerPolicyPrototypeModel.Target = loadBalancerListenerPolicyTargetPrototypeModel

				// Construct an instance of the CreateLoadBalancerListenerOptions model
				createLoadBalancerListenerOptionsModel := new(vpcv1.CreateLoadBalancerListenerOptions)
				createLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerOptionsModel.Protocol = core.StringPtr("http")
				createLoadBalancerListenerOptionsModel.AcceptProxyProtocol = core.BoolPtr(true)
				createLoadBalancerListenerOptionsModel.CertificateInstance = certificateInstanceIdentityModel
				createLoadBalancerListenerOptionsModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				createLoadBalancerListenerOptionsModel.DefaultPool = loadBalancerPoolIdentityModel
				createLoadBalancerListenerOptionsModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPrototypeModel
				createLoadBalancerListenerOptionsModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				createLoadBalancerListenerOptionsModel.Policies = []vpcv1.LoadBalancerListenerPolicyPrototype{*loadBalancerListenerPolicyPrototypeModel}
				createLoadBalancerListenerOptionsModel.Port = core.Int64Ptr(int64(443))
				createLoadBalancerListenerOptionsModel.PortMax = core.Int64Ptr(int64(499))
				createLoadBalancerListenerOptionsModel.PortMin = core.Int64Ptr(int64(443))
				createLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateLoadBalancerListener(createLoadBalancerListenerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteLoadBalancerListener(deleteLoadBalancerListenerOptions *DeleteLoadBalancerListenerOptions)`, func() {
		version := "2024-06-23"
		deleteLoadBalancerListenerPath := "/load_balancers/testString/listeners/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteLoadBalancerListenerPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteLoadBalancerListener successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteLoadBalancerListener(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteLoadBalancerListenerOptions model
				deleteLoadBalancerListenerOptionsModel := new(vpcv1.DeleteLoadBalancerListenerOptions)
				deleteLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				deleteLoadBalancerListenerOptionsModel.ID = core.StringPtr("testString")
				deleteLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteLoadBalancerListener(deleteLoadBalancerListenerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteLoadBalancerListener with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteLoadBalancerListenerOptions model
				deleteLoadBalancerListenerOptionsModel := new(vpcv1.DeleteLoadBalancerListenerOptions)
				deleteLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				deleteLoadBalancerListenerOptionsModel.ID = core.StringPtr("testString")
				deleteLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteLoadBalancerListener(deleteLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteLoadBalancerListenerOptions model with no property values
				deleteLoadBalancerListenerOptionsModelNew := new(vpcv1.DeleteLoadBalancerListenerOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteLoadBalancerListener(deleteLoadBalancerListenerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancerListener(getLoadBalancerListenerOptions *GetLoadBalancerListenerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getLoadBalancerListenerPath := "/load_balancers/testString/listeners/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerListenerPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetLoadBalancerListener with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerListenerOptions model
				getLoadBalancerListenerOptionsModel := new(vpcv1.GetLoadBalancerListenerOptions)
				getLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetLoadBalancerListener(getLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetLoadBalancerListener(getLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancerListener(getLoadBalancerListenerOptions *GetLoadBalancerListenerOptions)`, func() {
		version := "2024-06-23"
		getLoadBalancerListenerPath := "/load_balancers/testString/listeners/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerListenerPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}, "uri": "/example?doc=get"}, "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}`)
				}))
			})
			It(`Invoke GetLoadBalancerListener successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetLoadBalancerListenerOptions model
				getLoadBalancerListenerOptionsModel := new(vpcv1.GetLoadBalancerListenerOptions)
				getLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetLoadBalancerListenerWithContext(ctx, getLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetLoadBalancerListener(getLoadBalancerListenerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetLoadBalancerListenerWithContext(ctx, getLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerListenerPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}, "uri": "/example?doc=get"}, "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}`)
				}))
			})
			It(`Invoke GetLoadBalancerListener successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetLoadBalancerListener(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetLoadBalancerListenerOptions model
				getLoadBalancerListenerOptionsModel := new(vpcv1.GetLoadBalancerListenerOptions)
				getLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetLoadBalancerListener(getLoadBalancerListenerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetLoadBalancerListener with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerListenerOptions model
				getLoadBalancerListenerOptionsModel := new(vpcv1.GetLoadBalancerListenerOptions)
				getLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetLoadBalancerListener(getLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetLoadBalancerListenerOptions model with no property values
				getLoadBalancerListenerOptionsModelNew := new(vpcv1.GetLoadBalancerListenerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetLoadBalancerListener(getLoadBalancerListenerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetLoadBalancerListener successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerListenerOptions model
				getLoadBalancerListenerOptionsModel := new(vpcv1.GetLoadBalancerListenerOptions)
				getLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetLoadBalancerListener(getLoadBalancerListenerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateLoadBalancerListener(updateLoadBalancerListenerOptions *UpdateLoadBalancerListenerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateLoadBalancerListenerPath := "/load_balancers/testString/listeners/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerListenerPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateLoadBalancerListener with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID model
				loadBalancerListenerDefaultPoolPatchModel := new(vpcv1.LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID)
				loadBalancerListenerDefaultPoolPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPatch model
				loadBalancerListenerHTTPSRedirectPatchModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPatch)
				loadBalancerListenerHTTPSRedirectPatchModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPatchModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPatchModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPatch model
				loadBalancerListenerPatchModel := new(vpcv1.LoadBalancerListenerPatch)
				loadBalancerListenerPatchModel.AcceptProxyProtocol = core.BoolPtr(true)
				loadBalancerListenerPatchModel.CertificateInstance = certificateInstanceIdentityModel
				loadBalancerListenerPatchModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				loadBalancerListenerPatchModel.DefaultPool = loadBalancerListenerDefaultPoolPatchModel
				loadBalancerListenerPatchModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPatchModel
				loadBalancerListenerPatchModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				loadBalancerListenerPatchModel.Port = core.Int64Ptr(int64(443))
				loadBalancerListenerPatchModel.PortMax = core.Int64Ptr(int64(499))
				loadBalancerListenerPatchModel.PortMin = core.Int64Ptr(int64(443))
				loadBalancerListenerPatchModel.Protocol = core.StringPtr("http")
				loadBalancerListenerPatchModelAsPatch, asPatchErr := loadBalancerListenerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerOptions model
				updateLoadBalancerListenerOptionsModel := new(vpcv1.UpdateLoadBalancerListenerOptions)
				updateLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerOptionsModel.LoadBalancerListenerPatch = loadBalancerListenerPatchModelAsPatch
				updateLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateLoadBalancerListener(updateLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateLoadBalancerListener(updateLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateLoadBalancerListener(updateLoadBalancerListenerOptions *UpdateLoadBalancerListenerOptions)`, func() {
		version := "2024-06-23"
		updateLoadBalancerListenerPath := "/load_balancers/testString/listeners/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerListenerPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}, "uri": "/example?doc=get"}, "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}`)
				}))
			})
			It(`Invoke UpdateLoadBalancerListener successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID model
				loadBalancerListenerDefaultPoolPatchModel := new(vpcv1.LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID)
				loadBalancerListenerDefaultPoolPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPatch model
				loadBalancerListenerHTTPSRedirectPatchModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPatch)
				loadBalancerListenerHTTPSRedirectPatchModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPatchModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPatchModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPatch model
				loadBalancerListenerPatchModel := new(vpcv1.LoadBalancerListenerPatch)
				loadBalancerListenerPatchModel.AcceptProxyProtocol = core.BoolPtr(true)
				loadBalancerListenerPatchModel.CertificateInstance = certificateInstanceIdentityModel
				loadBalancerListenerPatchModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				loadBalancerListenerPatchModel.DefaultPool = loadBalancerListenerDefaultPoolPatchModel
				loadBalancerListenerPatchModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPatchModel
				loadBalancerListenerPatchModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				loadBalancerListenerPatchModel.Port = core.Int64Ptr(int64(443))
				loadBalancerListenerPatchModel.PortMax = core.Int64Ptr(int64(499))
				loadBalancerListenerPatchModel.PortMin = core.Int64Ptr(int64(443))
				loadBalancerListenerPatchModel.Protocol = core.StringPtr("http")
				loadBalancerListenerPatchModelAsPatch, asPatchErr := loadBalancerListenerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerOptions model
				updateLoadBalancerListenerOptionsModel := new(vpcv1.UpdateLoadBalancerListenerOptions)
				updateLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerOptionsModel.LoadBalancerListenerPatch = loadBalancerListenerPatchModelAsPatch
				updateLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateLoadBalancerListenerWithContext(ctx, updateLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateLoadBalancerListener(updateLoadBalancerListenerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateLoadBalancerListenerWithContext(ctx, updateLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerListenerPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"}, "uri": "/example?doc=get"}, "id": "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}`)
				}))
			})
			It(`Invoke UpdateLoadBalancerListener successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateLoadBalancerListener(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID model
				loadBalancerListenerDefaultPoolPatchModel := new(vpcv1.LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID)
				loadBalancerListenerDefaultPoolPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPatch model
				loadBalancerListenerHTTPSRedirectPatchModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPatch)
				loadBalancerListenerHTTPSRedirectPatchModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPatchModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPatchModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPatch model
				loadBalancerListenerPatchModel := new(vpcv1.LoadBalancerListenerPatch)
				loadBalancerListenerPatchModel.AcceptProxyProtocol = core.BoolPtr(true)
				loadBalancerListenerPatchModel.CertificateInstance = certificateInstanceIdentityModel
				loadBalancerListenerPatchModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				loadBalancerListenerPatchModel.DefaultPool = loadBalancerListenerDefaultPoolPatchModel
				loadBalancerListenerPatchModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPatchModel
				loadBalancerListenerPatchModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				loadBalancerListenerPatchModel.Port = core.Int64Ptr(int64(443))
				loadBalancerListenerPatchModel.PortMax = core.Int64Ptr(int64(499))
				loadBalancerListenerPatchModel.PortMin = core.Int64Ptr(int64(443))
				loadBalancerListenerPatchModel.Protocol = core.StringPtr("http")
				loadBalancerListenerPatchModelAsPatch, asPatchErr := loadBalancerListenerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerOptions model
				updateLoadBalancerListenerOptionsModel := new(vpcv1.UpdateLoadBalancerListenerOptions)
				updateLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerOptionsModel.LoadBalancerListenerPatch = loadBalancerListenerPatchModelAsPatch
				updateLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateLoadBalancerListener(updateLoadBalancerListenerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateLoadBalancerListener with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID model
				loadBalancerListenerDefaultPoolPatchModel := new(vpcv1.LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID)
				loadBalancerListenerDefaultPoolPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPatch model
				loadBalancerListenerHTTPSRedirectPatchModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPatch)
				loadBalancerListenerHTTPSRedirectPatchModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPatchModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPatchModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPatch model
				loadBalancerListenerPatchModel := new(vpcv1.LoadBalancerListenerPatch)
				loadBalancerListenerPatchModel.AcceptProxyProtocol = core.BoolPtr(true)
				loadBalancerListenerPatchModel.CertificateInstance = certificateInstanceIdentityModel
				loadBalancerListenerPatchModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				loadBalancerListenerPatchModel.DefaultPool = loadBalancerListenerDefaultPoolPatchModel
				loadBalancerListenerPatchModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPatchModel
				loadBalancerListenerPatchModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				loadBalancerListenerPatchModel.Port = core.Int64Ptr(int64(443))
				loadBalancerListenerPatchModel.PortMax = core.Int64Ptr(int64(499))
				loadBalancerListenerPatchModel.PortMin = core.Int64Ptr(int64(443))
				loadBalancerListenerPatchModel.Protocol = core.StringPtr("http")
				loadBalancerListenerPatchModelAsPatch, asPatchErr := loadBalancerListenerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerOptions model
				updateLoadBalancerListenerOptionsModel := new(vpcv1.UpdateLoadBalancerListenerOptions)
				updateLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerOptionsModel.LoadBalancerListenerPatch = loadBalancerListenerPatchModelAsPatch
				updateLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateLoadBalancerListener(updateLoadBalancerListenerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateLoadBalancerListenerOptions model with no property values
				updateLoadBalancerListenerOptionsModelNew := new(vpcv1.UpdateLoadBalancerListenerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateLoadBalancerListener(updateLoadBalancerListenerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateLoadBalancerListener successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID model
				loadBalancerListenerDefaultPoolPatchModel := new(vpcv1.LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID)
				loadBalancerListenerDefaultPoolPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPatch model
				loadBalancerListenerHTTPSRedirectPatchModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPatch)
				loadBalancerListenerHTTPSRedirectPatchModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPatchModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPatchModel.URI = core.StringPtr("/example?doc=get")

				// Construct an instance of the LoadBalancerListenerPatch model
				loadBalancerListenerPatchModel := new(vpcv1.LoadBalancerListenerPatch)
				loadBalancerListenerPatchModel.AcceptProxyProtocol = core.BoolPtr(true)
				loadBalancerListenerPatchModel.CertificateInstance = certificateInstanceIdentityModel
				loadBalancerListenerPatchModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				loadBalancerListenerPatchModel.DefaultPool = loadBalancerListenerDefaultPoolPatchModel
				loadBalancerListenerPatchModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPatchModel
				loadBalancerListenerPatchModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				loadBalancerListenerPatchModel.Port = core.Int64Ptr(int64(443))
				loadBalancerListenerPatchModel.PortMax = core.Int64Ptr(int64(499))
				loadBalancerListenerPatchModel.PortMin = core.Int64Ptr(int64(443))
				loadBalancerListenerPatchModel.Protocol = core.StringPtr("http")
				loadBalancerListenerPatchModelAsPatch, asPatchErr := loadBalancerListenerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerOptions model
				updateLoadBalancerListenerOptionsModel := new(vpcv1.UpdateLoadBalancerListenerOptions)
				updateLoadBalancerListenerOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerOptionsModel.LoadBalancerListenerPatch = loadBalancerListenerPatchModelAsPatch
				updateLoadBalancerListenerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateLoadBalancerListener(updateLoadBalancerListenerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptions *ListLoadBalancerListenerPoliciesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listLoadBalancerListenerPoliciesPath := "/load_balancers/testString/listeners/testString/policies"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerListenerPoliciesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListLoadBalancerListenerPolicies with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerListenerPoliciesOptions model
				listLoadBalancerListenerPoliciesOptionsModel := new(vpcv1.ListLoadBalancerListenerPoliciesOptions)
				listLoadBalancerListenerPoliciesOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenerPoliciesOptionsModel.ListenerID = core.StringPtr("testString")
				listLoadBalancerListenerPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptions *ListLoadBalancerListenerPoliciesOptions)`, func() {
		version := "2024-06-23"
		listLoadBalancerListenerPoliciesPath := "/load_balancers/testString/listeners/testString/policies"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerListenerPoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"policies": [{"action": "forward_to_listener", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}]}`)
				}))
			})
			It(`Invoke ListLoadBalancerListenerPolicies successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListLoadBalancerListenerPoliciesOptions model
				listLoadBalancerListenerPoliciesOptionsModel := new(vpcv1.ListLoadBalancerListenerPoliciesOptions)
				listLoadBalancerListenerPoliciesOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenerPoliciesOptionsModel.ListenerID = core.StringPtr("testString")
				listLoadBalancerListenerPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListLoadBalancerListenerPoliciesWithContext(ctx, listLoadBalancerListenerPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListLoadBalancerListenerPoliciesWithContext(ctx, listLoadBalancerListenerPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerListenerPoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"policies": [{"action": "forward_to_listener", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}]}`)
				}))
			})
			It(`Invoke ListLoadBalancerListenerPolicies successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListLoadBalancerListenerPolicies(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListLoadBalancerListenerPoliciesOptions model
				listLoadBalancerListenerPoliciesOptionsModel := new(vpcv1.ListLoadBalancerListenerPoliciesOptions)
				listLoadBalancerListenerPoliciesOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenerPoliciesOptionsModel.ListenerID = core.StringPtr("testString")
				listLoadBalancerListenerPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListLoadBalancerListenerPolicies with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerListenerPoliciesOptions model
				listLoadBalancerListenerPoliciesOptionsModel := new(vpcv1.ListLoadBalancerListenerPoliciesOptions)
				listLoadBalancerListenerPoliciesOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenerPoliciesOptionsModel.ListenerID = core.StringPtr("testString")
				listLoadBalancerListenerPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListLoadBalancerListenerPoliciesOptions model with no property values
				listLoadBalancerListenerPoliciesOptionsModelNew := new(vpcv1.ListLoadBalancerListenerPoliciesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListLoadBalancerListenerPolicies successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerListenerPoliciesOptions model
				listLoadBalancerListenerPoliciesOptionsModel := new(vpcv1.ListLoadBalancerListenerPoliciesOptions)
				listLoadBalancerListenerPoliciesOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenerPoliciesOptionsModel.ListenerID = core.StringPtr("testString")
				listLoadBalancerListenerPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptions *CreateLoadBalancerListenerPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createLoadBalancerListenerPolicyPath := "/load_balancers/testString/listeners/testString/policies"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerListenerPolicyPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateLoadBalancerListenerPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerListenerPolicyRulePrototype model
				loadBalancerListenerPolicyRulePrototypeModel := new(vpcv1.LoadBalancerListenerPolicyRulePrototype)
				loadBalancerListenerPolicyRulePrototypeModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePrototypeModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePrototypeModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePrototypeModel.Value = core.StringPtr("testString")

				// Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPrototypeModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the CreateLoadBalancerListenerPolicyOptions model
				createLoadBalancerListenerPolicyOptionsModel := new(vpcv1.CreateLoadBalancerListenerPolicyOptions)
				createLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyOptionsModel.Action = core.StringPtr("forward_to_listener")
				createLoadBalancerListenerPolicyOptionsModel.Priority = core.Int64Ptr(int64(5))
				createLoadBalancerListenerPolicyOptionsModel.Name = core.StringPtr("my-load-balancer-listener-policy")
				createLoadBalancerListenerPolicyOptionsModel.Rules = []vpcv1.LoadBalancerListenerPolicyRulePrototype{*loadBalancerListenerPolicyRulePrototypeModel}
				createLoadBalancerListenerPolicyOptionsModel.Target = loadBalancerListenerPolicyTargetPrototypeModel
				createLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptions *CreateLoadBalancerListenerPolicyOptions)`, func() {
		version := "2024-06-23"
		createLoadBalancerListenerPolicyPath := "/load_balancers/testString/listeners/testString/policies"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerListenerPolicyPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"action": "forward_to_listener", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}`)
				}))
			})
			It(`Invoke CreateLoadBalancerListenerPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the LoadBalancerListenerPolicyRulePrototype model
				loadBalancerListenerPolicyRulePrototypeModel := new(vpcv1.LoadBalancerListenerPolicyRulePrototype)
				loadBalancerListenerPolicyRulePrototypeModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePrototypeModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePrototypeModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePrototypeModel.Value = core.StringPtr("testString")

				// Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPrototypeModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the CreateLoadBalancerListenerPolicyOptions model
				createLoadBalancerListenerPolicyOptionsModel := new(vpcv1.CreateLoadBalancerListenerPolicyOptions)
				createLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyOptionsModel.Action = core.StringPtr("forward_to_listener")
				createLoadBalancerListenerPolicyOptionsModel.Priority = core.Int64Ptr(int64(5))
				createLoadBalancerListenerPolicyOptionsModel.Name = core.StringPtr("my-load-balancer-listener-policy")
				createLoadBalancerListenerPolicyOptionsModel.Rules = []vpcv1.LoadBalancerListenerPolicyRulePrototype{*loadBalancerListenerPolicyRulePrototypeModel}
				createLoadBalancerListenerPolicyOptionsModel.Target = loadBalancerListenerPolicyTargetPrototypeModel
				createLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateLoadBalancerListenerPolicyWithContext(ctx, createLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateLoadBalancerListenerPolicyWithContext(ctx, createLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerListenerPolicyPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"action": "forward_to_listener", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}`)
				}))
			})
			It(`Invoke CreateLoadBalancerListenerPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateLoadBalancerListenerPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the LoadBalancerListenerPolicyRulePrototype model
				loadBalancerListenerPolicyRulePrototypeModel := new(vpcv1.LoadBalancerListenerPolicyRulePrototype)
				loadBalancerListenerPolicyRulePrototypeModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePrototypeModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePrototypeModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePrototypeModel.Value = core.StringPtr("testString")

				// Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPrototypeModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the CreateLoadBalancerListenerPolicyOptions model
				createLoadBalancerListenerPolicyOptionsModel := new(vpcv1.CreateLoadBalancerListenerPolicyOptions)
				createLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyOptionsModel.Action = core.StringPtr("forward_to_listener")
				createLoadBalancerListenerPolicyOptionsModel.Priority = core.Int64Ptr(int64(5))
				createLoadBalancerListenerPolicyOptionsModel.Name = core.StringPtr("my-load-balancer-listener-policy")
				createLoadBalancerListenerPolicyOptionsModel.Rules = []vpcv1.LoadBalancerListenerPolicyRulePrototype{*loadBalancerListenerPolicyRulePrototypeModel}
				createLoadBalancerListenerPolicyOptionsModel.Target = loadBalancerListenerPolicyTargetPrototypeModel
				createLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateLoadBalancerListenerPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerListenerPolicyRulePrototype model
				loadBalancerListenerPolicyRulePrototypeModel := new(vpcv1.LoadBalancerListenerPolicyRulePrototype)
				loadBalancerListenerPolicyRulePrototypeModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePrototypeModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePrototypeModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePrototypeModel.Value = core.StringPtr("testString")

				// Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPrototypeModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the CreateLoadBalancerListenerPolicyOptions model
				createLoadBalancerListenerPolicyOptionsModel := new(vpcv1.CreateLoadBalancerListenerPolicyOptions)
				createLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyOptionsModel.Action = core.StringPtr("forward_to_listener")
				createLoadBalancerListenerPolicyOptionsModel.Priority = core.Int64Ptr(int64(5))
				createLoadBalancerListenerPolicyOptionsModel.Name = core.StringPtr("my-load-balancer-listener-policy")
				createLoadBalancerListenerPolicyOptionsModel.Rules = []vpcv1.LoadBalancerListenerPolicyRulePrototype{*loadBalancerListenerPolicyRulePrototypeModel}
				createLoadBalancerListenerPolicyOptionsModel.Target = loadBalancerListenerPolicyTargetPrototypeModel
				createLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateLoadBalancerListenerPolicyOptions model with no property values
				createLoadBalancerListenerPolicyOptionsModelNew := new(vpcv1.CreateLoadBalancerListenerPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateLoadBalancerListenerPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerListenerPolicyRulePrototype model
				loadBalancerListenerPolicyRulePrototypeModel := new(vpcv1.LoadBalancerListenerPolicyRulePrototype)
				loadBalancerListenerPolicyRulePrototypeModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePrototypeModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePrototypeModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePrototypeModel.Value = core.StringPtr("testString")

				// Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPrototypeModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the CreateLoadBalancerListenerPolicyOptions model
				createLoadBalancerListenerPolicyOptionsModel := new(vpcv1.CreateLoadBalancerListenerPolicyOptions)
				createLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyOptionsModel.Action = core.StringPtr("forward_to_listener")
				createLoadBalancerListenerPolicyOptionsModel.Priority = core.Int64Ptr(int64(5))
				createLoadBalancerListenerPolicyOptionsModel.Name = core.StringPtr("my-load-balancer-listener-policy")
				createLoadBalancerListenerPolicyOptionsModel.Rules = []vpcv1.LoadBalancerListenerPolicyRulePrototype{*loadBalancerListenerPolicyRulePrototypeModel}
				createLoadBalancerListenerPolicyOptionsModel.Target = loadBalancerListenerPolicyTargetPrototypeModel
				createLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteLoadBalancerListenerPolicy(deleteLoadBalancerListenerPolicyOptions *DeleteLoadBalancerListenerPolicyOptions)`, func() {
		version := "2024-06-23"
		deleteLoadBalancerListenerPolicyPath := "/load_balancers/testString/listeners/testString/policies/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteLoadBalancerListenerPolicyPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteLoadBalancerListenerPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteLoadBalancerListenerPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteLoadBalancerListenerPolicyOptions model
				deleteLoadBalancerListenerPolicyOptionsModel := new(vpcv1.DeleteLoadBalancerListenerPolicyOptions)
				deleteLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				deleteLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				deleteLoadBalancerListenerPolicyOptionsModel.ID = core.StringPtr("testString")
				deleteLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteLoadBalancerListenerPolicy(deleteLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteLoadBalancerListenerPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteLoadBalancerListenerPolicyOptions model
				deleteLoadBalancerListenerPolicyOptionsModel := new(vpcv1.DeleteLoadBalancerListenerPolicyOptions)
				deleteLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				deleteLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				deleteLoadBalancerListenerPolicyOptionsModel.ID = core.StringPtr("testString")
				deleteLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteLoadBalancerListenerPolicy(deleteLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteLoadBalancerListenerPolicyOptions model with no property values
				deleteLoadBalancerListenerPolicyOptionsModelNew := new(vpcv1.DeleteLoadBalancerListenerPolicyOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteLoadBalancerListenerPolicy(deleteLoadBalancerListenerPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptions *GetLoadBalancerListenerPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getLoadBalancerListenerPolicyPath := "/load_balancers/testString/listeners/testString/policies/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerListenerPolicyPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetLoadBalancerListenerPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerListenerPolicyOptions model
				getLoadBalancerListenerPolicyOptionsModel := new(vpcv1.GetLoadBalancerListenerPolicyOptions)
				getLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptions *GetLoadBalancerListenerPolicyOptions)`, func() {
		version := "2024-06-23"
		getLoadBalancerListenerPolicyPath := "/load_balancers/testString/listeners/testString/policies/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerListenerPolicyPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "forward_to_listener", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}`)
				}))
			})
			It(`Invoke GetLoadBalancerListenerPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetLoadBalancerListenerPolicyOptions model
				getLoadBalancerListenerPolicyOptionsModel := new(vpcv1.GetLoadBalancerListenerPolicyOptions)
				getLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetLoadBalancerListenerPolicyWithContext(ctx, getLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetLoadBalancerListenerPolicyWithContext(ctx, getLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerListenerPolicyPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "forward_to_listener", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}`)
				}))
			})
			It(`Invoke GetLoadBalancerListenerPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetLoadBalancerListenerPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetLoadBalancerListenerPolicyOptions model
				getLoadBalancerListenerPolicyOptionsModel := new(vpcv1.GetLoadBalancerListenerPolicyOptions)
				getLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetLoadBalancerListenerPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerListenerPolicyOptions model
				getLoadBalancerListenerPolicyOptionsModel := new(vpcv1.GetLoadBalancerListenerPolicyOptions)
				getLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetLoadBalancerListenerPolicyOptions model with no property values
				getLoadBalancerListenerPolicyOptionsModelNew := new(vpcv1.GetLoadBalancerListenerPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetLoadBalancerListenerPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerListenerPolicyOptions model
				getLoadBalancerListenerPolicyOptionsModel := new(vpcv1.GetLoadBalancerListenerPolicyOptions)
				getLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptions *UpdateLoadBalancerListenerPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateLoadBalancerListenerPolicyPath := "/load_balancers/testString/listeners/testString/policies/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerListenerPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateLoadBalancerListenerPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPatchModel := new(vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerPolicyPatch model
				loadBalancerListenerPolicyPatchModel := new(vpcv1.LoadBalancerListenerPolicyPatch)
				loadBalancerListenerPolicyPatchModel.Name = core.StringPtr("my-load-balancer-listener-policy-updated")
				loadBalancerListenerPolicyPatchModel.Priority = core.Int64Ptr(int64(5))
				loadBalancerListenerPolicyPatchModel.Target = loadBalancerListenerPolicyTargetPatchModel
				loadBalancerListenerPolicyPatchModelAsPatch, asPatchErr := loadBalancerListenerPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerPolicyOptions model
				updateLoadBalancerListenerPolicyOptionsModel := new(vpcv1.UpdateLoadBalancerListenerPolicyOptions)
				updateLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.LoadBalancerListenerPolicyPatch = loadBalancerListenerPolicyPatchModelAsPatch
				updateLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptions *UpdateLoadBalancerListenerPolicyOptions)`, func() {
		version := "2024-06-23"
		updateLoadBalancerListenerPolicyPath := "/load_balancers/testString/listeners/testString/policies/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerListenerPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "forward_to_listener", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}`)
				}))
			})
			It(`Invoke UpdateLoadBalancerListenerPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPatchModel := new(vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerPolicyPatch model
				loadBalancerListenerPolicyPatchModel := new(vpcv1.LoadBalancerListenerPolicyPatch)
				loadBalancerListenerPolicyPatchModel.Name = core.StringPtr("my-load-balancer-listener-policy-updated")
				loadBalancerListenerPolicyPatchModel.Priority = core.Int64Ptr(int64(5))
				loadBalancerListenerPolicyPatchModel.Target = loadBalancerListenerPolicyTargetPatchModel
				loadBalancerListenerPolicyPatchModelAsPatch, asPatchErr := loadBalancerListenerPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerPolicyOptions model
				updateLoadBalancerListenerPolicyOptionsModel := new(vpcv1.UpdateLoadBalancerListenerPolicyOptions)
				updateLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.LoadBalancerListenerPolicyPatch = loadBalancerListenerPolicyPatchModelAsPatch
				updateLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateLoadBalancerListenerPolicyWithContext(ctx, updateLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateLoadBalancerListenerPolicyWithContext(ctx, updateLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerListenerPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "forward_to_listener", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "id": "r006-0b00a37f-a3d7-43ca-8187-f1e88d659245", "name": "my-load-balancer-listener-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}`)
				}))
			})
			It(`Invoke UpdateLoadBalancerListenerPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateLoadBalancerListenerPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPatchModel := new(vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerPolicyPatch model
				loadBalancerListenerPolicyPatchModel := new(vpcv1.LoadBalancerListenerPolicyPatch)
				loadBalancerListenerPolicyPatchModel.Name = core.StringPtr("my-load-balancer-listener-policy-updated")
				loadBalancerListenerPolicyPatchModel.Priority = core.Int64Ptr(int64(5))
				loadBalancerListenerPolicyPatchModel.Target = loadBalancerListenerPolicyTargetPatchModel
				loadBalancerListenerPolicyPatchModelAsPatch, asPatchErr := loadBalancerListenerPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerPolicyOptions model
				updateLoadBalancerListenerPolicyOptionsModel := new(vpcv1.UpdateLoadBalancerListenerPolicyOptions)
				updateLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.LoadBalancerListenerPolicyPatch = loadBalancerListenerPolicyPatchModelAsPatch
				updateLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateLoadBalancerListenerPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPatchModel := new(vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerPolicyPatch model
				loadBalancerListenerPolicyPatchModel := new(vpcv1.LoadBalancerListenerPolicyPatch)
				loadBalancerListenerPolicyPatchModel.Name = core.StringPtr("my-load-balancer-listener-policy-updated")
				loadBalancerListenerPolicyPatchModel.Priority = core.Int64Ptr(int64(5))
				loadBalancerListenerPolicyPatchModel.Target = loadBalancerListenerPolicyTargetPatchModel
				loadBalancerListenerPolicyPatchModelAsPatch, asPatchErr := loadBalancerListenerPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerPolicyOptions model
				updateLoadBalancerListenerPolicyOptionsModel := new(vpcv1.UpdateLoadBalancerListenerPolicyOptions)
				updateLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.LoadBalancerListenerPolicyPatch = loadBalancerListenerPolicyPatchModelAsPatch
				updateLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateLoadBalancerListenerPolicyOptions model with no property values
				updateLoadBalancerListenerPolicyOptionsModelNew := new(vpcv1.UpdateLoadBalancerListenerPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateLoadBalancerListenerPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPatchModel := new(vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerListenerPolicyTargetPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerListenerPolicyPatch model
				loadBalancerListenerPolicyPatchModel := new(vpcv1.LoadBalancerListenerPolicyPatch)
				loadBalancerListenerPolicyPatchModel.Name = core.StringPtr("my-load-balancer-listener-policy-updated")
				loadBalancerListenerPolicyPatchModel.Priority = core.Int64Ptr(int64(5))
				loadBalancerListenerPolicyPatchModel.Target = loadBalancerListenerPolicyTargetPatchModel
				loadBalancerListenerPolicyPatchModelAsPatch, asPatchErr := loadBalancerListenerPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerPolicyOptions model
				updateLoadBalancerListenerPolicyOptionsModel := new(vpcv1.UpdateLoadBalancerListenerPolicyOptions)
				updateLoadBalancerListenerPolicyOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.ListenerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyOptionsModel.LoadBalancerListenerPolicyPatch = loadBalancerListenerPolicyPatchModelAsPatch
				updateLoadBalancerListenerPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptions *ListLoadBalancerListenerPolicyRulesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listLoadBalancerListenerPolicyRulesPath := "/load_balancers/testString/listeners/testString/policies/testString/rules"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerListenerPolicyRulesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListLoadBalancerListenerPolicyRules with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerListenerPolicyRulesOptions model
				listLoadBalancerListenerPolicyRulesOptionsModel := new(vpcv1.ListLoadBalancerListenerPolicyRulesOptions)
				listLoadBalancerListenerPolicyRulesOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.ListenerID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.PolicyID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptions *ListLoadBalancerListenerPolicyRulesOptions)`, func() {
		version := "2024-06-23"
		listLoadBalancerListenerPolicyRulesPath := "/load_balancers/testString/listeners/testString/policies/testString/rules"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerListenerPolicyRulesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"rules": [{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "provisioning_status": "active", "type": "body", "value": "Value"}]}`)
				}))
			})
			It(`Invoke ListLoadBalancerListenerPolicyRules successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListLoadBalancerListenerPolicyRulesOptions model
				listLoadBalancerListenerPolicyRulesOptionsModel := new(vpcv1.ListLoadBalancerListenerPolicyRulesOptions)
				listLoadBalancerListenerPolicyRulesOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.ListenerID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.PolicyID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListLoadBalancerListenerPolicyRulesWithContext(ctx, listLoadBalancerListenerPolicyRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListLoadBalancerListenerPolicyRulesWithContext(ctx, listLoadBalancerListenerPolicyRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerListenerPolicyRulesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"rules": [{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "provisioning_status": "active", "type": "body", "value": "Value"}]}`)
				}))
			})
			It(`Invoke ListLoadBalancerListenerPolicyRules successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListLoadBalancerListenerPolicyRules(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListLoadBalancerListenerPolicyRulesOptions model
				listLoadBalancerListenerPolicyRulesOptionsModel := new(vpcv1.ListLoadBalancerListenerPolicyRulesOptions)
				listLoadBalancerListenerPolicyRulesOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.ListenerID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.PolicyID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListLoadBalancerListenerPolicyRules with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerListenerPolicyRulesOptions model
				listLoadBalancerListenerPolicyRulesOptionsModel := new(vpcv1.ListLoadBalancerListenerPolicyRulesOptions)
				listLoadBalancerListenerPolicyRulesOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.ListenerID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.PolicyID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListLoadBalancerListenerPolicyRulesOptions model with no property values
				listLoadBalancerListenerPolicyRulesOptionsModelNew := new(vpcv1.ListLoadBalancerListenerPolicyRulesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListLoadBalancerListenerPolicyRules successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerListenerPolicyRulesOptions model
				listLoadBalancerListenerPolicyRulesOptionsModel := new(vpcv1.ListLoadBalancerListenerPolicyRulesOptions)
				listLoadBalancerListenerPolicyRulesOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.ListenerID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.PolicyID = core.StringPtr("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptions *CreateLoadBalancerListenerPolicyRuleOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createLoadBalancerListenerPolicyRulePath := "/load_balancers/testString/listeners/testString/policies/testString/rules"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerListenerPolicyRulePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateLoadBalancerListenerPolicyRule with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateLoadBalancerListenerPolicyRuleOptions model
				createLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.CreateLoadBalancerListenerPolicyRuleOptions)
				createLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.Condition = core.StringPtr("contains")
				createLoadBalancerListenerPolicyRuleOptionsModel.Type = core.StringPtr("body")
				createLoadBalancerListenerPolicyRuleOptionsModel.Value = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.Field = core.StringPtr("MY-APP-HEADER")
				createLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptions *CreateLoadBalancerListenerPolicyRuleOptions)`, func() {
		version := "2024-06-23"
		createLoadBalancerListenerPolicyRulePath := "/load_balancers/testString/listeners/testString/policies/testString/rules"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerListenerPolicyRulePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "provisioning_status": "active", "type": "body", "value": "Value"}`)
				}))
			})
			It(`Invoke CreateLoadBalancerListenerPolicyRule successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the CreateLoadBalancerListenerPolicyRuleOptions model
				createLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.CreateLoadBalancerListenerPolicyRuleOptions)
				createLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.Condition = core.StringPtr("contains")
				createLoadBalancerListenerPolicyRuleOptionsModel.Type = core.StringPtr("body")
				createLoadBalancerListenerPolicyRuleOptionsModel.Value = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.Field = core.StringPtr("MY-APP-HEADER")
				createLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateLoadBalancerListenerPolicyRuleWithContext(ctx, createLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateLoadBalancerListenerPolicyRuleWithContext(ctx, createLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerListenerPolicyRulePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "provisioning_status": "active", "type": "body", "value": "Value"}`)
				}))
			})
			It(`Invoke CreateLoadBalancerListenerPolicyRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateLoadBalancerListenerPolicyRule(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the CreateLoadBalancerListenerPolicyRuleOptions model
				createLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.CreateLoadBalancerListenerPolicyRuleOptions)
				createLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.Condition = core.StringPtr("contains")
				createLoadBalancerListenerPolicyRuleOptionsModel.Type = core.StringPtr("body")
				createLoadBalancerListenerPolicyRuleOptionsModel.Value = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.Field = core.StringPtr("MY-APP-HEADER")
				createLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateLoadBalancerListenerPolicyRule with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateLoadBalancerListenerPolicyRuleOptions model
				createLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.CreateLoadBalancerListenerPolicyRuleOptions)
				createLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.Condition = core.StringPtr("contains")
				createLoadBalancerListenerPolicyRuleOptionsModel.Type = core.StringPtr("body")
				createLoadBalancerListenerPolicyRuleOptionsModel.Value = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.Field = core.StringPtr("MY-APP-HEADER")
				createLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateLoadBalancerListenerPolicyRuleOptions model with no property values
				createLoadBalancerListenerPolicyRuleOptionsModelNew := new(vpcv1.CreateLoadBalancerListenerPolicyRuleOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateLoadBalancerListenerPolicyRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateLoadBalancerListenerPolicyRuleOptions model
				createLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.CreateLoadBalancerListenerPolicyRuleOptions)
				createLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.Condition = core.StringPtr("contains")
				createLoadBalancerListenerPolicyRuleOptionsModel.Type = core.StringPtr("body")
				createLoadBalancerListenerPolicyRuleOptionsModel.Value = core.StringPtr("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.Field = core.StringPtr("MY-APP-HEADER")
				createLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteLoadBalancerListenerPolicyRule(deleteLoadBalancerListenerPolicyRuleOptions *DeleteLoadBalancerListenerPolicyRuleOptions)`, func() {
		version := "2024-06-23"
		deleteLoadBalancerListenerPolicyRulePath := "/load_balancers/testString/listeners/testString/policies/testString/rules/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteLoadBalancerListenerPolicyRulePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteLoadBalancerListenerPolicyRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteLoadBalancerListenerPolicyRule(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteLoadBalancerListenerPolicyRuleOptions model
				deleteLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.DeleteLoadBalancerListenerPolicyRuleOptions)
				deleteLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				deleteLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				deleteLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				deleteLoadBalancerListenerPolicyRuleOptionsModel.ID = core.StringPtr("testString")
				deleteLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteLoadBalancerListenerPolicyRule(deleteLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteLoadBalancerListenerPolicyRule with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteLoadBalancerListenerPolicyRuleOptions model
				deleteLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.DeleteLoadBalancerListenerPolicyRuleOptions)
				deleteLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				deleteLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				deleteLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				deleteLoadBalancerListenerPolicyRuleOptionsModel.ID = core.StringPtr("testString")
				deleteLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteLoadBalancerListenerPolicyRule(deleteLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteLoadBalancerListenerPolicyRuleOptions model with no property values
				deleteLoadBalancerListenerPolicyRuleOptionsModelNew := new(vpcv1.DeleteLoadBalancerListenerPolicyRuleOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteLoadBalancerListenerPolicyRule(deleteLoadBalancerListenerPolicyRuleOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptions *GetLoadBalancerListenerPolicyRuleOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getLoadBalancerListenerPolicyRulePath := "/load_balancers/testString/listeners/testString/policies/testString/rules/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerListenerPolicyRulePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetLoadBalancerListenerPolicyRule with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerListenerPolicyRuleOptions model
				getLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.GetLoadBalancerListenerPolicyRuleOptions)
				getLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptions *GetLoadBalancerListenerPolicyRuleOptions)`, func() {
		version := "2024-06-23"
		getLoadBalancerListenerPolicyRulePath := "/load_balancers/testString/listeners/testString/policies/testString/rules/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerListenerPolicyRulePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "provisioning_status": "active", "type": "body", "value": "Value"}`)
				}))
			})
			It(`Invoke GetLoadBalancerListenerPolicyRule successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetLoadBalancerListenerPolicyRuleOptions model
				getLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.GetLoadBalancerListenerPolicyRuleOptions)
				getLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetLoadBalancerListenerPolicyRuleWithContext(ctx, getLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetLoadBalancerListenerPolicyRuleWithContext(ctx, getLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerListenerPolicyRulePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "provisioning_status": "active", "type": "body", "value": "Value"}`)
				}))
			})
			It(`Invoke GetLoadBalancerListenerPolicyRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetLoadBalancerListenerPolicyRule(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetLoadBalancerListenerPolicyRuleOptions model
				getLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.GetLoadBalancerListenerPolicyRuleOptions)
				getLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetLoadBalancerListenerPolicyRule with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerListenerPolicyRuleOptions model
				getLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.GetLoadBalancerListenerPolicyRuleOptions)
				getLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetLoadBalancerListenerPolicyRuleOptions model with no property values
				getLoadBalancerListenerPolicyRuleOptionsModelNew := new(vpcv1.GetLoadBalancerListenerPolicyRuleOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetLoadBalancerListenerPolicyRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerListenerPolicyRuleOptions model
				getLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.GetLoadBalancerListenerPolicyRuleOptions)
				getLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptions *UpdateLoadBalancerListenerPolicyRuleOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateLoadBalancerListenerPolicyRulePath := "/load_balancers/testString/listeners/testString/policies/testString/rules/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerListenerPolicyRulePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateLoadBalancerListenerPolicyRule with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerListenerPolicyRulePatch model
				loadBalancerListenerPolicyRulePatchModel := new(vpcv1.LoadBalancerListenerPolicyRulePatch)
				loadBalancerListenerPolicyRulePatchModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePatchModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePatchModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePatchModel.Value = core.StringPtr("my-example-hostname-updated")
				loadBalancerListenerPolicyRulePatchModelAsPatch, asPatchErr := loadBalancerListenerPolicyRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerPolicyRuleOptions model
				updateLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.UpdateLoadBalancerListenerPolicyRuleOptions)
				updateLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerListenerPolicyRulePatch = loadBalancerListenerPolicyRulePatchModelAsPatch
				updateLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptions *UpdateLoadBalancerListenerPolicyRuleOptions)`, func() {
		version := "2024-06-23"
		updateLoadBalancerListenerPolicyRulePath := "/load_balancers/testString/listeners/testString/policies/testString/rules/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerListenerPolicyRulePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "provisioning_status": "active", "type": "body", "value": "Value"}`)
				}))
			})
			It(`Invoke UpdateLoadBalancerListenerPolicyRule successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the LoadBalancerListenerPolicyRulePatch model
				loadBalancerListenerPolicyRulePatchModel := new(vpcv1.LoadBalancerListenerPolicyRulePatch)
				loadBalancerListenerPolicyRulePatchModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePatchModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePatchModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePatchModel.Value = core.StringPtr("my-example-hostname-updated")
				loadBalancerListenerPolicyRulePatchModelAsPatch, asPatchErr := loadBalancerListenerPolicyRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerPolicyRuleOptions model
				updateLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.UpdateLoadBalancerListenerPolicyRuleOptions)
				updateLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerListenerPolicyRulePatch = loadBalancerListenerPolicyRulePatchModelAsPatch
				updateLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateLoadBalancerListenerPolicyRuleWithContext(ctx, updateLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateLoadBalancerListenerPolicyRuleWithContext(ctx, updateLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerListenerPolicyRulePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "id": "r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b", "provisioning_status": "active", "type": "body", "value": "Value"}`)
				}))
			})
			It(`Invoke UpdateLoadBalancerListenerPolicyRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateLoadBalancerListenerPolicyRule(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the LoadBalancerListenerPolicyRulePatch model
				loadBalancerListenerPolicyRulePatchModel := new(vpcv1.LoadBalancerListenerPolicyRulePatch)
				loadBalancerListenerPolicyRulePatchModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePatchModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePatchModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePatchModel.Value = core.StringPtr("my-example-hostname-updated")
				loadBalancerListenerPolicyRulePatchModelAsPatch, asPatchErr := loadBalancerListenerPolicyRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerPolicyRuleOptions model
				updateLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.UpdateLoadBalancerListenerPolicyRuleOptions)
				updateLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerListenerPolicyRulePatch = loadBalancerListenerPolicyRulePatchModelAsPatch
				updateLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateLoadBalancerListenerPolicyRule with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerListenerPolicyRulePatch model
				loadBalancerListenerPolicyRulePatchModel := new(vpcv1.LoadBalancerListenerPolicyRulePatch)
				loadBalancerListenerPolicyRulePatchModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePatchModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePatchModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePatchModel.Value = core.StringPtr("my-example-hostname-updated")
				loadBalancerListenerPolicyRulePatchModelAsPatch, asPatchErr := loadBalancerListenerPolicyRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerPolicyRuleOptions model
				updateLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.UpdateLoadBalancerListenerPolicyRuleOptions)
				updateLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerListenerPolicyRulePatch = loadBalancerListenerPolicyRulePatchModelAsPatch
				updateLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateLoadBalancerListenerPolicyRuleOptions model with no property values
				updateLoadBalancerListenerPolicyRuleOptionsModelNew := new(vpcv1.UpdateLoadBalancerListenerPolicyRuleOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateLoadBalancerListenerPolicyRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerListenerPolicyRulePatch model
				loadBalancerListenerPolicyRulePatchModel := new(vpcv1.LoadBalancerListenerPolicyRulePatch)
				loadBalancerListenerPolicyRulePatchModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePatchModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePatchModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePatchModel.Value = core.StringPtr("my-example-hostname-updated")
				loadBalancerListenerPolicyRulePatchModelAsPatch, asPatchErr := loadBalancerListenerPolicyRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerListenerPolicyRuleOptions model
				updateLoadBalancerListenerPolicyRuleOptionsModel := new(vpcv1.UpdateLoadBalancerListenerPolicyRuleOptions)
				updateLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.ListenerID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.PolicyID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerListenerPolicyRulePatch = loadBalancerListenerPolicyRulePatchModelAsPatch
				updateLoadBalancerListenerPolicyRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListLoadBalancerPools(listLoadBalancerPoolsOptions *ListLoadBalancerPoolsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listLoadBalancerPoolsPath := "/load_balancers/testString/pools"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerPoolsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListLoadBalancerPools with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerPoolsOptions model
				listLoadBalancerPoolsOptionsModel := new(vpcv1.ListLoadBalancerPoolsOptions)
				listLoadBalancerPoolsOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerPoolsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListLoadBalancerPools(listLoadBalancerPoolsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListLoadBalancerPools(listLoadBalancerPoolsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListLoadBalancerPools(listLoadBalancerPoolsOptions *ListLoadBalancerPoolsOptions)`, func() {
		version := "2024-06-23"
		listLoadBalancerPoolsPath := "/load_balancers/testString/pools"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerPoolsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"pools": [{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "failsafe_policy": {"action": "forward", "healthy_member_threshold_count": 0, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}, "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "tcp"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}]}`)
				}))
			})
			It(`Invoke ListLoadBalancerPools successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListLoadBalancerPoolsOptions model
				listLoadBalancerPoolsOptionsModel := new(vpcv1.ListLoadBalancerPoolsOptions)
				listLoadBalancerPoolsOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerPoolsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListLoadBalancerPoolsWithContext(ctx, listLoadBalancerPoolsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListLoadBalancerPools(listLoadBalancerPoolsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListLoadBalancerPoolsWithContext(ctx, listLoadBalancerPoolsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerPoolsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"pools": [{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "failsafe_policy": {"action": "forward", "healthy_member_threshold_count": 0, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}, "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "tcp"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}]}`)
				}))
			})
			It(`Invoke ListLoadBalancerPools successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListLoadBalancerPools(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListLoadBalancerPoolsOptions model
				listLoadBalancerPoolsOptionsModel := new(vpcv1.ListLoadBalancerPoolsOptions)
				listLoadBalancerPoolsOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerPoolsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListLoadBalancerPools(listLoadBalancerPoolsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListLoadBalancerPools with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerPoolsOptions model
				listLoadBalancerPoolsOptionsModel := new(vpcv1.ListLoadBalancerPoolsOptions)
				listLoadBalancerPoolsOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerPoolsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListLoadBalancerPools(listLoadBalancerPoolsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListLoadBalancerPoolsOptions model with no property values
				listLoadBalancerPoolsOptionsModelNew := new(vpcv1.ListLoadBalancerPoolsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListLoadBalancerPools(listLoadBalancerPoolsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListLoadBalancerPools successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerPoolsOptions model
				listLoadBalancerPoolsOptionsModel := new(vpcv1.ListLoadBalancerPoolsOptions)
				listLoadBalancerPoolsOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerPoolsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListLoadBalancerPools(listLoadBalancerPoolsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateLoadBalancerPool(createLoadBalancerPoolOptions *CreateLoadBalancerPoolOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createLoadBalancerPoolPath := "/load_balancers/testString/pools"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerPoolPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateLoadBalancerPool with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model
				loadBalancerPoolHealthMonitorPrototypeModel := new(vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype)
				loadBalancerPoolHealthMonitorPrototypeModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPrototypeModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPrototypeModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Type = core.StringPtr("tcp")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerPoolFailsafePolicyPrototype model
				loadBalancerPoolFailsafePolicyPrototypeModel := new(vpcv1.LoadBalancerPoolFailsafePolicyPrototype)
				loadBalancerPoolFailsafePolicyPrototypeModel.Action = core.StringPtr("forward")
				loadBalancerPoolFailsafePolicyPrototypeModel.Target = loadBalancerPoolIdentityModel

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model
				loadBalancerPoolSessionPersistencePrototypeModel := new(vpcv1.LoadBalancerPoolSessionPersistencePrototype)
				loadBalancerPoolSessionPersistencePrototypeModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePrototypeModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the CreateLoadBalancerPoolOptions model
				createLoadBalancerPoolOptionsModel := new(vpcv1.CreateLoadBalancerPoolOptions)
				createLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerPoolOptionsModel.Algorithm = core.StringPtr("least_connections")
				createLoadBalancerPoolOptionsModel.HealthMonitor = loadBalancerPoolHealthMonitorPrototypeModel
				createLoadBalancerPoolOptionsModel.Protocol = core.StringPtr("http")
				createLoadBalancerPoolOptionsModel.FailsafePolicy = loadBalancerPoolFailsafePolicyPrototypeModel
				createLoadBalancerPoolOptionsModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				createLoadBalancerPoolOptionsModel.Name = core.StringPtr("my-load-balancer-pool")
				createLoadBalancerPoolOptionsModel.ProxyProtocol = core.StringPtr("disabled")
				createLoadBalancerPoolOptionsModel.SessionPersistence = loadBalancerPoolSessionPersistencePrototypeModel
				createLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateLoadBalancerPool(createLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateLoadBalancerPool(createLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateLoadBalancerPool(createLoadBalancerPoolOptions *CreateLoadBalancerPoolOptions)`, func() {
		version := "2024-06-23"
		createLoadBalancerPoolPath := "/load_balancers/testString/pools"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerPoolPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "failsafe_policy": {"action": "forward", "healthy_member_threshold_count": 0, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}, "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "tcp"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}`)
				}))
			})
			It(`Invoke CreateLoadBalancerPool successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model
				loadBalancerPoolHealthMonitorPrototypeModel := new(vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype)
				loadBalancerPoolHealthMonitorPrototypeModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPrototypeModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPrototypeModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Type = core.StringPtr("tcp")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerPoolFailsafePolicyPrototype model
				loadBalancerPoolFailsafePolicyPrototypeModel := new(vpcv1.LoadBalancerPoolFailsafePolicyPrototype)
				loadBalancerPoolFailsafePolicyPrototypeModel.Action = core.StringPtr("forward")
				loadBalancerPoolFailsafePolicyPrototypeModel.Target = loadBalancerPoolIdentityModel

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model
				loadBalancerPoolSessionPersistencePrototypeModel := new(vpcv1.LoadBalancerPoolSessionPersistencePrototype)
				loadBalancerPoolSessionPersistencePrototypeModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePrototypeModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the CreateLoadBalancerPoolOptions model
				createLoadBalancerPoolOptionsModel := new(vpcv1.CreateLoadBalancerPoolOptions)
				createLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerPoolOptionsModel.Algorithm = core.StringPtr("least_connections")
				createLoadBalancerPoolOptionsModel.HealthMonitor = loadBalancerPoolHealthMonitorPrototypeModel
				createLoadBalancerPoolOptionsModel.Protocol = core.StringPtr("http")
				createLoadBalancerPoolOptionsModel.FailsafePolicy = loadBalancerPoolFailsafePolicyPrototypeModel
				createLoadBalancerPoolOptionsModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				createLoadBalancerPoolOptionsModel.Name = core.StringPtr("my-load-balancer-pool")
				createLoadBalancerPoolOptionsModel.ProxyProtocol = core.StringPtr("disabled")
				createLoadBalancerPoolOptionsModel.SessionPersistence = loadBalancerPoolSessionPersistencePrototypeModel
				createLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateLoadBalancerPoolWithContext(ctx, createLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateLoadBalancerPool(createLoadBalancerPoolOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateLoadBalancerPoolWithContext(ctx, createLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerPoolPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "failsafe_policy": {"action": "forward", "healthy_member_threshold_count": 0, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}, "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "tcp"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}`)
				}))
			})
			It(`Invoke CreateLoadBalancerPool successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateLoadBalancerPool(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model
				loadBalancerPoolHealthMonitorPrototypeModel := new(vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype)
				loadBalancerPoolHealthMonitorPrototypeModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPrototypeModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPrototypeModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Type = core.StringPtr("tcp")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerPoolFailsafePolicyPrototype model
				loadBalancerPoolFailsafePolicyPrototypeModel := new(vpcv1.LoadBalancerPoolFailsafePolicyPrototype)
				loadBalancerPoolFailsafePolicyPrototypeModel.Action = core.StringPtr("forward")
				loadBalancerPoolFailsafePolicyPrototypeModel.Target = loadBalancerPoolIdentityModel

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model
				loadBalancerPoolSessionPersistencePrototypeModel := new(vpcv1.LoadBalancerPoolSessionPersistencePrototype)
				loadBalancerPoolSessionPersistencePrototypeModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePrototypeModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the CreateLoadBalancerPoolOptions model
				createLoadBalancerPoolOptionsModel := new(vpcv1.CreateLoadBalancerPoolOptions)
				createLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerPoolOptionsModel.Algorithm = core.StringPtr("least_connections")
				createLoadBalancerPoolOptionsModel.HealthMonitor = loadBalancerPoolHealthMonitorPrototypeModel
				createLoadBalancerPoolOptionsModel.Protocol = core.StringPtr("http")
				createLoadBalancerPoolOptionsModel.FailsafePolicy = loadBalancerPoolFailsafePolicyPrototypeModel
				createLoadBalancerPoolOptionsModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				createLoadBalancerPoolOptionsModel.Name = core.StringPtr("my-load-balancer-pool")
				createLoadBalancerPoolOptionsModel.ProxyProtocol = core.StringPtr("disabled")
				createLoadBalancerPoolOptionsModel.SessionPersistence = loadBalancerPoolSessionPersistencePrototypeModel
				createLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateLoadBalancerPool(createLoadBalancerPoolOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateLoadBalancerPool with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model
				loadBalancerPoolHealthMonitorPrototypeModel := new(vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype)
				loadBalancerPoolHealthMonitorPrototypeModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPrototypeModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPrototypeModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Type = core.StringPtr("tcp")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerPoolFailsafePolicyPrototype model
				loadBalancerPoolFailsafePolicyPrototypeModel := new(vpcv1.LoadBalancerPoolFailsafePolicyPrototype)
				loadBalancerPoolFailsafePolicyPrototypeModel.Action = core.StringPtr("forward")
				loadBalancerPoolFailsafePolicyPrototypeModel.Target = loadBalancerPoolIdentityModel

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model
				loadBalancerPoolSessionPersistencePrototypeModel := new(vpcv1.LoadBalancerPoolSessionPersistencePrototype)
				loadBalancerPoolSessionPersistencePrototypeModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePrototypeModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the CreateLoadBalancerPoolOptions model
				createLoadBalancerPoolOptionsModel := new(vpcv1.CreateLoadBalancerPoolOptions)
				createLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerPoolOptionsModel.Algorithm = core.StringPtr("least_connections")
				createLoadBalancerPoolOptionsModel.HealthMonitor = loadBalancerPoolHealthMonitorPrototypeModel
				createLoadBalancerPoolOptionsModel.Protocol = core.StringPtr("http")
				createLoadBalancerPoolOptionsModel.FailsafePolicy = loadBalancerPoolFailsafePolicyPrototypeModel
				createLoadBalancerPoolOptionsModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				createLoadBalancerPoolOptionsModel.Name = core.StringPtr("my-load-balancer-pool")
				createLoadBalancerPoolOptionsModel.ProxyProtocol = core.StringPtr("disabled")
				createLoadBalancerPoolOptionsModel.SessionPersistence = loadBalancerPoolSessionPersistencePrototypeModel
				createLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateLoadBalancerPool(createLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateLoadBalancerPoolOptions model with no property values
				createLoadBalancerPoolOptionsModelNew := new(vpcv1.CreateLoadBalancerPoolOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateLoadBalancerPool(createLoadBalancerPoolOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateLoadBalancerPool successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model
				loadBalancerPoolHealthMonitorPrototypeModel := new(vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype)
				loadBalancerPoolHealthMonitorPrototypeModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPrototypeModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPrototypeModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Type = core.StringPtr("tcp")

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerPoolFailsafePolicyPrototype model
				loadBalancerPoolFailsafePolicyPrototypeModel := new(vpcv1.LoadBalancerPoolFailsafePolicyPrototype)
				loadBalancerPoolFailsafePolicyPrototypeModel.Action = core.StringPtr("forward")
				loadBalancerPoolFailsafePolicyPrototypeModel.Target = loadBalancerPoolIdentityModel

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model
				loadBalancerPoolSessionPersistencePrototypeModel := new(vpcv1.LoadBalancerPoolSessionPersistencePrototype)
				loadBalancerPoolSessionPersistencePrototypeModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePrototypeModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the CreateLoadBalancerPoolOptions model
				createLoadBalancerPoolOptionsModel := new(vpcv1.CreateLoadBalancerPoolOptions)
				createLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerPoolOptionsModel.Algorithm = core.StringPtr("least_connections")
				createLoadBalancerPoolOptionsModel.HealthMonitor = loadBalancerPoolHealthMonitorPrototypeModel
				createLoadBalancerPoolOptionsModel.Protocol = core.StringPtr("http")
				createLoadBalancerPoolOptionsModel.FailsafePolicy = loadBalancerPoolFailsafePolicyPrototypeModel
				createLoadBalancerPoolOptionsModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				createLoadBalancerPoolOptionsModel.Name = core.StringPtr("my-load-balancer-pool")
				createLoadBalancerPoolOptionsModel.ProxyProtocol = core.StringPtr("disabled")
				createLoadBalancerPoolOptionsModel.SessionPersistence = loadBalancerPoolSessionPersistencePrototypeModel
				createLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateLoadBalancerPool(createLoadBalancerPoolOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteLoadBalancerPool(deleteLoadBalancerPoolOptions *DeleteLoadBalancerPoolOptions)`, func() {
		version := "2024-06-23"
		deleteLoadBalancerPoolPath := "/load_balancers/testString/pools/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteLoadBalancerPoolPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteLoadBalancerPool successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteLoadBalancerPool(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteLoadBalancerPoolOptions model
				deleteLoadBalancerPoolOptionsModel := new(vpcv1.DeleteLoadBalancerPoolOptions)
				deleteLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				deleteLoadBalancerPoolOptionsModel.ID = core.StringPtr("testString")
				deleteLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteLoadBalancerPool(deleteLoadBalancerPoolOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteLoadBalancerPool with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteLoadBalancerPoolOptions model
				deleteLoadBalancerPoolOptionsModel := new(vpcv1.DeleteLoadBalancerPoolOptions)
				deleteLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				deleteLoadBalancerPoolOptionsModel.ID = core.StringPtr("testString")
				deleteLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteLoadBalancerPool(deleteLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteLoadBalancerPoolOptions model with no property values
				deleteLoadBalancerPoolOptionsModelNew := new(vpcv1.DeleteLoadBalancerPoolOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteLoadBalancerPool(deleteLoadBalancerPoolOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancerPool(getLoadBalancerPoolOptions *GetLoadBalancerPoolOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getLoadBalancerPoolPath := "/load_balancers/testString/pools/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerPoolPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetLoadBalancerPool with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerPoolOptions model
				getLoadBalancerPoolOptionsModel := new(vpcv1.GetLoadBalancerPoolOptions)
				getLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerPoolOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetLoadBalancerPool(getLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetLoadBalancerPool(getLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancerPool(getLoadBalancerPoolOptions *GetLoadBalancerPoolOptions)`, func() {
		version := "2024-06-23"
		getLoadBalancerPoolPath := "/load_balancers/testString/pools/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerPoolPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "failsafe_policy": {"action": "forward", "healthy_member_threshold_count": 0, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}, "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "tcp"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}`)
				}))
			})
			It(`Invoke GetLoadBalancerPool successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetLoadBalancerPoolOptions model
				getLoadBalancerPoolOptionsModel := new(vpcv1.GetLoadBalancerPoolOptions)
				getLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerPoolOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetLoadBalancerPoolWithContext(ctx, getLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetLoadBalancerPool(getLoadBalancerPoolOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetLoadBalancerPoolWithContext(ctx, getLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerPoolPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "failsafe_policy": {"action": "forward", "healthy_member_threshold_count": 0, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}, "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "tcp"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}`)
				}))
			})
			It(`Invoke GetLoadBalancerPool successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetLoadBalancerPool(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetLoadBalancerPoolOptions model
				getLoadBalancerPoolOptionsModel := new(vpcv1.GetLoadBalancerPoolOptions)
				getLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerPoolOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetLoadBalancerPool(getLoadBalancerPoolOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetLoadBalancerPool with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerPoolOptions model
				getLoadBalancerPoolOptionsModel := new(vpcv1.GetLoadBalancerPoolOptions)
				getLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerPoolOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetLoadBalancerPool(getLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetLoadBalancerPoolOptions model with no property values
				getLoadBalancerPoolOptionsModelNew := new(vpcv1.GetLoadBalancerPoolOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetLoadBalancerPool(getLoadBalancerPoolOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetLoadBalancerPool successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerPoolOptions model
				getLoadBalancerPoolOptionsModel := new(vpcv1.GetLoadBalancerPoolOptions)
				getLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerPoolOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetLoadBalancerPool(getLoadBalancerPoolOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateLoadBalancerPool(updateLoadBalancerPoolOptions *UpdateLoadBalancerPoolOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateLoadBalancerPoolPath := "/load_balancers/testString/pools/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerPoolPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateLoadBalancerPool with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID model
				loadBalancerPoolFailsafePolicyTargetPatchModel := new(vpcv1.LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID)
				loadBalancerPoolFailsafePolicyTargetPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerPoolFailsafePolicyPatch model
				loadBalancerPoolFailsafePolicyPatchModel := new(vpcv1.LoadBalancerPoolFailsafePolicyPatch)
				loadBalancerPoolFailsafePolicyPatchModel.Action = core.StringPtr("forward")
				loadBalancerPoolFailsafePolicyPatchModel.Target = loadBalancerPoolFailsafePolicyTargetPatchModel

				// Construct an instance of the LoadBalancerPoolHealthMonitorPatch model
				loadBalancerPoolHealthMonitorPatchModel := new(vpcv1.LoadBalancerPoolHealthMonitorPatch)
				loadBalancerPoolHealthMonitorPatchModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPatchModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPatchModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPatchModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPatchModel.Type = core.StringPtr("http")
				loadBalancerPoolHealthMonitorPatchModel.URLPath = core.StringPtr("/")

				// Construct an instance of the LoadBalancerPoolSessionPersistencePatch model
				loadBalancerPoolSessionPersistencePatchModel := new(vpcv1.LoadBalancerPoolSessionPersistencePatch)
				loadBalancerPoolSessionPersistencePatchModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePatchModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the LoadBalancerPoolPatch model
				loadBalancerPoolPatchModel := new(vpcv1.LoadBalancerPoolPatch)
				loadBalancerPoolPatchModel.Algorithm = core.StringPtr("weighted_round_robin")
				loadBalancerPoolPatchModel.FailsafePolicy = loadBalancerPoolFailsafePolicyPatchModel
				loadBalancerPoolPatchModel.HealthMonitor = loadBalancerPoolHealthMonitorPatchModel
				loadBalancerPoolPatchModel.Name = core.StringPtr("my-load-balancer-pool")
				loadBalancerPoolPatchModel.Protocol = core.StringPtr("http")
				loadBalancerPoolPatchModel.ProxyProtocol = core.StringPtr("disabled")
				loadBalancerPoolPatchModel.SessionPersistence = loadBalancerPoolSessionPersistencePatchModel
				loadBalancerPoolPatchModelAsPatch, asPatchErr := loadBalancerPoolPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerPoolOptions model
				updateLoadBalancerPoolOptionsModel := new(vpcv1.UpdateLoadBalancerPoolOptions)
				updateLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerPoolOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerPoolOptionsModel.LoadBalancerPoolPatch = loadBalancerPoolPatchModelAsPatch
				updateLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateLoadBalancerPool(updateLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateLoadBalancerPool(updateLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateLoadBalancerPool(updateLoadBalancerPoolOptions *UpdateLoadBalancerPoolOptions)`, func() {
		version := "2024-06-23"
		updateLoadBalancerPoolPath := "/load_balancers/testString/pools/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerPoolPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "failsafe_policy": {"action": "forward", "healthy_member_threshold_count": 0, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}, "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "tcp"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}`)
				}))
			})
			It(`Invoke UpdateLoadBalancerPool successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID model
				loadBalancerPoolFailsafePolicyTargetPatchModel := new(vpcv1.LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID)
				loadBalancerPoolFailsafePolicyTargetPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerPoolFailsafePolicyPatch model
				loadBalancerPoolFailsafePolicyPatchModel := new(vpcv1.LoadBalancerPoolFailsafePolicyPatch)
				loadBalancerPoolFailsafePolicyPatchModel.Action = core.StringPtr("forward")
				loadBalancerPoolFailsafePolicyPatchModel.Target = loadBalancerPoolFailsafePolicyTargetPatchModel

				// Construct an instance of the LoadBalancerPoolHealthMonitorPatch model
				loadBalancerPoolHealthMonitorPatchModel := new(vpcv1.LoadBalancerPoolHealthMonitorPatch)
				loadBalancerPoolHealthMonitorPatchModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPatchModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPatchModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPatchModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPatchModel.Type = core.StringPtr("http")
				loadBalancerPoolHealthMonitorPatchModel.URLPath = core.StringPtr("/")

				// Construct an instance of the LoadBalancerPoolSessionPersistencePatch model
				loadBalancerPoolSessionPersistencePatchModel := new(vpcv1.LoadBalancerPoolSessionPersistencePatch)
				loadBalancerPoolSessionPersistencePatchModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePatchModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the LoadBalancerPoolPatch model
				loadBalancerPoolPatchModel := new(vpcv1.LoadBalancerPoolPatch)
				loadBalancerPoolPatchModel.Algorithm = core.StringPtr("weighted_round_robin")
				loadBalancerPoolPatchModel.FailsafePolicy = loadBalancerPoolFailsafePolicyPatchModel
				loadBalancerPoolPatchModel.HealthMonitor = loadBalancerPoolHealthMonitorPatchModel
				loadBalancerPoolPatchModel.Name = core.StringPtr("my-load-balancer-pool")
				loadBalancerPoolPatchModel.Protocol = core.StringPtr("http")
				loadBalancerPoolPatchModel.ProxyProtocol = core.StringPtr("disabled")
				loadBalancerPoolPatchModel.SessionPersistence = loadBalancerPoolSessionPersistencePatchModel
				loadBalancerPoolPatchModelAsPatch, asPatchErr := loadBalancerPoolPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerPoolOptions model
				updateLoadBalancerPoolOptionsModel := new(vpcv1.UpdateLoadBalancerPoolOptions)
				updateLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerPoolOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerPoolOptionsModel.LoadBalancerPoolPatch = loadBalancerPoolPatchModelAsPatch
				updateLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateLoadBalancerPoolWithContext(ctx, updateLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateLoadBalancerPool(updateLoadBalancerPoolOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateLoadBalancerPoolWithContext(ctx, updateLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerPoolPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "failsafe_policy": {"action": "forward", "healthy_member_threshold_count": 0, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}, "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "tcp"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004", "id": "r006-70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "id": "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}`)
				}))
			})
			It(`Invoke UpdateLoadBalancerPool successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateLoadBalancerPool(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID model
				loadBalancerPoolFailsafePolicyTargetPatchModel := new(vpcv1.LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID)
				loadBalancerPoolFailsafePolicyTargetPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerPoolFailsafePolicyPatch model
				loadBalancerPoolFailsafePolicyPatchModel := new(vpcv1.LoadBalancerPoolFailsafePolicyPatch)
				loadBalancerPoolFailsafePolicyPatchModel.Action = core.StringPtr("forward")
				loadBalancerPoolFailsafePolicyPatchModel.Target = loadBalancerPoolFailsafePolicyTargetPatchModel

				// Construct an instance of the LoadBalancerPoolHealthMonitorPatch model
				loadBalancerPoolHealthMonitorPatchModel := new(vpcv1.LoadBalancerPoolHealthMonitorPatch)
				loadBalancerPoolHealthMonitorPatchModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPatchModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPatchModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPatchModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPatchModel.Type = core.StringPtr("http")
				loadBalancerPoolHealthMonitorPatchModel.URLPath = core.StringPtr("/")

				// Construct an instance of the LoadBalancerPoolSessionPersistencePatch model
				loadBalancerPoolSessionPersistencePatchModel := new(vpcv1.LoadBalancerPoolSessionPersistencePatch)
				loadBalancerPoolSessionPersistencePatchModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePatchModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the LoadBalancerPoolPatch model
				loadBalancerPoolPatchModel := new(vpcv1.LoadBalancerPoolPatch)
				loadBalancerPoolPatchModel.Algorithm = core.StringPtr("weighted_round_robin")
				loadBalancerPoolPatchModel.FailsafePolicy = loadBalancerPoolFailsafePolicyPatchModel
				loadBalancerPoolPatchModel.HealthMonitor = loadBalancerPoolHealthMonitorPatchModel
				loadBalancerPoolPatchModel.Name = core.StringPtr("my-load-balancer-pool")
				loadBalancerPoolPatchModel.Protocol = core.StringPtr("http")
				loadBalancerPoolPatchModel.ProxyProtocol = core.StringPtr("disabled")
				loadBalancerPoolPatchModel.SessionPersistence = loadBalancerPoolSessionPersistencePatchModel
				loadBalancerPoolPatchModelAsPatch, asPatchErr := loadBalancerPoolPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerPoolOptions model
				updateLoadBalancerPoolOptionsModel := new(vpcv1.UpdateLoadBalancerPoolOptions)
				updateLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerPoolOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerPoolOptionsModel.LoadBalancerPoolPatch = loadBalancerPoolPatchModelAsPatch
				updateLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateLoadBalancerPool(updateLoadBalancerPoolOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateLoadBalancerPool with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID model
				loadBalancerPoolFailsafePolicyTargetPatchModel := new(vpcv1.LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID)
				loadBalancerPoolFailsafePolicyTargetPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerPoolFailsafePolicyPatch model
				loadBalancerPoolFailsafePolicyPatchModel := new(vpcv1.LoadBalancerPoolFailsafePolicyPatch)
				loadBalancerPoolFailsafePolicyPatchModel.Action = core.StringPtr("forward")
				loadBalancerPoolFailsafePolicyPatchModel.Target = loadBalancerPoolFailsafePolicyTargetPatchModel

				// Construct an instance of the LoadBalancerPoolHealthMonitorPatch model
				loadBalancerPoolHealthMonitorPatchModel := new(vpcv1.LoadBalancerPoolHealthMonitorPatch)
				loadBalancerPoolHealthMonitorPatchModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPatchModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPatchModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPatchModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPatchModel.Type = core.StringPtr("http")
				loadBalancerPoolHealthMonitorPatchModel.URLPath = core.StringPtr("/")

				// Construct an instance of the LoadBalancerPoolSessionPersistencePatch model
				loadBalancerPoolSessionPersistencePatchModel := new(vpcv1.LoadBalancerPoolSessionPersistencePatch)
				loadBalancerPoolSessionPersistencePatchModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePatchModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the LoadBalancerPoolPatch model
				loadBalancerPoolPatchModel := new(vpcv1.LoadBalancerPoolPatch)
				loadBalancerPoolPatchModel.Algorithm = core.StringPtr("weighted_round_robin")
				loadBalancerPoolPatchModel.FailsafePolicy = loadBalancerPoolFailsafePolicyPatchModel
				loadBalancerPoolPatchModel.HealthMonitor = loadBalancerPoolHealthMonitorPatchModel
				loadBalancerPoolPatchModel.Name = core.StringPtr("my-load-balancer-pool")
				loadBalancerPoolPatchModel.Protocol = core.StringPtr("http")
				loadBalancerPoolPatchModel.ProxyProtocol = core.StringPtr("disabled")
				loadBalancerPoolPatchModel.SessionPersistence = loadBalancerPoolSessionPersistencePatchModel
				loadBalancerPoolPatchModelAsPatch, asPatchErr := loadBalancerPoolPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerPoolOptions model
				updateLoadBalancerPoolOptionsModel := new(vpcv1.UpdateLoadBalancerPoolOptions)
				updateLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerPoolOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerPoolOptionsModel.LoadBalancerPoolPatch = loadBalancerPoolPatchModelAsPatch
				updateLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateLoadBalancerPool(updateLoadBalancerPoolOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateLoadBalancerPoolOptions model with no property values
				updateLoadBalancerPoolOptionsModelNew := new(vpcv1.UpdateLoadBalancerPoolOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateLoadBalancerPool(updateLoadBalancerPoolOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateLoadBalancerPool successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID model
				loadBalancerPoolFailsafePolicyTargetPatchModel := new(vpcv1.LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID)
				loadBalancerPoolFailsafePolicyTargetPatchModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

				// Construct an instance of the LoadBalancerPoolFailsafePolicyPatch model
				loadBalancerPoolFailsafePolicyPatchModel := new(vpcv1.LoadBalancerPoolFailsafePolicyPatch)
				loadBalancerPoolFailsafePolicyPatchModel.Action = core.StringPtr("forward")
				loadBalancerPoolFailsafePolicyPatchModel.Target = loadBalancerPoolFailsafePolicyTargetPatchModel

				// Construct an instance of the LoadBalancerPoolHealthMonitorPatch model
				loadBalancerPoolHealthMonitorPatchModel := new(vpcv1.LoadBalancerPoolHealthMonitorPatch)
				loadBalancerPoolHealthMonitorPatchModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPatchModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPatchModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPatchModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPatchModel.Type = core.StringPtr("http")
				loadBalancerPoolHealthMonitorPatchModel.URLPath = core.StringPtr("/")

				// Construct an instance of the LoadBalancerPoolSessionPersistencePatch model
				loadBalancerPoolSessionPersistencePatchModel := new(vpcv1.LoadBalancerPoolSessionPersistencePatch)
				loadBalancerPoolSessionPersistencePatchModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePatchModel.Type = core.StringPtr("app_cookie")

				// Construct an instance of the LoadBalancerPoolPatch model
				loadBalancerPoolPatchModel := new(vpcv1.LoadBalancerPoolPatch)
				loadBalancerPoolPatchModel.Algorithm = core.StringPtr("weighted_round_robin")
				loadBalancerPoolPatchModel.FailsafePolicy = loadBalancerPoolFailsafePolicyPatchModel
				loadBalancerPoolPatchModel.HealthMonitor = loadBalancerPoolHealthMonitorPatchModel
				loadBalancerPoolPatchModel.Name = core.StringPtr("my-load-balancer-pool")
				loadBalancerPoolPatchModel.Protocol = core.StringPtr("http")
				loadBalancerPoolPatchModel.ProxyProtocol = core.StringPtr("disabled")
				loadBalancerPoolPatchModel.SessionPersistence = loadBalancerPoolSessionPersistencePatchModel
				loadBalancerPoolPatchModelAsPatch, asPatchErr := loadBalancerPoolPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerPoolOptions model
				updateLoadBalancerPoolOptionsModel := new(vpcv1.UpdateLoadBalancerPoolOptions)
				updateLoadBalancerPoolOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerPoolOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerPoolOptionsModel.LoadBalancerPoolPatch = loadBalancerPoolPatchModelAsPatch
				updateLoadBalancerPoolOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateLoadBalancerPool(updateLoadBalancerPoolOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptions *ListLoadBalancerPoolMembersOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listLoadBalancerPoolMembersPath := "/load_balancers/testString/pools/testString/members"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerPoolMembersPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListLoadBalancerPoolMembers with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerPoolMembersOptions model
				listLoadBalancerPoolMembersOptionsModel := new(vpcv1.ListLoadBalancerPoolMembersOptions)
				listLoadBalancerPoolMembersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerPoolMembersOptionsModel.PoolID = core.StringPtr("testString")
				listLoadBalancerPoolMembersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptions *ListLoadBalancerPoolMembersOptions)`, func() {
		version := "2024-06-23"
		listLoadBalancerPoolMembersPath := "/load_balancers/testString/pools/testString/members"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerPoolMembersPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}]}`)
				}))
			})
			It(`Invoke ListLoadBalancerPoolMembers successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListLoadBalancerPoolMembersOptions model
				listLoadBalancerPoolMembersOptionsModel := new(vpcv1.ListLoadBalancerPoolMembersOptions)
				listLoadBalancerPoolMembersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerPoolMembersOptionsModel.PoolID = core.StringPtr("testString")
				listLoadBalancerPoolMembersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListLoadBalancerPoolMembersWithContext(ctx, listLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListLoadBalancerPoolMembersWithContext(ctx, listLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listLoadBalancerPoolMembersPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}]}`)
				}))
			})
			It(`Invoke ListLoadBalancerPoolMembers successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListLoadBalancerPoolMembers(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListLoadBalancerPoolMembersOptions model
				listLoadBalancerPoolMembersOptionsModel := new(vpcv1.ListLoadBalancerPoolMembersOptions)
				listLoadBalancerPoolMembersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerPoolMembersOptionsModel.PoolID = core.StringPtr("testString")
				listLoadBalancerPoolMembersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListLoadBalancerPoolMembers with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerPoolMembersOptions model
				listLoadBalancerPoolMembersOptionsModel := new(vpcv1.ListLoadBalancerPoolMembersOptions)
				listLoadBalancerPoolMembersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerPoolMembersOptionsModel.PoolID = core.StringPtr("testString")
				listLoadBalancerPoolMembersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListLoadBalancerPoolMembersOptions model with no property values
				listLoadBalancerPoolMembersOptionsModelNew := new(vpcv1.ListLoadBalancerPoolMembersOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListLoadBalancerPoolMembers successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListLoadBalancerPoolMembersOptions model
				listLoadBalancerPoolMembersOptionsModel := new(vpcv1.ListLoadBalancerPoolMembersOptions)
				listLoadBalancerPoolMembersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				listLoadBalancerPoolMembersOptionsModel.PoolID = core.StringPtr("testString")
				listLoadBalancerPoolMembersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateLoadBalancerPoolMember(createLoadBalancerPoolMemberOptions *CreateLoadBalancerPoolMemberOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createLoadBalancerPoolMemberPath := "/load_balancers/testString/pools/testString/members"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerPoolMemberPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateLoadBalancerPoolMember with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the CreateLoadBalancerPoolMemberOptions model
				createLoadBalancerPoolMemberOptionsModel := new(vpcv1.CreateLoadBalancerPoolMemberOptions)
				createLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				createLoadBalancerPoolMemberOptionsModel.Port = core.Int64Ptr(int64(80))
				createLoadBalancerPoolMemberOptionsModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				createLoadBalancerPoolMemberOptionsModel.Weight = core.Int64Ptr(int64(50))
				createLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateLoadBalancerPoolMember(createLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateLoadBalancerPoolMember(createLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateLoadBalancerPoolMember(createLoadBalancerPoolMemberOptions *CreateLoadBalancerPoolMemberOptions)`, func() {
		version := "2024-06-23"
		createLoadBalancerPoolMemberPath := "/load_balancers/testString/pools/testString/members"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerPoolMemberPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}`)
				}))
			})
			It(`Invoke CreateLoadBalancerPoolMember successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the CreateLoadBalancerPoolMemberOptions model
				createLoadBalancerPoolMemberOptionsModel := new(vpcv1.CreateLoadBalancerPoolMemberOptions)
				createLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				createLoadBalancerPoolMemberOptionsModel.Port = core.Int64Ptr(int64(80))
				createLoadBalancerPoolMemberOptionsModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				createLoadBalancerPoolMemberOptionsModel.Weight = core.Int64Ptr(int64(50))
				createLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateLoadBalancerPoolMemberWithContext(ctx, createLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateLoadBalancerPoolMember(createLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateLoadBalancerPoolMemberWithContext(ctx, createLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createLoadBalancerPoolMemberPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}`)
				}))
			})
			It(`Invoke CreateLoadBalancerPoolMember successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateLoadBalancerPoolMember(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the CreateLoadBalancerPoolMemberOptions model
				createLoadBalancerPoolMemberOptionsModel := new(vpcv1.CreateLoadBalancerPoolMemberOptions)
				createLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				createLoadBalancerPoolMemberOptionsModel.Port = core.Int64Ptr(int64(80))
				createLoadBalancerPoolMemberOptionsModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				createLoadBalancerPoolMemberOptionsModel.Weight = core.Int64Ptr(int64(50))
				createLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateLoadBalancerPoolMember(createLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateLoadBalancerPoolMember with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the CreateLoadBalancerPoolMemberOptions model
				createLoadBalancerPoolMemberOptionsModel := new(vpcv1.CreateLoadBalancerPoolMemberOptions)
				createLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				createLoadBalancerPoolMemberOptionsModel.Port = core.Int64Ptr(int64(80))
				createLoadBalancerPoolMemberOptionsModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				createLoadBalancerPoolMemberOptionsModel.Weight = core.Int64Ptr(int64(50))
				createLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateLoadBalancerPoolMember(createLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateLoadBalancerPoolMemberOptions model with no property values
				createLoadBalancerPoolMemberOptionsModelNew := new(vpcv1.CreateLoadBalancerPoolMemberOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateLoadBalancerPoolMember(createLoadBalancerPoolMemberOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateLoadBalancerPoolMember successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the CreateLoadBalancerPoolMemberOptions model
				createLoadBalancerPoolMemberOptionsModel := new(vpcv1.CreateLoadBalancerPoolMemberOptions)
				createLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				createLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				createLoadBalancerPoolMemberOptionsModel.Port = core.Int64Ptr(int64(80))
				createLoadBalancerPoolMemberOptionsModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				createLoadBalancerPoolMemberOptionsModel.Weight = core.Int64Ptr(int64(50))
				createLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateLoadBalancerPoolMember(createLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ReplaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptions *ReplaceLoadBalancerPoolMembersOptions) - Operation response error`, func() {
		version := "2024-06-23"
		replaceLoadBalancerPoolMembersPath := "/load_balancers/testString/pools/testString/members"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(replaceLoadBalancerPoolMembersPath))
					Expect(req.Method).To(Equal("PUT"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ReplaceLoadBalancerPoolMembers with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the ReplaceLoadBalancerPoolMembersOptions model
				replaceLoadBalancerPoolMembersOptionsModel := new(vpcv1.ReplaceLoadBalancerPoolMembersOptions)
				replaceLoadBalancerPoolMembersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				replaceLoadBalancerPoolMembersOptionsModel.PoolID = core.StringPtr("testString")
				replaceLoadBalancerPoolMembersOptionsModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				replaceLoadBalancerPoolMembersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ReplaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ReplaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ReplaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptions *ReplaceLoadBalancerPoolMembersOptions)`, func() {
		version := "2024-06-23"
		replaceLoadBalancerPoolMembersPath := "/load_balancers/testString/pools/testString/members"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(replaceLoadBalancerPoolMembersPath))
					Expect(req.Method).To(Equal("PUT"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}]}`)
				}))
			})
			It(`Invoke ReplaceLoadBalancerPoolMembers successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the ReplaceLoadBalancerPoolMembersOptions model
				replaceLoadBalancerPoolMembersOptionsModel := new(vpcv1.ReplaceLoadBalancerPoolMembersOptions)
				replaceLoadBalancerPoolMembersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				replaceLoadBalancerPoolMembersOptionsModel.PoolID = core.StringPtr("testString")
				replaceLoadBalancerPoolMembersOptionsModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				replaceLoadBalancerPoolMembersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ReplaceLoadBalancerPoolMembersWithContext(ctx, replaceLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ReplaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ReplaceLoadBalancerPoolMembersWithContext(ctx, replaceLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(replaceLoadBalancerPoolMembersPath))
					Expect(req.Method).To(Equal("PUT"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}]}`)
				}))
			})
			It(`Invoke ReplaceLoadBalancerPoolMembers successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ReplaceLoadBalancerPoolMembers(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the ReplaceLoadBalancerPoolMembersOptions model
				replaceLoadBalancerPoolMembersOptionsModel := new(vpcv1.ReplaceLoadBalancerPoolMembersOptions)
				replaceLoadBalancerPoolMembersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				replaceLoadBalancerPoolMembersOptionsModel.PoolID = core.StringPtr("testString")
				replaceLoadBalancerPoolMembersOptionsModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				replaceLoadBalancerPoolMembersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ReplaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ReplaceLoadBalancerPoolMembers with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the ReplaceLoadBalancerPoolMembersOptions model
				replaceLoadBalancerPoolMembersOptionsModel := new(vpcv1.ReplaceLoadBalancerPoolMembersOptions)
				replaceLoadBalancerPoolMembersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				replaceLoadBalancerPoolMembersOptionsModel.PoolID = core.StringPtr("testString")
				replaceLoadBalancerPoolMembersOptionsModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				replaceLoadBalancerPoolMembersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ReplaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ReplaceLoadBalancerPoolMembersOptions model with no property values
				replaceLoadBalancerPoolMembersOptionsModelNew := new(vpcv1.ReplaceLoadBalancerPoolMembersOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ReplaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ReplaceLoadBalancerPoolMembers successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))

				// Construct an instance of the ReplaceLoadBalancerPoolMembersOptions model
				replaceLoadBalancerPoolMembersOptionsModel := new(vpcv1.ReplaceLoadBalancerPoolMembersOptions)
				replaceLoadBalancerPoolMembersOptionsModel.LoadBalancerID = core.StringPtr("testString")
				replaceLoadBalancerPoolMembersOptionsModel.PoolID = core.StringPtr("testString")
				replaceLoadBalancerPoolMembersOptionsModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				replaceLoadBalancerPoolMembersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ReplaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteLoadBalancerPoolMember(deleteLoadBalancerPoolMemberOptions *DeleteLoadBalancerPoolMemberOptions)`, func() {
		version := "2024-06-23"
		deleteLoadBalancerPoolMemberPath := "/load_balancers/testString/pools/testString/members/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteLoadBalancerPoolMemberPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteLoadBalancerPoolMember successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteLoadBalancerPoolMember(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteLoadBalancerPoolMemberOptions model
				deleteLoadBalancerPoolMemberOptionsModel := new(vpcv1.DeleteLoadBalancerPoolMemberOptions)
				deleteLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				deleteLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				deleteLoadBalancerPoolMemberOptionsModel.ID = core.StringPtr("testString")
				deleteLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteLoadBalancerPoolMember(deleteLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteLoadBalancerPoolMember with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteLoadBalancerPoolMemberOptions model
				deleteLoadBalancerPoolMemberOptionsModel := new(vpcv1.DeleteLoadBalancerPoolMemberOptions)
				deleteLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				deleteLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				deleteLoadBalancerPoolMemberOptionsModel.ID = core.StringPtr("testString")
				deleteLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteLoadBalancerPoolMember(deleteLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteLoadBalancerPoolMemberOptions model with no property values
				deleteLoadBalancerPoolMemberOptionsModelNew := new(vpcv1.DeleteLoadBalancerPoolMemberOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteLoadBalancerPoolMember(deleteLoadBalancerPoolMemberOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancerPoolMember(getLoadBalancerPoolMemberOptions *GetLoadBalancerPoolMemberOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getLoadBalancerPoolMemberPath := "/load_balancers/testString/pools/testString/members/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerPoolMemberPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetLoadBalancerPoolMember with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerPoolMemberOptions model
				getLoadBalancerPoolMemberOptionsModel := new(vpcv1.GetLoadBalancerPoolMemberOptions)
				getLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetLoadBalancerPoolMember(getLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetLoadBalancerPoolMember(getLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetLoadBalancerPoolMember(getLoadBalancerPoolMemberOptions *GetLoadBalancerPoolMemberOptions)`, func() {
		version := "2024-06-23"
		getLoadBalancerPoolMemberPath := "/load_balancers/testString/pools/testString/members/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerPoolMemberPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}`)
				}))
			})
			It(`Invoke GetLoadBalancerPoolMember successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetLoadBalancerPoolMemberOptions model
				getLoadBalancerPoolMemberOptionsModel := new(vpcv1.GetLoadBalancerPoolMemberOptions)
				getLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetLoadBalancerPoolMemberWithContext(ctx, getLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetLoadBalancerPoolMember(getLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetLoadBalancerPoolMemberWithContext(ctx, getLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getLoadBalancerPoolMemberPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}`)
				}))
			})
			It(`Invoke GetLoadBalancerPoolMember successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetLoadBalancerPoolMember(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetLoadBalancerPoolMemberOptions model
				getLoadBalancerPoolMemberOptionsModel := new(vpcv1.GetLoadBalancerPoolMemberOptions)
				getLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetLoadBalancerPoolMember(getLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetLoadBalancerPoolMember with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerPoolMemberOptions model
				getLoadBalancerPoolMemberOptionsModel := new(vpcv1.GetLoadBalancerPoolMemberOptions)
				getLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetLoadBalancerPoolMember(getLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetLoadBalancerPoolMemberOptions model with no property values
				getLoadBalancerPoolMemberOptionsModelNew := new(vpcv1.GetLoadBalancerPoolMemberOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetLoadBalancerPoolMember(getLoadBalancerPoolMemberOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetLoadBalancerPoolMember successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetLoadBalancerPoolMemberOptions model
				getLoadBalancerPoolMemberOptionsModel := new(vpcv1.GetLoadBalancerPoolMemberOptions)
				getLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.ID = core.StringPtr("testString")
				getLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetLoadBalancerPoolMember(getLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptions *UpdateLoadBalancerPoolMemberOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateLoadBalancerPoolMemberPath := "/load_balancers/testString/pools/testString/members/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerPoolMemberPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateLoadBalancerPoolMember with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPatch model
				loadBalancerPoolMemberPatchModel := new(vpcv1.LoadBalancerPoolMemberPatch)
				loadBalancerPoolMemberPatchModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPatchModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPatchModel.Weight = core.Int64Ptr(int64(99))
				loadBalancerPoolMemberPatchModelAsPatch, asPatchErr := loadBalancerPoolMemberPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerPoolMemberOptions model
				updateLoadBalancerPoolMemberOptionsModel := new(vpcv1.UpdateLoadBalancerPoolMemberOptions)
				updateLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.LoadBalancerPoolMemberPatch = loadBalancerPoolMemberPatchModelAsPatch
				updateLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptions *UpdateLoadBalancerPoolMemberOptions)`, func() {
		version := "2024-06-23"
		updateLoadBalancerPoolMemberPath := "/load_balancers/testString/pools/testString/members/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerPoolMemberPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}`)
				}))
			})
			It(`Invoke UpdateLoadBalancerPoolMember successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPatch model
				loadBalancerPoolMemberPatchModel := new(vpcv1.LoadBalancerPoolMemberPatch)
				loadBalancerPoolMemberPatchModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPatchModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPatchModel.Weight = core.Int64Ptr(int64(99))
				loadBalancerPoolMemberPatchModelAsPatch, asPatchErr := loadBalancerPoolMemberPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerPoolMemberOptions model
				updateLoadBalancerPoolMemberOptionsModel := new(vpcv1.UpdateLoadBalancerPoolMemberOptions)
				updateLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.LoadBalancerPoolMemberPatch = loadBalancerPoolMemberPatchModelAsPatch
				updateLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateLoadBalancerPoolMemberWithContext(ctx, updateLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateLoadBalancerPoolMemberWithContext(ctx, updateLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateLoadBalancerPoolMemberPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "id": "r006-4a4b345f-cf6b-4326-8202-6d8229e9833a", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}`)
				}))
			})
			It(`Invoke UpdateLoadBalancerPoolMember successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateLoadBalancerPoolMember(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPatch model
				loadBalancerPoolMemberPatchModel := new(vpcv1.LoadBalancerPoolMemberPatch)
				loadBalancerPoolMemberPatchModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPatchModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPatchModel.Weight = core.Int64Ptr(int64(99))
				loadBalancerPoolMemberPatchModelAsPatch, asPatchErr := loadBalancerPoolMemberPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerPoolMemberOptions model
				updateLoadBalancerPoolMemberOptionsModel := new(vpcv1.UpdateLoadBalancerPoolMemberOptions)
				updateLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.LoadBalancerPoolMemberPatch = loadBalancerPoolMemberPatchModelAsPatch
				updateLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateLoadBalancerPoolMember with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPatch model
				loadBalancerPoolMemberPatchModel := new(vpcv1.LoadBalancerPoolMemberPatch)
				loadBalancerPoolMemberPatchModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPatchModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPatchModel.Weight = core.Int64Ptr(int64(99))
				loadBalancerPoolMemberPatchModelAsPatch, asPatchErr := loadBalancerPoolMemberPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerPoolMemberOptions model
				updateLoadBalancerPoolMemberOptionsModel := new(vpcv1.UpdateLoadBalancerPoolMemberOptions)
				updateLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.LoadBalancerPoolMemberPatch = loadBalancerPoolMemberPatchModelAsPatch
				updateLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateLoadBalancerPoolMemberOptions model with no property values
				updateLoadBalancerPoolMemberOptionsModelNew := new(vpcv1.UpdateLoadBalancerPoolMemberOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateLoadBalancerPoolMember successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

				// Construct an instance of the LoadBalancerPoolMemberPatch model
				loadBalancerPoolMemberPatchModel := new(vpcv1.LoadBalancerPoolMemberPatch)
				loadBalancerPoolMemberPatchModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPatchModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPatchModel.Weight = core.Int64Ptr(int64(99))
				loadBalancerPoolMemberPatchModelAsPatch, asPatchErr := loadBalancerPoolMemberPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateLoadBalancerPoolMemberOptions model
				updateLoadBalancerPoolMemberOptionsModel := new(vpcv1.UpdateLoadBalancerPoolMemberOptions)
				updateLoadBalancerPoolMemberOptionsModel.LoadBalancerID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.PoolID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.ID = core.StringPtr("testString")
				updateLoadBalancerPoolMemberOptionsModel.LoadBalancerPoolMemberPatch = loadBalancerPoolMemberPatchModelAsPatch
				updateLoadBalancerPoolMemberOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListNetworkAcls(listNetworkAclsOptions *ListNetworkAclsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listNetworkAclsPath := "/network_acls"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listNetworkAclsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListNetworkAcls with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListNetworkAclsOptions model
				listNetworkAclsOptionsModel := new(vpcv1.ListNetworkAclsOptions)
				listNetworkAclsOptionsModel.Start = core.StringPtr("testString")
				listNetworkAclsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkAclsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listNetworkAclsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListNetworkAcls(listNetworkAclsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListNetworkAcls(listNetworkAclsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListNetworkAcls(listNetworkAclsOptions *ListNetworkAclsOptions)`, func() {
		version := "2024-06-23"
		listNetworkAclsPath := "/network_acls"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listNetworkAclsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListNetworkAcls successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListNetworkAclsOptions model
				listNetworkAclsOptionsModel := new(vpcv1.ListNetworkAclsOptions)
				listNetworkAclsOptionsModel.Start = core.StringPtr("testString")
				listNetworkAclsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkAclsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listNetworkAclsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListNetworkAclsWithContext(ctx, listNetworkAclsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListNetworkAcls(listNetworkAclsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListNetworkAclsWithContext(ctx, listNetworkAclsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listNetworkAclsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListNetworkAcls successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListNetworkAcls(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListNetworkAclsOptions model
				listNetworkAclsOptionsModel := new(vpcv1.ListNetworkAclsOptions)
				listNetworkAclsOptionsModel.Start = core.StringPtr("testString")
				listNetworkAclsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkAclsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listNetworkAclsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListNetworkAcls(listNetworkAclsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListNetworkAcls with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListNetworkAclsOptions model
				listNetworkAclsOptionsModel := new(vpcv1.ListNetworkAclsOptions)
				listNetworkAclsOptionsModel.Start = core.StringPtr("testString")
				listNetworkAclsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkAclsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listNetworkAclsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListNetworkAcls(listNetworkAclsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListNetworkAcls successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListNetworkAclsOptions model
				listNetworkAclsOptionsModel := new(vpcv1.ListNetworkAclsOptions)
				listNetworkAclsOptionsModel.Start = core.StringPtr("testString")
				listNetworkAclsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkAclsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listNetworkAclsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListNetworkAcls(listNetworkAclsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.NetworkACLCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.NetworkACLCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.NetworkACLCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listNetworkAclsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9","id":"r006-8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-network-acl-rule"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9","id":"r006-8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-network-acl-rule","source":"192.168.3.0/24","protocol":"all"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9","id":"r006-8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-network-acl-rule"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9","id":"r006-8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-network-acl-rule","source":"192.168.3.0/24","protocol":"all"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use NetworkAclsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listNetworkAclsOptionsModel := &vpcv1.ListNetworkAclsOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewNetworkAclsPager(listNetworkAclsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.NetworkACL
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use NetworkAclsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listNetworkAclsOptionsModel := &vpcv1.ListNetworkAclsOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewNetworkAclsPager(listNetworkAclsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateNetworkACL(createNetworkACLOptions *CreateNetworkACLOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createNetworkACLPath := "/network_acls"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createNetworkACLPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateNetworkACL with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype model
				networkACLRulePrototypeNetworkACLContextModel := new(vpcv1.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype)
				networkACLRulePrototypeNetworkACLContextModel.Action = core.StringPtr("allow")
				networkACLRulePrototypeNetworkACLContextModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeNetworkACLContextModel.Direction = core.StringPtr("inbound")
				networkACLRulePrototypeNetworkACLContextModel.IPVersion = core.StringPtr("ipv4")
				networkACLRulePrototypeNetworkACLContextModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePrototypeNetworkACLContextModel.Source = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeNetworkACLContextModel.Protocol = core.StringPtr("all")

				// Construct an instance of the NetworkACLPrototypeNetworkACLByRules model
				networkACLPrototypeModel := new(vpcv1.NetworkACLPrototypeNetworkACLByRules)
				networkACLPrototypeModel.Name = core.StringPtr("my-network-acl")
				networkACLPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				networkACLPrototypeModel.VPC = vpcIdentityModel
				networkACLPrototypeModel.Rules = []vpcv1.NetworkACLRulePrototypeNetworkACLContextIntf{networkACLRulePrototypeNetworkACLContextModel}

				// Construct an instance of the CreateNetworkACLOptions model
				createNetworkACLOptionsModel := new(vpcv1.CreateNetworkACLOptions)
				createNetworkACLOptionsModel.NetworkACLPrototype = networkACLPrototypeModel
				createNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateNetworkACL(createNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateNetworkACL(createNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateNetworkACL(createNetworkACLOptions *CreateNetworkACLOptions)`, func() {
		version := "2024-06-23"
		createNetworkACLPath := "/network_acls"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createNetworkACLPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateNetworkACL successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype model
				networkACLRulePrototypeNetworkACLContextModel := new(vpcv1.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype)
				networkACLRulePrototypeNetworkACLContextModel.Action = core.StringPtr("allow")
				networkACLRulePrototypeNetworkACLContextModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeNetworkACLContextModel.Direction = core.StringPtr("inbound")
				networkACLRulePrototypeNetworkACLContextModel.IPVersion = core.StringPtr("ipv4")
				networkACLRulePrototypeNetworkACLContextModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePrototypeNetworkACLContextModel.Source = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeNetworkACLContextModel.Protocol = core.StringPtr("all")

				// Construct an instance of the NetworkACLPrototypeNetworkACLByRules model
				networkACLPrototypeModel := new(vpcv1.NetworkACLPrototypeNetworkACLByRules)
				networkACLPrototypeModel.Name = core.StringPtr("my-network-acl")
				networkACLPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				networkACLPrototypeModel.VPC = vpcIdentityModel
				networkACLPrototypeModel.Rules = []vpcv1.NetworkACLRulePrototypeNetworkACLContextIntf{networkACLRulePrototypeNetworkACLContextModel}

				// Construct an instance of the CreateNetworkACLOptions model
				createNetworkACLOptionsModel := new(vpcv1.CreateNetworkACLOptions)
				createNetworkACLOptionsModel.NetworkACLPrototype = networkACLPrototypeModel
				createNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateNetworkACLWithContext(ctx, createNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateNetworkACL(createNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateNetworkACLWithContext(ctx, createNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createNetworkACLPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateNetworkACL successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateNetworkACL(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype model
				networkACLRulePrototypeNetworkACLContextModel := new(vpcv1.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype)
				networkACLRulePrototypeNetworkACLContextModel.Action = core.StringPtr("allow")
				networkACLRulePrototypeNetworkACLContextModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeNetworkACLContextModel.Direction = core.StringPtr("inbound")
				networkACLRulePrototypeNetworkACLContextModel.IPVersion = core.StringPtr("ipv4")
				networkACLRulePrototypeNetworkACLContextModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePrototypeNetworkACLContextModel.Source = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeNetworkACLContextModel.Protocol = core.StringPtr("all")

				// Construct an instance of the NetworkACLPrototypeNetworkACLByRules model
				networkACLPrototypeModel := new(vpcv1.NetworkACLPrototypeNetworkACLByRules)
				networkACLPrototypeModel.Name = core.StringPtr("my-network-acl")
				networkACLPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				networkACLPrototypeModel.VPC = vpcIdentityModel
				networkACLPrototypeModel.Rules = []vpcv1.NetworkACLRulePrototypeNetworkACLContextIntf{networkACLRulePrototypeNetworkACLContextModel}

				// Construct an instance of the CreateNetworkACLOptions model
				createNetworkACLOptionsModel := new(vpcv1.CreateNetworkACLOptions)
				createNetworkACLOptionsModel.NetworkACLPrototype = networkACLPrototypeModel
				createNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateNetworkACL(createNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateNetworkACL with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype model
				networkACLRulePrototypeNetworkACLContextModel := new(vpcv1.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype)
				networkACLRulePrototypeNetworkACLContextModel.Action = core.StringPtr("allow")
				networkACLRulePrototypeNetworkACLContextModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeNetworkACLContextModel.Direction = core.StringPtr("inbound")
				networkACLRulePrototypeNetworkACLContextModel.IPVersion = core.StringPtr("ipv4")
				networkACLRulePrototypeNetworkACLContextModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePrototypeNetworkACLContextModel.Source = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeNetworkACLContextModel.Protocol = core.StringPtr("all")

				// Construct an instance of the NetworkACLPrototypeNetworkACLByRules model
				networkACLPrototypeModel := new(vpcv1.NetworkACLPrototypeNetworkACLByRules)
				networkACLPrototypeModel.Name = core.StringPtr("my-network-acl")
				networkACLPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				networkACLPrototypeModel.VPC = vpcIdentityModel
				networkACLPrototypeModel.Rules = []vpcv1.NetworkACLRulePrototypeNetworkACLContextIntf{networkACLRulePrototypeNetworkACLContextModel}

				// Construct an instance of the CreateNetworkACLOptions model
				createNetworkACLOptionsModel := new(vpcv1.CreateNetworkACLOptions)
				createNetworkACLOptionsModel.NetworkACLPrototype = networkACLPrototypeModel
				createNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateNetworkACL(createNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateNetworkACLOptions model with no property values
				createNetworkACLOptionsModelNew := new(vpcv1.CreateNetworkACLOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateNetworkACL(createNetworkACLOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateNetworkACL successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype model
				networkACLRulePrototypeNetworkACLContextModel := new(vpcv1.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype)
				networkACLRulePrototypeNetworkACLContextModel.Action = core.StringPtr("allow")
				networkACLRulePrototypeNetworkACLContextModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeNetworkACLContextModel.Direction = core.StringPtr("inbound")
				networkACLRulePrototypeNetworkACLContextModel.IPVersion = core.StringPtr("ipv4")
				networkACLRulePrototypeNetworkACLContextModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePrototypeNetworkACLContextModel.Source = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeNetworkACLContextModel.Protocol = core.StringPtr("all")

				// Construct an instance of the NetworkACLPrototypeNetworkACLByRules model
				networkACLPrototypeModel := new(vpcv1.NetworkACLPrototypeNetworkACLByRules)
				networkACLPrototypeModel.Name = core.StringPtr("my-network-acl")
				networkACLPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				networkACLPrototypeModel.VPC = vpcIdentityModel
				networkACLPrototypeModel.Rules = []vpcv1.NetworkACLRulePrototypeNetworkACLContextIntf{networkACLRulePrototypeNetworkACLContextModel}

				// Construct an instance of the CreateNetworkACLOptions model
				createNetworkACLOptionsModel := new(vpcv1.CreateNetworkACLOptions)
				createNetworkACLOptionsModel.NetworkACLPrototype = networkACLPrototypeModel
				createNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateNetworkACL(createNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteNetworkACL(deleteNetworkACLOptions *DeleteNetworkACLOptions)`, func() {
		version := "2024-06-23"
		deleteNetworkACLPath := "/network_acls/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteNetworkACLPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteNetworkACL successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteNetworkACL(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteNetworkACLOptions model
				deleteNetworkACLOptionsModel := new(vpcv1.DeleteNetworkACLOptions)
				deleteNetworkACLOptionsModel.ID = core.StringPtr("testString")
				deleteNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteNetworkACL(deleteNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteNetworkACL with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteNetworkACLOptions model
				deleteNetworkACLOptionsModel := new(vpcv1.DeleteNetworkACLOptions)
				deleteNetworkACLOptionsModel.ID = core.StringPtr("testString")
				deleteNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteNetworkACL(deleteNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteNetworkACLOptions model with no property values
				deleteNetworkACLOptionsModelNew := new(vpcv1.DeleteNetworkACLOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteNetworkACL(deleteNetworkACLOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetNetworkACL(getNetworkACLOptions *GetNetworkACLOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getNetworkACLPath := "/network_acls/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getNetworkACLPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetNetworkACL with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetNetworkACLOptions model
				getNetworkACLOptionsModel := new(vpcv1.GetNetworkACLOptions)
				getNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetNetworkACL(getNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetNetworkACL(getNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetNetworkACL(getNetworkACLOptions *GetNetworkACLOptions)`, func() {
		version := "2024-06-23"
		getNetworkACLPath := "/network_acls/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getNetworkACLPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetNetworkACL successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetNetworkACLOptions model
				getNetworkACLOptionsModel := new(vpcv1.GetNetworkACLOptions)
				getNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetNetworkACLWithContext(ctx, getNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetNetworkACL(getNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetNetworkACLWithContext(ctx, getNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getNetworkACLPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetNetworkACL successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetNetworkACL(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetNetworkACLOptions model
				getNetworkACLOptionsModel := new(vpcv1.GetNetworkACLOptions)
				getNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetNetworkACL(getNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetNetworkACL with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetNetworkACLOptions model
				getNetworkACLOptionsModel := new(vpcv1.GetNetworkACLOptions)
				getNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetNetworkACL(getNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetNetworkACLOptions model with no property values
				getNetworkACLOptionsModelNew := new(vpcv1.GetNetworkACLOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetNetworkACL(getNetworkACLOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetNetworkACL successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetNetworkACLOptions model
				getNetworkACLOptionsModel := new(vpcv1.GetNetworkACLOptions)
				getNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetNetworkACL(getNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateNetworkACL(updateNetworkACLOptions *UpdateNetworkACLOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateNetworkACLPath := "/network_acls/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateNetworkACLPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateNetworkACL with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLPatch model
				networkACLPatchModel := new(vpcv1.NetworkACLPatch)
				networkACLPatchModel.Name = core.StringPtr("my-network-acl-updated")
				networkACLPatchModelAsPatch, asPatchErr := networkACLPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateNetworkACLOptions model
				updateNetworkACLOptionsModel := new(vpcv1.UpdateNetworkACLOptions)
				updateNetworkACLOptionsModel.ID = core.StringPtr("testString")
				updateNetworkACLOptionsModel.NetworkACLPatch = networkACLPatchModelAsPatch
				updateNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateNetworkACL(updateNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateNetworkACL(updateNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateNetworkACL(updateNetworkACLOptions *UpdateNetworkACLOptions)`, func() {
		version := "2024-06-23"
		updateNetworkACLPath := "/network_acls/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateNetworkACLPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateNetworkACL successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the NetworkACLPatch model
				networkACLPatchModel := new(vpcv1.NetworkACLPatch)
				networkACLPatchModel.Name = core.StringPtr("my-network-acl-updated")
				networkACLPatchModelAsPatch, asPatchErr := networkACLPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateNetworkACLOptions model
				updateNetworkACLOptionsModel := new(vpcv1.UpdateNetworkACLOptions)
				updateNetworkACLOptionsModel.ID = core.StringPtr("testString")
				updateNetworkACLOptionsModel.NetworkACLPatch = networkACLPatchModelAsPatch
				updateNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateNetworkACLWithContext(ctx, updateNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateNetworkACL(updateNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateNetworkACLWithContext(ctx, updateNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateNetworkACLPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateNetworkACL successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateNetworkACL(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the NetworkACLPatch model
				networkACLPatchModel := new(vpcv1.NetworkACLPatch)
				networkACLPatchModel.Name = core.StringPtr("my-network-acl-updated")
				networkACLPatchModelAsPatch, asPatchErr := networkACLPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateNetworkACLOptions model
				updateNetworkACLOptionsModel := new(vpcv1.UpdateNetworkACLOptions)
				updateNetworkACLOptionsModel.ID = core.StringPtr("testString")
				updateNetworkACLOptionsModel.NetworkACLPatch = networkACLPatchModelAsPatch
				updateNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateNetworkACL(updateNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateNetworkACL with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLPatch model
				networkACLPatchModel := new(vpcv1.NetworkACLPatch)
				networkACLPatchModel.Name = core.StringPtr("my-network-acl-updated")
				networkACLPatchModelAsPatch, asPatchErr := networkACLPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateNetworkACLOptions model
				updateNetworkACLOptionsModel := new(vpcv1.UpdateNetworkACLOptions)
				updateNetworkACLOptionsModel.ID = core.StringPtr("testString")
				updateNetworkACLOptionsModel.NetworkACLPatch = networkACLPatchModelAsPatch
				updateNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateNetworkACL(updateNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateNetworkACLOptions model with no property values
				updateNetworkACLOptionsModelNew := new(vpcv1.UpdateNetworkACLOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateNetworkACL(updateNetworkACLOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateNetworkACL successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLPatch model
				networkACLPatchModel := new(vpcv1.NetworkACLPatch)
				networkACLPatchModel.Name = core.StringPtr("my-network-acl-updated")
				networkACLPatchModelAsPatch, asPatchErr := networkACLPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateNetworkACLOptions model
				updateNetworkACLOptionsModel := new(vpcv1.UpdateNetworkACLOptions)
				updateNetworkACLOptionsModel.ID = core.StringPtr("testString")
				updateNetworkACLOptionsModel.NetworkACLPatch = networkACLPatchModelAsPatch
				updateNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateNetworkACL(updateNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListNetworkACLRules(listNetworkACLRulesOptions *ListNetworkACLRulesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listNetworkACLRulesPath := "/network_acls/testString/rules"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listNetworkACLRulesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["direction"]).To(Equal([]string{"inbound"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListNetworkACLRules with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListNetworkACLRulesOptions model
				listNetworkACLRulesOptionsModel := new(vpcv1.ListNetworkACLRulesOptions)
				listNetworkACLRulesOptionsModel.NetworkACLID = core.StringPtr("testString")
				listNetworkACLRulesOptionsModel.Start = core.StringPtr("testString")
				listNetworkACLRulesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkACLRulesOptionsModel.Direction = core.StringPtr("inbound")
				listNetworkACLRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListNetworkACLRules(listNetworkACLRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListNetworkACLRules(listNetworkACLRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListNetworkACLRules(listNetworkACLRulesOptions *ListNetworkACLRulesOptions)`, func() {
		version := "2024-06-23"
		listNetworkACLRulesPath := "/network_acls/testString/rules"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listNetworkACLRulesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["direction"]).To(Equal([]string{"inbound"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListNetworkACLRules successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListNetworkACLRulesOptions model
				listNetworkACLRulesOptionsModel := new(vpcv1.ListNetworkACLRulesOptions)
				listNetworkACLRulesOptionsModel.NetworkACLID = core.StringPtr("testString")
				listNetworkACLRulesOptionsModel.Start = core.StringPtr("testString")
				listNetworkACLRulesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkACLRulesOptionsModel.Direction = core.StringPtr("inbound")
				listNetworkACLRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListNetworkACLRulesWithContext(ctx, listNetworkACLRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListNetworkACLRules(listNetworkACLRulesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListNetworkACLRulesWithContext(ctx, listNetworkACLRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listNetworkACLRulesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["direction"]).To(Equal([]string{"inbound"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListNetworkACLRules successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListNetworkACLRules(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListNetworkACLRulesOptions model
				listNetworkACLRulesOptionsModel := new(vpcv1.ListNetworkACLRulesOptions)
				listNetworkACLRulesOptionsModel.NetworkACLID = core.StringPtr("testString")
				listNetworkACLRulesOptionsModel.Start = core.StringPtr("testString")
				listNetworkACLRulesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkACLRulesOptionsModel.Direction = core.StringPtr("inbound")
				listNetworkACLRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListNetworkACLRules(listNetworkACLRulesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListNetworkACLRules with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListNetworkACLRulesOptions model
				listNetworkACLRulesOptionsModel := new(vpcv1.ListNetworkACLRulesOptions)
				listNetworkACLRulesOptionsModel.NetworkACLID = core.StringPtr("testString")
				listNetworkACLRulesOptionsModel.Start = core.StringPtr("testString")
				listNetworkACLRulesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkACLRulesOptionsModel.Direction = core.StringPtr("inbound")
				listNetworkACLRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListNetworkACLRules(listNetworkACLRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListNetworkACLRulesOptions model with no property values
				listNetworkACLRulesOptionsModelNew := new(vpcv1.ListNetworkACLRulesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListNetworkACLRules(listNetworkACLRulesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListNetworkACLRules successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListNetworkACLRulesOptions model
				listNetworkACLRulesOptionsModel := new(vpcv1.ListNetworkACLRulesOptions)
				listNetworkACLRulesOptionsModel.NetworkACLID = core.StringPtr("testString")
				listNetworkACLRulesOptionsModel.Start = core.StringPtr("testString")
				listNetworkACLRulesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkACLRulesOptionsModel.Direction = core.StringPtr("inbound")
				listNetworkACLRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListNetworkACLRules(listNetworkACLRulesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.NetworkACLRuleCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.NetworkACLRuleCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.NetworkACLRuleCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listNetworkACLRulesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9","id":"r006-8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-network-acl-rule"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9","id":"r006-8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-network-acl-rule","source":"192.168.3.0/24","protocol":"all"}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9","id":"r006-8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-network-acl-rule"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9","id":"r006-8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-network-acl-rule","source":"192.168.3.0/24","protocol":"all"}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use NetworkACLRulesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listNetworkACLRulesOptionsModel := &vpcv1.ListNetworkACLRulesOptions{
					NetworkACLID: core.StringPtr("testString"),
					Limit:        core.Int64Ptr(int64(10)),
					Direction:    core.StringPtr("inbound"),
				}

				pager, err := vpcService.NewNetworkACLRulesPager(listNetworkACLRulesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.NetworkACLRuleItemIntf
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use NetworkACLRulesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listNetworkACLRulesOptionsModel := &vpcv1.ListNetworkACLRulesOptions{
					NetworkACLID: core.StringPtr("testString"),
					Limit:        core.Int64Ptr(int64(10)),
					Direction:    core.StringPtr("inbound"),
				}

				pager, err := vpcService.NewNetworkACLRulesPager(listNetworkACLRulesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateNetworkACLRule(createNetworkACLRuleOptions *CreateNetworkACLRuleOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createNetworkACLRulePath := "/network_acls/testString/rules"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createNetworkACLRulePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateNetworkACLRule with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID model
				networkACLRuleBeforePrototypeModel := new(vpcv1.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID)
				networkACLRuleBeforePrototypeModel.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

				// Construct an instance of the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype model
				networkACLRulePrototypeModel := new(vpcv1.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype)
				networkACLRulePrototypeModel.Action = core.StringPtr("allow")
				networkACLRulePrototypeModel.Before = networkACLRuleBeforePrototypeModel
				networkACLRulePrototypeModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeModel.Direction = core.StringPtr("inbound")
				networkACLRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				networkACLRulePrototypeModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePrototypeModel.Source = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateNetworkACLRuleOptions model
				createNetworkACLRuleOptionsModel := new(vpcv1.CreateNetworkACLRuleOptions)
				createNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				createNetworkACLRuleOptionsModel.NetworkACLRulePrototype = networkACLRulePrototypeModel
				createNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateNetworkACLRule(createNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateNetworkACLRule(createNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateNetworkACLRule(createNetworkACLRuleOptions *CreateNetworkACLRuleOptions)`, func() {
		version := "2024-06-23"
		createNetworkACLRulePath := "/network_acls/testString/rules"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createNetworkACLRulePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}`)
				}))
			})
			It(`Invoke CreateNetworkACLRule successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID model
				networkACLRuleBeforePrototypeModel := new(vpcv1.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID)
				networkACLRuleBeforePrototypeModel.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

				// Construct an instance of the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype model
				networkACLRulePrototypeModel := new(vpcv1.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype)
				networkACLRulePrototypeModel.Action = core.StringPtr("allow")
				networkACLRulePrototypeModel.Before = networkACLRuleBeforePrototypeModel
				networkACLRulePrototypeModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeModel.Direction = core.StringPtr("inbound")
				networkACLRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				networkACLRulePrototypeModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePrototypeModel.Source = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateNetworkACLRuleOptions model
				createNetworkACLRuleOptionsModel := new(vpcv1.CreateNetworkACLRuleOptions)
				createNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				createNetworkACLRuleOptionsModel.NetworkACLRulePrototype = networkACLRulePrototypeModel
				createNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateNetworkACLRuleWithContext(ctx, createNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateNetworkACLRule(createNetworkACLRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateNetworkACLRuleWithContext(ctx, createNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createNetworkACLRulePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}`)
				}))
			})
			It(`Invoke CreateNetworkACLRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateNetworkACLRule(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID model
				networkACLRuleBeforePrototypeModel := new(vpcv1.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID)
				networkACLRuleBeforePrototypeModel.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

				// Construct an instance of the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype model
				networkACLRulePrototypeModel := new(vpcv1.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype)
				networkACLRulePrototypeModel.Action = core.StringPtr("allow")
				networkACLRulePrototypeModel.Before = networkACLRuleBeforePrototypeModel
				networkACLRulePrototypeModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeModel.Direction = core.StringPtr("inbound")
				networkACLRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				networkACLRulePrototypeModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePrototypeModel.Source = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateNetworkACLRuleOptions model
				createNetworkACLRuleOptionsModel := new(vpcv1.CreateNetworkACLRuleOptions)
				createNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				createNetworkACLRuleOptionsModel.NetworkACLRulePrototype = networkACLRulePrototypeModel
				createNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateNetworkACLRule(createNetworkACLRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateNetworkACLRule with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID model
				networkACLRuleBeforePrototypeModel := new(vpcv1.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID)
				networkACLRuleBeforePrototypeModel.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

				// Construct an instance of the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype model
				networkACLRulePrototypeModel := new(vpcv1.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype)
				networkACLRulePrototypeModel.Action = core.StringPtr("allow")
				networkACLRulePrototypeModel.Before = networkACLRuleBeforePrototypeModel
				networkACLRulePrototypeModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeModel.Direction = core.StringPtr("inbound")
				networkACLRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				networkACLRulePrototypeModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePrototypeModel.Source = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateNetworkACLRuleOptions model
				createNetworkACLRuleOptionsModel := new(vpcv1.CreateNetworkACLRuleOptions)
				createNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				createNetworkACLRuleOptionsModel.NetworkACLRulePrototype = networkACLRulePrototypeModel
				createNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateNetworkACLRule(createNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateNetworkACLRuleOptions model with no property values
				createNetworkACLRuleOptionsModelNew := new(vpcv1.CreateNetworkACLRuleOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateNetworkACLRule(createNetworkACLRuleOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateNetworkACLRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID model
				networkACLRuleBeforePrototypeModel := new(vpcv1.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID)
				networkACLRuleBeforePrototypeModel.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

				// Construct an instance of the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype model
				networkACLRulePrototypeModel := new(vpcv1.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype)
				networkACLRulePrototypeModel.Action = core.StringPtr("allow")
				networkACLRulePrototypeModel.Before = networkACLRuleBeforePrototypeModel
				networkACLRulePrototypeModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeModel.Direction = core.StringPtr("inbound")
				networkACLRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				networkACLRulePrototypeModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePrototypeModel.Source = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateNetworkACLRuleOptions model
				createNetworkACLRuleOptionsModel := new(vpcv1.CreateNetworkACLRuleOptions)
				createNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				createNetworkACLRuleOptionsModel.NetworkACLRulePrototype = networkACLRulePrototypeModel
				createNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateNetworkACLRule(createNetworkACLRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteNetworkACLRule(deleteNetworkACLRuleOptions *DeleteNetworkACLRuleOptions)`, func() {
		version := "2024-06-23"
		deleteNetworkACLRulePath := "/network_acls/testString/rules/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteNetworkACLRulePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteNetworkACLRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteNetworkACLRule(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteNetworkACLRuleOptions model
				deleteNetworkACLRuleOptionsModel := new(vpcv1.DeleteNetworkACLRuleOptions)
				deleteNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				deleteNetworkACLRuleOptionsModel.ID = core.StringPtr("testString")
				deleteNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteNetworkACLRule(deleteNetworkACLRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteNetworkACLRule with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteNetworkACLRuleOptions model
				deleteNetworkACLRuleOptionsModel := new(vpcv1.DeleteNetworkACLRuleOptions)
				deleteNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				deleteNetworkACLRuleOptionsModel.ID = core.StringPtr("testString")
				deleteNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteNetworkACLRule(deleteNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteNetworkACLRuleOptions model with no property values
				deleteNetworkACLRuleOptionsModelNew := new(vpcv1.DeleteNetworkACLRuleOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteNetworkACLRule(deleteNetworkACLRuleOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetNetworkACLRule(getNetworkACLRuleOptions *GetNetworkACLRuleOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getNetworkACLRulePath := "/network_acls/testString/rules/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getNetworkACLRulePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetNetworkACLRule with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetNetworkACLRuleOptions model
				getNetworkACLRuleOptionsModel := new(vpcv1.GetNetworkACLRuleOptions)
				getNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				getNetworkACLRuleOptionsModel.ID = core.StringPtr("testString")
				getNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetNetworkACLRule(getNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetNetworkACLRule(getNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetNetworkACLRule(getNetworkACLRuleOptions *GetNetworkACLRuleOptions)`, func() {
		version := "2024-06-23"
		getNetworkACLRulePath := "/network_acls/testString/rules/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getNetworkACLRulePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}`)
				}))
			})
			It(`Invoke GetNetworkACLRule successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetNetworkACLRuleOptions model
				getNetworkACLRuleOptionsModel := new(vpcv1.GetNetworkACLRuleOptions)
				getNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				getNetworkACLRuleOptionsModel.ID = core.StringPtr("testString")
				getNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetNetworkACLRuleWithContext(ctx, getNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetNetworkACLRule(getNetworkACLRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetNetworkACLRuleWithContext(ctx, getNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getNetworkACLRulePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}`)
				}))
			})
			It(`Invoke GetNetworkACLRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetNetworkACLRule(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetNetworkACLRuleOptions model
				getNetworkACLRuleOptionsModel := new(vpcv1.GetNetworkACLRuleOptions)
				getNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				getNetworkACLRuleOptionsModel.ID = core.StringPtr("testString")
				getNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetNetworkACLRule(getNetworkACLRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetNetworkACLRule with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetNetworkACLRuleOptions model
				getNetworkACLRuleOptionsModel := new(vpcv1.GetNetworkACLRuleOptions)
				getNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				getNetworkACLRuleOptionsModel.ID = core.StringPtr("testString")
				getNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetNetworkACLRule(getNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetNetworkACLRuleOptions model with no property values
				getNetworkACLRuleOptionsModelNew := new(vpcv1.GetNetworkACLRuleOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetNetworkACLRule(getNetworkACLRuleOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetNetworkACLRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetNetworkACLRuleOptions model
				getNetworkACLRuleOptionsModel := new(vpcv1.GetNetworkACLRuleOptions)
				getNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				getNetworkACLRuleOptionsModel.ID = core.StringPtr("testString")
				getNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetNetworkACLRule(getNetworkACLRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateNetworkACLRule(updateNetworkACLRuleOptions *UpdateNetworkACLRuleOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateNetworkACLRulePath := "/network_acls/testString/rules/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateNetworkACLRulePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateNetworkACLRule with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID model
				networkACLRuleBeforePatchModel := new(vpcv1.NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID)
				networkACLRuleBeforePatchModel.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

				// Construct an instance of the NetworkACLRulePatch model
				networkACLRulePatchModel := new(vpcv1.NetworkACLRulePatch)
				networkACLRulePatchModel.Action = core.StringPtr("allow")
				networkACLRulePatchModel.Before = networkACLRuleBeforePatchModel
				networkACLRulePatchModel.Code = core.Int64Ptr(int64(0))
				networkACLRulePatchModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePatchModel.DestinationPortMax = core.Int64Ptr(int64(22))
				networkACLRulePatchModel.DestinationPortMin = core.Int64Ptr(int64(22))
				networkACLRulePatchModel.Direction = core.StringPtr("inbound")
				networkACLRulePatchModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePatchModel.Source = core.StringPtr("10.0.0.0/0")
				networkACLRulePatchModel.SourcePortMax = core.Int64Ptr(int64(65535))
				networkACLRulePatchModel.SourcePortMin = core.Int64Ptr(int64(49152))
				networkACLRulePatchModel.Type = core.Int64Ptr(int64(8))
				networkACLRulePatchModelAsPatch, asPatchErr := networkACLRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateNetworkACLRuleOptions model
				updateNetworkACLRuleOptionsModel := new(vpcv1.UpdateNetworkACLRuleOptions)
				updateNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				updateNetworkACLRuleOptionsModel.ID = core.StringPtr("testString")
				updateNetworkACLRuleOptionsModel.NetworkACLRulePatch = networkACLRulePatchModelAsPatch
				updateNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateNetworkACLRule(updateNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateNetworkACLRule(updateNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateNetworkACLRule(updateNetworkACLRuleOptions *UpdateNetworkACLRuleOptions)`, func() {
		version := "2024-06-23"
		updateNetworkACLRulePath := "/network_acls/testString/rules/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateNetworkACLRulePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}`)
				}))
			})
			It(`Invoke UpdateNetworkACLRule successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID model
				networkACLRuleBeforePatchModel := new(vpcv1.NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID)
				networkACLRuleBeforePatchModel.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

				// Construct an instance of the NetworkACLRulePatch model
				networkACLRulePatchModel := new(vpcv1.NetworkACLRulePatch)
				networkACLRulePatchModel.Action = core.StringPtr("allow")
				networkACLRulePatchModel.Before = networkACLRuleBeforePatchModel
				networkACLRulePatchModel.Code = core.Int64Ptr(int64(0))
				networkACLRulePatchModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePatchModel.DestinationPortMax = core.Int64Ptr(int64(22))
				networkACLRulePatchModel.DestinationPortMin = core.Int64Ptr(int64(22))
				networkACLRulePatchModel.Direction = core.StringPtr("inbound")
				networkACLRulePatchModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePatchModel.Source = core.StringPtr("10.0.0.0/0")
				networkACLRulePatchModel.SourcePortMax = core.Int64Ptr(int64(65535))
				networkACLRulePatchModel.SourcePortMin = core.Int64Ptr(int64(49152))
				networkACLRulePatchModel.Type = core.Int64Ptr(int64(8))
				networkACLRulePatchModelAsPatch, asPatchErr := networkACLRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateNetworkACLRuleOptions model
				updateNetworkACLRuleOptionsModel := new(vpcv1.UpdateNetworkACLRuleOptions)
				updateNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				updateNetworkACLRuleOptionsModel.ID = core.StringPtr("testString")
				updateNetworkACLRuleOptionsModel.NetworkACLRulePatch = networkACLRulePatchModelAsPatch
				updateNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateNetworkACLRuleWithContext(ctx, updateNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateNetworkACLRule(updateNetworkACLRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateNetworkACLRuleWithContext(ctx, updateNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateNetworkACLRulePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}`)
				}))
			})
			It(`Invoke UpdateNetworkACLRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateNetworkACLRule(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID model
				networkACLRuleBeforePatchModel := new(vpcv1.NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID)
				networkACLRuleBeforePatchModel.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

				// Construct an instance of the NetworkACLRulePatch model
				networkACLRulePatchModel := new(vpcv1.NetworkACLRulePatch)
				networkACLRulePatchModel.Action = core.StringPtr("allow")
				networkACLRulePatchModel.Before = networkACLRuleBeforePatchModel
				networkACLRulePatchModel.Code = core.Int64Ptr(int64(0))
				networkACLRulePatchModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePatchModel.DestinationPortMax = core.Int64Ptr(int64(22))
				networkACLRulePatchModel.DestinationPortMin = core.Int64Ptr(int64(22))
				networkACLRulePatchModel.Direction = core.StringPtr("inbound")
				networkACLRulePatchModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePatchModel.Source = core.StringPtr("10.0.0.0/0")
				networkACLRulePatchModel.SourcePortMax = core.Int64Ptr(int64(65535))
				networkACLRulePatchModel.SourcePortMin = core.Int64Ptr(int64(49152))
				networkACLRulePatchModel.Type = core.Int64Ptr(int64(8))
				networkACLRulePatchModelAsPatch, asPatchErr := networkACLRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateNetworkACLRuleOptions model
				updateNetworkACLRuleOptionsModel := new(vpcv1.UpdateNetworkACLRuleOptions)
				updateNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				updateNetworkACLRuleOptionsModel.ID = core.StringPtr("testString")
				updateNetworkACLRuleOptionsModel.NetworkACLRulePatch = networkACLRulePatchModelAsPatch
				updateNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateNetworkACLRule(updateNetworkACLRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateNetworkACLRule with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID model
				networkACLRuleBeforePatchModel := new(vpcv1.NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID)
				networkACLRuleBeforePatchModel.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

				// Construct an instance of the NetworkACLRulePatch model
				networkACLRulePatchModel := new(vpcv1.NetworkACLRulePatch)
				networkACLRulePatchModel.Action = core.StringPtr("allow")
				networkACLRulePatchModel.Before = networkACLRuleBeforePatchModel
				networkACLRulePatchModel.Code = core.Int64Ptr(int64(0))
				networkACLRulePatchModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePatchModel.DestinationPortMax = core.Int64Ptr(int64(22))
				networkACLRulePatchModel.DestinationPortMin = core.Int64Ptr(int64(22))
				networkACLRulePatchModel.Direction = core.StringPtr("inbound")
				networkACLRulePatchModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePatchModel.Source = core.StringPtr("10.0.0.0/0")
				networkACLRulePatchModel.SourcePortMax = core.Int64Ptr(int64(65535))
				networkACLRulePatchModel.SourcePortMin = core.Int64Ptr(int64(49152))
				networkACLRulePatchModel.Type = core.Int64Ptr(int64(8))
				networkACLRulePatchModelAsPatch, asPatchErr := networkACLRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateNetworkACLRuleOptions model
				updateNetworkACLRuleOptionsModel := new(vpcv1.UpdateNetworkACLRuleOptions)
				updateNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				updateNetworkACLRuleOptionsModel.ID = core.StringPtr("testString")
				updateNetworkACLRuleOptionsModel.NetworkACLRulePatch = networkACLRulePatchModelAsPatch
				updateNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateNetworkACLRule(updateNetworkACLRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateNetworkACLRuleOptions model with no property values
				updateNetworkACLRuleOptionsModelNew := new(vpcv1.UpdateNetworkACLRuleOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateNetworkACLRule(updateNetworkACLRuleOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateNetworkACLRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID model
				networkACLRuleBeforePatchModel := new(vpcv1.NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID)
				networkACLRuleBeforePatchModel.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

				// Construct an instance of the NetworkACLRulePatch model
				networkACLRulePatchModel := new(vpcv1.NetworkACLRulePatch)
				networkACLRulePatchModel.Action = core.StringPtr("allow")
				networkACLRulePatchModel.Before = networkACLRuleBeforePatchModel
				networkACLRulePatchModel.Code = core.Int64Ptr(int64(0))
				networkACLRulePatchModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePatchModel.DestinationPortMax = core.Int64Ptr(int64(22))
				networkACLRulePatchModel.DestinationPortMin = core.Int64Ptr(int64(22))
				networkACLRulePatchModel.Direction = core.StringPtr("inbound")
				networkACLRulePatchModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePatchModel.Source = core.StringPtr("10.0.0.0/0")
				networkACLRulePatchModel.SourcePortMax = core.Int64Ptr(int64(65535))
				networkACLRulePatchModel.SourcePortMin = core.Int64Ptr(int64(49152))
				networkACLRulePatchModel.Type = core.Int64Ptr(int64(8))
				networkACLRulePatchModelAsPatch, asPatchErr := networkACLRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateNetworkACLRuleOptions model
				updateNetworkACLRuleOptionsModel := new(vpcv1.UpdateNetworkACLRuleOptions)
				updateNetworkACLRuleOptionsModel.NetworkACLID = core.StringPtr("testString")
				updateNetworkACLRuleOptionsModel.ID = core.StringPtr("testString")
				updateNetworkACLRuleOptionsModel.NetworkACLRulePatch = networkACLRulePatchModelAsPatch
				updateNetworkACLRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateNetworkACLRule(updateNetworkACLRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListPlacementGroups(listPlacementGroupsOptions *ListPlacementGroupsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listPlacementGroupsPath := "/placement_groups"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPlacementGroupsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListPlacementGroups with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPlacementGroupsOptions model
				listPlacementGroupsOptionsModel := new(vpcv1.ListPlacementGroupsOptions)
				listPlacementGroupsOptionsModel.Start = core.StringPtr("testString")
				listPlacementGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPlacementGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListPlacementGroups(listPlacementGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListPlacementGroups(listPlacementGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListPlacementGroups(listPlacementGroupsOptions *ListPlacementGroupsOptions)`, func() {
		version := "2024-06-23"
		listPlacementGroupsPath := "/placement_groups"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPlacementGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "placement_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListPlacementGroups successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListPlacementGroupsOptions model
				listPlacementGroupsOptionsModel := new(vpcv1.ListPlacementGroupsOptions)
				listPlacementGroupsOptionsModel.Start = core.StringPtr("testString")
				listPlacementGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPlacementGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListPlacementGroupsWithContext(ctx, listPlacementGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListPlacementGroups(listPlacementGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListPlacementGroupsWithContext(ctx, listPlacementGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPlacementGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "placement_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListPlacementGroups successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListPlacementGroups(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListPlacementGroupsOptions model
				listPlacementGroupsOptionsModel := new(vpcv1.ListPlacementGroupsOptions)
				listPlacementGroupsOptionsModel.Start = core.StringPtr("testString")
				listPlacementGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPlacementGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListPlacementGroups(listPlacementGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListPlacementGroups with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPlacementGroupsOptions model
				listPlacementGroupsOptionsModel := new(vpcv1.ListPlacementGroupsOptions)
				listPlacementGroupsOptionsModel.Start = core.StringPtr("testString")
				listPlacementGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPlacementGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListPlacementGroups(listPlacementGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListPlacementGroups successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPlacementGroupsOptions model
				listPlacementGroupsOptionsModel := new(vpcv1.ListPlacementGroupsOptions)
				listPlacementGroupsOptionsModel.Start = core.StringPtr("testString")
				listPlacementGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPlacementGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListPlacementGroups(listPlacementGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.PlacementGroupCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.PlacementGroupCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.PlacementGroupCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPlacementGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r006-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r006-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use PlacementGroupsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listPlacementGroupsOptionsModel := &vpcv1.ListPlacementGroupsOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewPlacementGroupsPager(listPlacementGroupsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.PlacementGroup
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use PlacementGroupsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listPlacementGroupsOptionsModel := &vpcv1.ListPlacementGroupsOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewPlacementGroupsPager(listPlacementGroupsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreatePlacementGroup(createPlacementGroupOptions *CreatePlacementGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createPlacementGroupPath := "/placement_groups"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPlacementGroupPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreatePlacementGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePlacementGroupOptions model
				createPlacementGroupOptionsModel := new(vpcv1.CreatePlacementGroupOptions)
				createPlacementGroupOptionsModel.Strategy = core.StringPtr("host_spread")
				createPlacementGroupOptionsModel.Name = core.StringPtr("my-placement-group")
				createPlacementGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreatePlacementGroup(createPlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreatePlacementGroup(createPlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreatePlacementGroup(createPlacementGroupOptions *CreatePlacementGroupOptions)`, func() {
		version := "2024-06-23"
		createPlacementGroupPath := "/placement_groups"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPlacementGroupPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}`)
				}))
			})
			It(`Invoke CreatePlacementGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePlacementGroupOptions model
				createPlacementGroupOptionsModel := new(vpcv1.CreatePlacementGroupOptions)
				createPlacementGroupOptionsModel.Strategy = core.StringPtr("host_spread")
				createPlacementGroupOptionsModel.Name = core.StringPtr("my-placement-group")
				createPlacementGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreatePlacementGroupWithContext(ctx, createPlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreatePlacementGroup(createPlacementGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreatePlacementGroupWithContext(ctx, createPlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPlacementGroupPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}`)
				}))
			})
			It(`Invoke CreatePlacementGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreatePlacementGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePlacementGroupOptions model
				createPlacementGroupOptionsModel := new(vpcv1.CreatePlacementGroupOptions)
				createPlacementGroupOptionsModel.Strategy = core.StringPtr("host_spread")
				createPlacementGroupOptionsModel.Name = core.StringPtr("my-placement-group")
				createPlacementGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreatePlacementGroup(createPlacementGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreatePlacementGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePlacementGroupOptions model
				createPlacementGroupOptionsModel := new(vpcv1.CreatePlacementGroupOptions)
				createPlacementGroupOptionsModel.Strategy = core.StringPtr("host_spread")
				createPlacementGroupOptionsModel.Name = core.StringPtr("my-placement-group")
				createPlacementGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreatePlacementGroup(createPlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreatePlacementGroupOptions model with no property values
				createPlacementGroupOptionsModelNew := new(vpcv1.CreatePlacementGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreatePlacementGroup(createPlacementGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreatePlacementGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePlacementGroupOptions model
				createPlacementGroupOptionsModel := new(vpcv1.CreatePlacementGroupOptions)
				createPlacementGroupOptionsModel.Strategy = core.StringPtr("host_spread")
				createPlacementGroupOptionsModel.Name = core.StringPtr("my-placement-group")
				createPlacementGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreatePlacementGroup(createPlacementGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeletePlacementGroup(deletePlacementGroupOptions *DeletePlacementGroupOptions)`, func() {
		version := "2024-06-23"
		deletePlacementGroupPath := "/placement_groups/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deletePlacementGroupPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeletePlacementGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeletePlacementGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeletePlacementGroupOptions model
				deletePlacementGroupOptionsModel := new(vpcv1.DeletePlacementGroupOptions)
				deletePlacementGroupOptionsModel.ID = core.StringPtr("testString")
				deletePlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeletePlacementGroup(deletePlacementGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeletePlacementGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeletePlacementGroupOptions model
				deletePlacementGroupOptionsModel := new(vpcv1.DeletePlacementGroupOptions)
				deletePlacementGroupOptionsModel.ID = core.StringPtr("testString")
				deletePlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeletePlacementGroup(deletePlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeletePlacementGroupOptions model with no property values
				deletePlacementGroupOptionsModelNew := new(vpcv1.DeletePlacementGroupOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeletePlacementGroup(deletePlacementGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetPlacementGroup(getPlacementGroupOptions *GetPlacementGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getPlacementGroupPath := "/placement_groups/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPlacementGroupPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetPlacementGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPlacementGroupOptions model
				getPlacementGroupOptionsModel := new(vpcv1.GetPlacementGroupOptions)
				getPlacementGroupOptionsModel.ID = core.StringPtr("testString")
				getPlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetPlacementGroup(getPlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetPlacementGroup(getPlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetPlacementGroup(getPlacementGroupOptions *GetPlacementGroupOptions)`, func() {
		version := "2024-06-23"
		getPlacementGroupPath := "/placement_groups/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPlacementGroupPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}`)
				}))
			})
			It(`Invoke GetPlacementGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetPlacementGroupOptions model
				getPlacementGroupOptionsModel := new(vpcv1.GetPlacementGroupOptions)
				getPlacementGroupOptionsModel.ID = core.StringPtr("testString")
				getPlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetPlacementGroupWithContext(ctx, getPlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetPlacementGroup(getPlacementGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetPlacementGroupWithContext(ctx, getPlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPlacementGroupPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}`)
				}))
			})
			It(`Invoke GetPlacementGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetPlacementGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetPlacementGroupOptions model
				getPlacementGroupOptionsModel := new(vpcv1.GetPlacementGroupOptions)
				getPlacementGroupOptionsModel.ID = core.StringPtr("testString")
				getPlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetPlacementGroup(getPlacementGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetPlacementGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPlacementGroupOptions model
				getPlacementGroupOptionsModel := new(vpcv1.GetPlacementGroupOptions)
				getPlacementGroupOptionsModel.ID = core.StringPtr("testString")
				getPlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetPlacementGroup(getPlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetPlacementGroupOptions model with no property values
				getPlacementGroupOptionsModelNew := new(vpcv1.GetPlacementGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetPlacementGroup(getPlacementGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetPlacementGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPlacementGroupOptions model
				getPlacementGroupOptionsModel := new(vpcv1.GetPlacementGroupOptions)
				getPlacementGroupOptionsModel.ID = core.StringPtr("testString")
				getPlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetPlacementGroup(getPlacementGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdatePlacementGroup(updatePlacementGroupOptions *UpdatePlacementGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updatePlacementGroupPath := "/placement_groups/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePlacementGroupPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdatePlacementGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the PlacementGroupPatch model
				placementGroupPatchModel := new(vpcv1.PlacementGroupPatch)
				placementGroupPatchModel.Name = core.StringPtr("my-placement-group-updated")
				placementGroupPatchModelAsPatch, asPatchErr := placementGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePlacementGroupOptions model
				updatePlacementGroupOptionsModel := new(vpcv1.UpdatePlacementGroupOptions)
				updatePlacementGroupOptionsModel.ID = core.StringPtr("testString")
				updatePlacementGroupOptionsModel.PlacementGroupPatch = placementGroupPatchModelAsPatch
				updatePlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdatePlacementGroup(updatePlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdatePlacementGroup(updatePlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdatePlacementGroup(updatePlacementGroupOptions *UpdatePlacementGroupOptions)`, func() {
		version := "2024-06-23"
		updatePlacementGroupPath := "/placement_groups/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePlacementGroupPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}`)
				}))
			})
			It(`Invoke UpdatePlacementGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the PlacementGroupPatch model
				placementGroupPatchModel := new(vpcv1.PlacementGroupPatch)
				placementGroupPatchModel.Name = core.StringPtr("my-placement-group-updated")
				placementGroupPatchModelAsPatch, asPatchErr := placementGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePlacementGroupOptions model
				updatePlacementGroupOptionsModel := new(vpcv1.UpdatePlacementGroupOptions)
				updatePlacementGroupOptionsModel.ID = core.StringPtr("testString")
				updatePlacementGroupOptionsModel.PlacementGroupPatch = placementGroupPatchModelAsPatch
				updatePlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdatePlacementGroupWithContext(ctx, updatePlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdatePlacementGroup(updatePlacementGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdatePlacementGroupWithContext(ctx, updatePlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePlacementGroupPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}`)
				}))
			})
			It(`Invoke UpdatePlacementGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdatePlacementGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the PlacementGroupPatch model
				placementGroupPatchModel := new(vpcv1.PlacementGroupPatch)
				placementGroupPatchModel.Name = core.StringPtr("my-placement-group-updated")
				placementGroupPatchModelAsPatch, asPatchErr := placementGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePlacementGroupOptions model
				updatePlacementGroupOptionsModel := new(vpcv1.UpdatePlacementGroupOptions)
				updatePlacementGroupOptionsModel.ID = core.StringPtr("testString")
				updatePlacementGroupOptionsModel.PlacementGroupPatch = placementGroupPatchModelAsPatch
				updatePlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdatePlacementGroup(updatePlacementGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdatePlacementGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the PlacementGroupPatch model
				placementGroupPatchModel := new(vpcv1.PlacementGroupPatch)
				placementGroupPatchModel.Name = core.StringPtr("my-placement-group-updated")
				placementGroupPatchModelAsPatch, asPatchErr := placementGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePlacementGroupOptions model
				updatePlacementGroupOptionsModel := new(vpcv1.UpdatePlacementGroupOptions)
				updatePlacementGroupOptionsModel.ID = core.StringPtr("testString")
				updatePlacementGroupOptionsModel.PlacementGroupPatch = placementGroupPatchModelAsPatch
				updatePlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdatePlacementGroup(updatePlacementGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdatePlacementGroupOptions model with no property values
				updatePlacementGroupOptionsModelNew := new(vpcv1.UpdatePlacementGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdatePlacementGroup(updatePlacementGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdatePlacementGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the PlacementGroupPatch model
				placementGroupPatchModel := new(vpcv1.PlacementGroupPatch)
				placementGroupPatchModel.Name = core.StringPtr("my-placement-group-updated")
				placementGroupPatchModelAsPatch, asPatchErr := placementGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePlacementGroupOptions model
				updatePlacementGroupOptionsModel := new(vpcv1.UpdatePlacementGroupOptions)
				updatePlacementGroupOptionsModel.ID = core.StringPtr("testString")
				updatePlacementGroupOptionsModel.PlacementGroupPatch = placementGroupPatchModelAsPatch
				updatePlacementGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdatePlacementGroup(updatePlacementGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListPrivatePathServiceGateways(listPrivatePathServiceGatewaysOptions *ListPrivatePathServiceGatewaysOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listPrivatePathServiceGatewaysPath := "/private_path_service_gateways"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPrivatePathServiceGatewaysPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListPrivatePathServiceGateways with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPrivatePathServiceGatewaysOptions model
				listPrivatePathServiceGatewaysOptionsModel := new(vpcv1.ListPrivatePathServiceGatewaysOptions)
				listPrivatePathServiceGatewaysOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPrivatePathServiceGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListPrivatePathServiceGateways(listPrivatePathServiceGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListPrivatePathServiceGateways(listPrivatePathServiceGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListPrivatePathServiceGateways(listPrivatePathServiceGatewaysOptions *ListPrivatePathServiceGatewaysOptions)`, func() {
		version := "2024-06-23"
		listPrivatePathServiceGatewaysPath := "/private_path_service_gateways"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPrivatePathServiceGatewaysPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "private_path_service_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": false}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListPrivatePathServiceGateways successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListPrivatePathServiceGatewaysOptions model
				listPrivatePathServiceGatewaysOptionsModel := new(vpcv1.ListPrivatePathServiceGatewaysOptions)
				listPrivatePathServiceGatewaysOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPrivatePathServiceGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListPrivatePathServiceGatewaysWithContext(ctx, listPrivatePathServiceGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListPrivatePathServiceGateways(listPrivatePathServiceGatewaysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListPrivatePathServiceGatewaysWithContext(ctx, listPrivatePathServiceGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPrivatePathServiceGatewaysPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "private_path_service_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": false}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListPrivatePathServiceGateways successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListPrivatePathServiceGateways(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListPrivatePathServiceGatewaysOptions model
				listPrivatePathServiceGatewaysOptionsModel := new(vpcv1.ListPrivatePathServiceGatewaysOptions)
				listPrivatePathServiceGatewaysOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPrivatePathServiceGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListPrivatePathServiceGateways(listPrivatePathServiceGatewaysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListPrivatePathServiceGateways with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPrivatePathServiceGatewaysOptions model
				listPrivatePathServiceGatewaysOptionsModel := new(vpcv1.ListPrivatePathServiceGatewaysOptions)
				listPrivatePathServiceGatewaysOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPrivatePathServiceGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListPrivatePathServiceGateways(listPrivatePathServiceGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListPrivatePathServiceGateways successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPrivatePathServiceGatewaysOptions model
				listPrivatePathServiceGatewaysOptionsModel := new(vpcv1.ListPrivatePathServiceGatewaysOptions)
				listPrivatePathServiceGatewaysOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPrivatePathServiceGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListPrivatePathServiceGateways(listPrivatePathServiceGatewaysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.PrivatePathServiceGatewayCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.PrivatePathServiceGatewayCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.PrivatePathServiceGatewayCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPrivatePathServiceGatewaysPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"private_path_service_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5","default_access_policy":"deny","endpoint_gateway_binding_auto_delete":true,"endpoint_gateway_binding_auto_delete_timeout":1,"endpoint_gateway_count":0,"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5","id":"r006-7268d425-59b7-48fd-9735-81a7271657d5","lifecycle_state":"stable","load_balancer":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727","name":"my-load-balancer","resource_type":"load_balancer"},"name":"my-private-path-service-gateway","published":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"private_path_service_gateway","service_endpoints":["*.example.com"],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zonal_affinity":false}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"private_path_service_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5","default_access_policy":"deny","endpoint_gateway_binding_auto_delete":true,"endpoint_gateway_binding_auto_delete_timeout":1,"endpoint_gateway_count":0,"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5","id":"r006-7268d425-59b7-48fd-9735-81a7271657d5","lifecycle_state":"stable","load_balancer":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727","name":"my-load-balancer","resource_type":"load_balancer"},"name":"my-private-path-service-gateway","published":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"private_path_service_gateway","service_endpoints":["*.example.com"],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zonal_affinity":false}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use PrivatePathServiceGatewaysPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listPrivatePathServiceGatewaysOptionsModel := &vpcv1.ListPrivatePathServiceGatewaysOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewPrivatePathServiceGatewaysPager(listPrivatePathServiceGatewaysOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.PrivatePathServiceGateway
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use PrivatePathServiceGatewaysPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listPrivatePathServiceGatewaysOptionsModel := &vpcv1.ListPrivatePathServiceGatewaysOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewPrivatePathServiceGatewaysPager(listPrivatePathServiceGatewaysOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreatePrivatePathServiceGateway(createPrivatePathServiceGatewayOptions *CreatePrivatePathServiceGatewayOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createPrivatePathServiceGatewayPath := "/private_path_service_gateways"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPrivatePathServiceGatewayPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreatePrivatePathServiceGateway with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePrivatePathServiceGatewayOptions model
				createPrivatePathServiceGatewayOptionsModel := new(vpcv1.CreatePrivatePathServiceGatewayOptions)
				createPrivatePathServiceGatewayOptionsModel.LoadBalancer = loadBalancerIdentityModel
				createPrivatePathServiceGatewayOptionsModel.ServiceEndpoints = []string{"*.example.com"}
				createPrivatePathServiceGatewayOptionsModel.DefaultAccessPolicy = core.StringPtr("deny")
				createPrivatePathServiceGatewayOptionsModel.Name = core.StringPtr("my-private-path-service-gateway")
				createPrivatePathServiceGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPrivatePathServiceGatewayOptionsModel.ZonalAffinity = core.BoolPtr(false)
				createPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreatePrivatePathServiceGateway(createPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreatePrivatePathServiceGateway(createPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreatePrivatePathServiceGateway(createPrivatePathServiceGatewayOptions *CreatePrivatePathServiceGatewayOptions)`, func() {
		version := "2024-06-23"
		createPrivatePathServiceGatewayPath := "/private_path_service_gateways"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPrivatePathServiceGatewayPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": false}`)
				}))
			})
			It(`Invoke CreatePrivatePathServiceGateway successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePrivatePathServiceGatewayOptions model
				createPrivatePathServiceGatewayOptionsModel := new(vpcv1.CreatePrivatePathServiceGatewayOptions)
				createPrivatePathServiceGatewayOptionsModel.LoadBalancer = loadBalancerIdentityModel
				createPrivatePathServiceGatewayOptionsModel.ServiceEndpoints = []string{"*.example.com"}
				createPrivatePathServiceGatewayOptionsModel.DefaultAccessPolicy = core.StringPtr("deny")
				createPrivatePathServiceGatewayOptionsModel.Name = core.StringPtr("my-private-path-service-gateway")
				createPrivatePathServiceGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPrivatePathServiceGatewayOptionsModel.ZonalAffinity = core.BoolPtr(false)
				createPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreatePrivatePathServiceGatewayWithContext(ctx, createPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreatePrivatePathServiceGateway(createPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreatePrivatePathServiceGatewayWithContext(ctx, createPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPrivatePathServiceGatewayPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": false}`)
				}))
			})
			It(`Invoke CreatePrivatePathServiceGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreatePrivatePathServiceGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePrivatePathServiceGatewayOptions model
				createPrivatePathServiceGatewayOptionsModel := new(vpcv1.CreatePrivatePathServiceGatewayOptions)
				createPrivatePathServiceGatewayOptionsModel.LoadBalancer = loadBalancerIdentityModel
				createPrivatePathServiceGatewayOptionsModel.ServiceEndpoints = []string{"*.example.com"}
				createPrivatePathServiceGatewayOptionsModel.DefaultAccessPolicy = core.StringPtr("deny")
				createPrivatePathServiceGatewayOptionsModel.Name = core.StringPtr("my-private-path-service-gateway")
				createPrivatePathServiceGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPrivatePathServiceGatewayOptionsModel.ZonalAffinity = core.BoolPtr(false)
				createPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreatePrivatePathServiceGateway(createPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreatePrivatePathServiceGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePrivatePathServiceGatewayOptions model
				createPrivatePathServiceGatewayOptionsModel := new(vpcv1.CreatePrivatePathServiceGatewayOptions)
				createPrivatePathServiceGatewayOptionsModel.LoadBalancer = loadBalancerIdentityModel
				createPrivatePathServiceGatewayOptionsModel.ServiceEndpoints = []string{"*.example.com"}
				createPrivatePathServiceGatewayOptionsModel.DefaultAccessPolicy = core.StringPtr("deny")
				createPrivatePathServiceGatewayOptionsModel.Name = core.StringPtr("my-private-path-service-gateway")
				createPrivatePathServiceGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPrivatePathServiceGatewayOptionsModel.ZonalAffinity = core.BoolPtr(false)
				createPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreatePrivatePathServiceGateway(createPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreatePrivatePathServiceGatewayOptions model with no property values
				createPrivatePathServiceGatewayOptionsModelNew := new(vpcv1.CreatePrivatePathServiceGatewayOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreatePrivatePathServiceGateway(createPrivatePathServiceGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreatePrivatePathServiceGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePrivatePathServiceGatewayOptions model
				createPrivatePathServiceGatewayOptionsModel := new(vpcv1.CreatePrivatePathServiceGatewayOptions)
				createPrivatePathServiceGatewayOptionsModel.LoadBalancer = loadBalancerIdentityModel
				createPrivatePathServiceGatewayOptionsModel.ServiceEndpoints = []string{"*.example.com"}
				createPrivatePathServiceGatewayOptionsModel.DefaultAccessPolicy = core.StringPtr("deny")
				createPrivatePathServiceGatewayOptionsModel.Name = core.StringPtr("my-private-path-service-gateway")
				createPrivatePathServiceGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPrivatePathServiceGatewayOptionsModel.ZonalAffinity = core.BoolPtr(false)
				createPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreatePrivatePathServiceGateway(createPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeletePrivatePathServiceGateway(deletePrivatePathServiceGatewayOptions *DeletePrivatePathServiceGatewayOptions)`, func() {
		version := "2024-06-23"
		deletePrivatePathServiceGatewayPath := "/private_path_service_gateways/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deletePrivatePathServiceGatewayPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeletePrivatePathServiceGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeletePrivatePathServiceGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeletePrivatePathServiceGatewayOptions model
				deletePrivatePathServiceGatewayOptionsModel := new(vpcv1.DeletePrivatePathServiceGatewayOptions)
				deletePrivatePathServiceGatewayOptionsModel.ID = core.StringPtr("testString")
				deletePrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeletePrivatePathServiceGateway(deletePrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeletePrivatePathServiceGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeletePrivatePathServiceGatewayOptions model
				deletePrivatePathServiceGatewayOptionsModel := new(vpcv1.DeletePrivatePathServiceGatewayOptions)
				deletePrivatePathServiceGatewayOptionsModel.ID = core.StringPtr("testString")
				deletePrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeletePrivatePathServiceGateway(deletePrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeletePrivatePathServiceGatewayOptions model with no property values
				deletePrivatePathServiceGatewayOptionsModelNew := new(vpcv1.DeletePrivatePathServiceGatewayOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeletePrivatePathServiceGateway(deletePrivatePathServiceGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetPrivatePathServiceGateway(getPrivatePathServiceGatewayOptions *GetPrivatePathServiceGatewayOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getPrivatePathServiceGatewayPath := "/private_path_service_gateways/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPrivatePathServiceGatewayPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetPrivatePathServiceGateway with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPrivatePathServiceGatewayOptions model
				getPrivatePathServiceGatewayOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayOptions)
				getPrivatePathServiceGatewayOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetPrivatePathServiceGateway(getPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetPrivatePathServiceGateway(getPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetPrivatePathServiceGateway(getPrivatePathServiceGatewayOptions *GetPrivatePathServiceGatewayOptions)`, func() {
		version := "2024-06-23"
		getPrivatePathServiceGatewayPath := "/private_path_service_gateways/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPrivatePathServiceGatewayPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": false}`)
				}))
			})
			It(`Invoke GetPrivatePathServiceGateway successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetPrivatePathServiceGatewayOptions model
				getPrivatePathServiceGatewayOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayOptions)
				getPrivatePathServiceGatewayOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetPrivatePathServiceGatewayWithContext(ctx, getPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetPrivatePathServiceGateway(getPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetPrivatePathServiceGatewayWithContext(ctx, getPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPrivatePathServiceGatewayPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": false}`)
				}))
			})
			It(`Invoke GetPrivatePathServiceGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetPrivatePathServiceGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetPrivatePathServiceGatewayOptions model
				getPrivatePathServiceGatewayOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayOptions)
				getPrivatePathServiceGatewayOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetPrivatePathServiceGateway(getPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetPrivatePathServiceGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPrivatePathServiceGatewayOptions model
				getPrivatePathServiceGatewayOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayOptions)
				getPrivatePathServiceGatewayOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetPrivatePathServiceGateway(getPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetPrivatePathServiceGatewayOptions model with no property values
				getPrivatePathServiceGatewayOptionsModelNew := new(vpcv1.GetPrivatePathServiceGatewayOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetPrivatePathServiceGateway(getPrivatePathServiceGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetPrivatePathServiceGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPrivatePathServiceGatewayOptions model
				getPrivatePathServiceGatewayOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayOptions)
				getPrivatePathServiceGatewayOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetPrivatePathServiceGateway(getPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdatePrivatePathServiceGateway(updatePrivatePathServiceGatewayOptions *UpdatePrivatePathServiceGatewayOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updatePrivatePathServiceGatewayPath := "/private_path_service_gateways/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePrivatePathServiceGatewayPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdatePrivatePathServiceGateway with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the PrivatePathServiceGatewayPatch model
				privatePathServiceGatewayPatchModel := new(vpcv1.PrivatePathServiceGatewayPatch)
				privatePathServiceGatewayPatchModel.DefaultAccessPolicy = core.StringPtr("deny")
				privatePathServiceGatewayPatchModel.LoadBalancer = loadBalancerIdentityModel
				privatePathServiceGatewayPatchModel.Name = core.StringPtr("my-private-path-service-gateway")
				privatePathServiceGatewayPatchModel.ZonalAffinity = core.BoolPtr(true)
				privatePathServiceGatewayPatchModelAsPatch, asPatchErr := privatePathServiceGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePrivatePathServiceGatewayOptions model
				updatePrivatePathServiceGatewayOptionsModel := new(vpcv1.UpdatePrivatePathServiceGatewayOptions)
				updatePrivatePathServiceGatewayOptionsModel.ID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayPatch = privatePathServiceGatewayPatchModelAsPatch
				updatePrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdatePrivatePathServiceGateway(updatePrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdatePrivatePathServiceGateway(updatePrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdatePrivatePathServiceGateway(updatePrivatePathServiceGatewayOptions *UpdatePrivatePathServiceGatewayOptions)`, func() {
		version := "2024-06-23"
		updatePrivatePathServiceGatewayPath := "/private_path_service_gateways/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePrivatePathServiceGatewayPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": false}`)
				}))
			})
			It(`Invoke UpdatePrivatePathServiceGateway successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the PrivatePathServiceGatewayPatch model
				privatePathServiceGatewayPatchModel := new(vpcv1.PrivatePathServiceGatewayPatch)
				privatePathServiceGatewayPatchModel.DefaultAccessPolicy = core.StringPtr("deny")
				privatePathServiceGatewayPatchModel.LoadBalancer = loadBalancerIdentityModel
				privatePathServiceGatewayPatchModel.Name = core.StringPtr("my-private-path-service-gateway")
				privatePathServiceGatewayPatchModel.ZonalAffinity = core.BoolPtr(true)
				privatePathServiceGatewayPatchModelAsPatch, asPatchErr := privatePathServiceGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePrivatePathServiceGatewayOptions model
				updatePrivatePathServiceGatewayOptionsModel := new(vpcv1.UpdatePrivatePathServiceGatewayOptions)
				updatePrivatePathServiceGatewayOptionsModel.ID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayPatch = privatePathServiceGatewayPatchModelAsPatch
				updatePrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdatePrivatePathServiceGatewayWithContext(ctx, updatePrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdatePrivatePathServiceGateway(updatePrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdatePrivatePathServiceGatewayWithContext(ctx, updatePrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePrivatePathServiceGatewayPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": false}`)
				}))
			})
			It(`Invoke UpdatePrivatePathServiceGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdatePrivatePathServiceGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the PrivatePathServiceGatewayPatch model
				privatePathServiceGatewayPatchModel := new(vpcv1.PrivatePathServiceGatewayPatch)
				privatePathServiceGatewayPatchModel.DefaultAccessPolicy = core.StringPtr("deny")
				privatePathServiceGatewayPatchModel.LoadBalancer = loadBalancerIdentityModel
				privatePathServiceGatewayPatchModel.Name = core.StringPtr("my-private-path-service-gateway")
				privatePathServiceGatewayPatchModel.ZonalAffinity = core.BoolPtr(true)
				privatePathServiceGatewayPatchModelAsPatch, asPatchErr := privatePathServiceGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePrivatePathServiceGatewayOptions model
				updatePrivatePathServiceGatewayOptionsModel := new(vpcv1.UpdatePrivatePathServiceGatewayOptions)
				updatePrivatePathServiceGatewayOptionsModel.ID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayPatch = privatePathServiceGatewayPatchModelAsPatch
				updatePrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdatePrivatePathServiceGateway(updatePrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdatePrivatePathServiceGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the PrivatePathServiceGatewayPatch model
				privatePathServiceGatewayPatchModel := new(vpcv1.PrivatePathServiceGatewayPatch)
				privatePathServiceGatewayPatchModel.DefaultAccessPolicy = core.StringPtr("deny")
				privatePathServiceGatewayPatchModel.LoadBalancer = loadBalancerIdentityModel
				privatePathServiceGatewayPatchModel.Name = core.StringPtr("my-private-path-service-gateway")
				privatePathServiceGatewayPatchModel.ZonalAffinity = core.BoolPtr(true)
				privatePathServiceGatewayPatchModelAsPatch, asPatchErr := privatePathServiceGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePrivatePathServiceGatewayOptions model
				updatePrivatePathServiceGatewayOptionsModel := new(vpcv1.UpdatePrivatePathServiceGatewayOptions)
				updatePrivatePathServiceGatewayOptionsModel.ID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayPatch = privatePathServiceGatewayPatchModelAsPatch
				updatePrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdatePrivatePathServiceGateway(updatePrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdatePrivatePathServiceGatewayOptions model with no property values
				updatePrivatePathServiceGatewayOptionsModelNew := new(vpcv1.UpdatePrivatePathServiceGatewayOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdatePrivatePathServiceGateway(updatePrivatePathServiceGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdatePrivatePathServiceGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

				// Construct an instance of the PrivatePathServiceGatewayPatch model
				privatePathServiceGatewayPatchModel := new(vpcv1.PrivatePathServiceGatewayPatch)
				privatePathServiceGatewayPatchModel.DefaultAccessPolicy = core.StringPtr("deny")
				privatePathServiceGatewayPatchModel.LoadBalancer = loadBalancerIdentityModel
				privatePathServiceGatewayPatchModel.Name = core.StringPtr("my-private-path-service-gateway")
				privatePathServiceGatewayPatchModel.ZonalAffinity = core.BoolPtr(true)
				privatePathServiceGatewayPatchModelAsPatch, asPatchErr := privatePathServiceGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePrivatePathServiceGatewayOptions model
				updatePrivatePathServiceGatewayOptionsModel := new(vpcv1.UpdatePrivatePathServiceGatewayOptions)
				updatePrivatePathServiceGatewayOptionsModel.ID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayPatch = privatePathServiceGatewayPatchModelAsPatch
				updatePrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdatePrivatePathServiceGateway(updatePrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListPrivatePathServiceGatewayAccountPolicies(listPrivatePathServiceGatewayAccountPoliciesOptions *ListPrivatePathServiceGatewayAccountPoliciesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listPrivatePathServiceGatewayAccountPoliciesPath := "/private_path_service_gateways/testString/account_policies"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPrivatePathServiceGatewayAccountPoliciesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["account.id"]).To(Equal([]string{"bb1b52262f7441a586f49068482f1e60"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListPrivatePathServiceGatewayAccountPolicies with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPrivatePathServiceGatewayAccountPoliciesOptions model
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel := new(vpcv1.ListPrivatePathServiceGatewayAccountPoliciesOptions)
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListPrivatePathServiceGatewayAccountPolicies(listPrivatePathServiceGatewayAccountPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListPrivatePathServiceGatewayAccountPolicies(listPrivatePathServiceGatewayAccountPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListPrivatePathServiceGatewayAccountPolicies(listPrivatePathServiceGatewayAccountPoliciesOptions *ListPrivatePathServiceGatewayAccountPoliciesOptions)`, func() {
		version := "2024-06-23"
		listPrivatePathServiceGatewayAccountPoliciesPath := "/private_path_service_gateways/testString/account_policies"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPrivatePathServiceGatewayAccountPoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["account.id"]).To(Equal([]string{"bb1b52262f7441a586f49068482f1e60"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"account_policies": [{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "resource_type": "private_path_service_gateway_account_policy"}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListPrivatePathServiceGatewayAccountPolicies successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListPrivatePathServiceGatewayAccountPoliciesOptions model
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel := new(vpcv1.ListPrivatePathServiceGatewayAccountPoliciesOptions)
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListPrivatePathServiceGatewayAccountPoliciesWithContext(ctx, listPrivatePathServiceGatewayAccountPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListPrivatePathServiceGatewayAccountPolicies(listPrivatePathServiceGatewayAccountPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListPrivatePathServiceGatewayAccountPoliciesWithContext(ctx, listPrivatePathServiceGatewayAccountPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPrivatePathServiceGatewayAccountPoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["account.id"]).To(Equal([]string{"bb1b52262f7441a586f49068482f1e60"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"account_policies": [{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "resource_type": "private_path_service_gateway_account_policy"}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListPrivatePathServiceGatewayAccountPolicies successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListPrivatePathServiceGatewayAccountPolicies(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListPrivatePathServiceGatewayAccountPoliciesOptions model
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel := new(vpcv1.ListPrivatePathServiceGatewayAccountPoliciesOptions)
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListPrivatePathServiceGatewayAccountPolicies(listPrivatePathServiceGatewayAccountPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListPrivatePathServiceGatewayAccountPolicies with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPrivatePathServiceGatewayAccountPoliciesOptions model
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel := new(vpcv1.ListPrivatePathServiceGatewayAccountPoliciesOptions)
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListPrivatePathServiceGatewayAccountPolicies(listPrivatePathServiceGatewayAccountPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListPrivatePathServiceGatewayAccountPoliciesOptions model with no property values
				listPrivatePathServiceGatewayAccountPoliciesOptionsModelNew := new(vpcv1.ListPrivatePathServiceGatewayAccountPoliciesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListPrivatePathServiceGatewayAccountPolicies(listPrivatePathServiceGatewayAccountPoliciesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListPrivatePathServiceGatewayAccountPolicies successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPrivatePathServiceGatewayAccountPoliciesOptions model
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel := new(vpcv1.ListPrivatePathServiceGatewayAccountPoliciesOptions)
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListPrivatePathServiceGatewayAccountPolicies(listPrivatePathServiceGatewayAccountPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.PrivatePathServiceGatewayAccountPolicyCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.PrivatePathServiceGatewayAccountPolicyCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.PrivatePathServiceGatewayAccountPolicyCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPrivatePathServiceGatewayAccountPoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"account_policies":[{"access_policy":"deny","account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c","id":"r006-7268d425-59b7-48fd-9735-81a7271657d5","resource_type":"private_path_service_gateway_account_policy"}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"account_policies":[{"access_policy":"deny","account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c","id":"r006-7268d425-59b7-48fd-9735-81a7271657d5","resource_type":"private_path_service_gateway_account_policy"}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use PrivatePathServiceGatewayAccountPoliciesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listPrivatePathServiceGatewayAccountPoliciesOptionsModel := &vpcv1.ListPrivatePathServiceGatewayAccountPoliciesOptions{
					PrivatePathServiceGatewayID: core.StringPtr("testString"),
					Limit:                       core.Int64Ptr(int64(10)),
					AccountID:                   core.StringPtr("bb1b52262f7441a586f49068482f1e60"),
				}

				pager, err := vpcService.NewPrivatePathServiceGatewayAccountPoliciesPager(listPrivatePathServiceGatewayAccountPoliciesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.PrivatePathServiceGatewayAccountPolicy
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use PrivatePathServiceGatewayAccountPoliciesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listPrivatePathServiceGatewayAccountPoliciesOptionsModel := &vpcv1.ListPrivatePathServiceGatewayAccountPoliciesOptions{
					PrivatePathServiceGatewayID: core.StringPtr("testString"),
					Limit:                       core.Int64Ptr(int64(10)),
					AccountID:                   core.StringPtr("bb1b52262f7441a586f49068482f1e60"),
				}

				pager, err := vpcService.NewPrivatePathServiceGatewayAccountPoliciesPager(listPrivatePathServiceGatewayAccountPoliciesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreatePrivatePathServiceGatewayAccountPolicy(createPrivatePathServiceGatewayAccountPolicyOptions *CreatePrivatePathServiceGatewayAccountPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createPrivatePathServiceGatewayAccountPolicyPath := "/private_path_service_gateways/testString/account_policies"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPrivatePathServiceGatewayAccountPolicyPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreatePrivatePathServiceGatewayAccountPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AccountIdentityByID model
				accountIdentityModel := new(vpcv1.AccountIdentityByID)
				accountIdentityModel.ID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")

				// Construct an instance of the CreatePrivatePathServiceGatewayAccountPolicyOptions model
				createPrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.CreatePrivatePathServiceGatewayAccountPolicyOptions)
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.AccessPolicy = core.StringPtr("deny")
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.Account = accountIdentityModel
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreatePrivatePathServiceGatewayAccountPolicy(createPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreatePrivatePathServiceGatewayAccountPolicy(createPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreatePrivatePathServiceGatewayAccountPolicy(createPrivatePathServiceGatewayAccountPolicyOptions *CreatePrivatePathServiceGatewayAccountPolicyOptions)`, func() {
		version := "2024-06-23"
		createPrivatePathServiceGatewayAccountPolicyPath := "/private_path_service_gateways/testString/account_policies"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPrivatePathServiceGatewayAccountPolicyPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "resource_type": "private_path_service_gateway_account_policy"}`)
				}))
			})
			It(`Invoke CreatePrivatePathServiceGatewayAccountPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the AccountIdentityByID model
				accountIdentityModel := new(vpcv1.AccountIdentityByID)
				accountIdentityModel.ID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")

				// Construct an instance of the CreatePrivatePathServiceGatewayAccountPolicyOptions model
				createPrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.CreatePrivatePathServiceGatewayAccountPolicyOptions)
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.AccessPolicy = core.StringPtr("deny")
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.Account = accountIdentityModel
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreatePrivatePathServiceGatewayAccountPolicyWithContext(ctx, createPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreatePrivatePathServiceGatewayAccountPolicy(createPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreatePrivatePathServiceGatewayAccountPolicyWithContext(ctx, createPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPrivatePathServiceGatewayAccountPolicyPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "resource_type": "private_path_service_gateway_account_policy"}`)
				}))
			})
			It(`Invoke CreatePrivatePathServiceGatewayAccountPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreatePrivatePathServiceGatewayAccountPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the AccountIdentityByID model
				accountIdentityModel := new(vpcv1.AccountIdentityByID)
				accountIdentityModel.ID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")

				// Construct an instance of the CreatePrivatePathServiceGatewayAccountPolicyOptions model
				createPrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.CreatePrivatePathServiceGatewayAccountPolicyOptions)
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.AccessPolicy = core.StringPtr("deny")
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.Account = accountIdentityModel
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreatePrivatePathServiceGatewayAccountPolicy(createPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreatePrivatePathServiceGatewayAccountPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AccountIdentityByID model
				accountIdentityModel := new(vpcv1.AccountIdentityByID)
				accountIdentityModel.ID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")

				// Construct an instance of the CreatePrivatePathServiceGatewayAccountPolicyOptions model
				createPrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.CreatePrivatePathServiceGatewayAccountPolicyOptions)
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.AccessPolicy = core.StringPtr("deny")
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.Account = accountIdentityModel
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreatePrivatePathServiceGatewayAccountPolicy(createPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreatePrivatePathServiceGatewayAccountPolicyOptions model with no property values
				createPrivatePathServiceGatewayAccountPolicyOptionsModelNew := new(vpcv1.CreatePrivatePathServiceGatewayAccountPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreatePrivatePathServiceGatewayAccountPolicy(createPrivatePathServiceGatewayAccountPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreatePrivatePathServiceGatewayAccountPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AccountIdentityByID model
				accountIdentityModel := new(vpcv1.AccountIdentityByID)
				accountIdentityModel.ID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")

				// Construct an instance of the CreatePrivatePathServiceGatewayAccountPolicyOptions model
				createPrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.CreatePrivatePathServiceGatewayAccountPolicyOptions)
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.AccessPolicy = core.StringPtr("deny")
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.Account = accountIdentityModel
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreatePrivatePathServiceGatewayAccountPolicy(createPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeletePrivatePathServiceGatewayAccountPolicy(deletePrivatePathServiceGatewayAccountPolicyOptions *DeletePrivatePathServiceGatewayAccountPolicyOptions)`, func() {
		version := "2024-06-23"
		deletePrivatePathServiceGatewayAccountPolicyPath := "/private_path_service_gateways/testString/account_policies/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deletePrivatePathServiceGatewayAccountPolicyPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeletePrivatePathServiceGatewayAccountPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeletePrivatePathServiceGatewayAccountPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeletePrivatePathServiceGatewayAccountPolicyOptions model
				deletePrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.DeletePrivatePathServiceGatewayAccountPolicyOptions)
				deletePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				deletePrivatePathServiceGatewayAccountPolicyOptionsModel.ID = core.StringPtr("testString")
				deletePrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeletePrivatePathServiceGatewayAccountPolicy(deletePrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeletePrivatePathServiceGatewayAccountPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeletePrivatePathServiceGatewayAccountPolicyOptions model
				deletePrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.DeletePrivatePathServiceGatewayAccountPolicyOptions)
				deletePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				deletePrivatePathServiceGatewayAccountPolicyOptionsModel.ID = core.StringPtr("testString")
				deletePrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeletePrivatePathServiceGatewayAccountPolicy(deletePrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeletePrivatePathServiceGatewayAccountPolicyOptions model with no property values
				deletePrivatePathServiceGatewayAccountPolicyOptionsModelNew := new(vpcv1.DeletePrivatePathServiceGatewayAccountPolicyOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeletePrivatePathServiceGatewayAccountPolicy(deletePrivatePathServiceGatewayAccountPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetPrivatePathServiceGatewayAccountPolicy(getPrivatePathServiceGatewayAccountPolicyOptions *GetPrivatePathServiceGatewayAccountPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getPrivatePathServiceGatewayAccountPolicyPath := "/private_path_service_gateways/testString/account_policies/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPrivatePathServiceGatewayAccountPolicyPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetPrivatePathServiceGatewayAccountPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPrivatePathServiceGatewayAccountPolicyOptions model
				getPrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayAccountPolicyOptions)
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetPrivatePathServiceGatewayAccountPolicy(getPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetPrivatePathServiceGatewayAccountPolicy(getPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetPrivatePathServiceGatewayAccountPolicy(getPrivatePathServiceGatewayAccountPolicyOptions *GetPrivatePathServiceGatewayAccountPolicyOptions)`, func() {
		version := "2024-06-23"
		getPrivatePathServiceGatewayAccountPolicyPath := "/private_path_service_gateways/testString/account_policies/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPrivatePathServiceGatewayAccountPolicyPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "resource_type": "private_path_service_gateway_account_policy"}`)
				}))
			})
			It(`Invoke GetPrivatePathServiceGatewayAccountPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetPrivatePathServiceGatewayAccountPolicyOptions model
				getPrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayAccountPolicyOptions)
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetPrivatePathServiceGatewayAccountPolicyWithContext(ctx, getPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetPrivatePathServiceGatewayAccountPolicy(getPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetPrivatePathServiceGatewayAccountPolicyWithContext(ctx, getPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPrivatePathServiceGatewayAccountPolicyPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "resource_type": "private_path_service_gateway_account_policy"}`)
				}))
			})
			It(`Invoke GetPrivatePathServiceGatewayAccountPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetPrivatePathServiceGatewayAccountPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetPrivatePathServiceGatewayAccountPolicyOptions model
				getPrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayAccountPolicyOptions)
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetPrivatePathServiceGatewayAccountPolicy(getPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetPrivatePathServiceGatewayAccountPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPrivatePathServiceGatewayAccountPolicyOptions model
				getPrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayAccountPolicyOptions)
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetPrivatePathServiceGatewayAccountPolicy(getPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetPrivatePathServiceGatewayAccountPolicyOptions model with no property values
				getPrivatePathServiceGatewayAccountPolicyOptionsModelNew := new(vpcv1.GetPrivatePathServiceGatewayAccountPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetPrivatePathServiceGatewayAccountPolicy(getPrivatePathServiceGatewayAccountPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetPrivatePathServiceGatewayAccountPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPrivatePathServiceGatewayAccountPolicyOptions model
				getPrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayAccountPolicyOptions)
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetPrivatePathServiceGatewayAccountPolicy(getPrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdatePrivatePathServiceGatewayAccountPolicy(updatePrivatePathServiceGatewayAccountPolicyOptions *UpdatePrivatePathServiceGatewayAccountPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updatePrivatePathServiceGatewayAccountPolicyPath := "/private_path_service_gateways/testString/account_policies/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePrivatePathServiceGatewayAccountPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdatePrivatePathServiceGatewayAccountPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the PrivatePathServiceGatewayAccountPolicyPatch model
				privatePathServiceGatewayAccountPolicyPatchModel := new(vpcv1.PrivatePathServiceGatewayAccountPolicyPatch)
				privatePathServiceGatewayAccountPolicyPatchModel.AccessPolicy = core.StringPtr("review")
				privatePathServiceGatewayAccountPolicyPatchModelAsPatch, asPatchErr := privatePathServiceGatewayAccountPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePrivatePathServiceGatewayAccountPolicyOptions model
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.UpdatePrivatePathServiceGatewayAccountPolicyOptions)
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.ID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayAccountPolicyPatch = privatePathServiceGatewayAccountPolicyPatchModelAsPatch
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdatePrivatePathServiceGatewayAccountPolicy(updatePrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdatePrivatePathServiceGatewayAccountPolicy(updatePrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdatePrivatePathServiceGatewayAccountPolicy(updatePrivatePathServiceGatewayAccountPolicyOptions *UpdatePrivatePathServiceGatewayAccountPolicyOptions)`, func() {
		version := "2024-06-23"
		updatePrivatePathServiceGatewayAccountPolicyPath := "/private_path_service_gateways/testString/account_policies/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePrivatePathServiceGatewayAccountPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "resource_type": "private_path_service_gateway_account_policy"}`)
				}))
			})
			It(`Invoke UpdatePrivatePathServiceGatewayAccountPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the PrivatePathServiceGatewayAccountPolicyPatch model
				privatePathServiceGatewayAccountPolicyPatchModel := new(vpcv1.PrivatePathServiceGatewayAccountPolicyPatch)
				privatePathServiceGatewayAccountPolicyPatchModel.AccessPolicy = core.StringPtr("review")
				privatePathServiceGatewayAccountPolicyPatchModelAsPatch, asPatchErr := privatePathServiceGatewayAccountPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePrivatePathServiceGatewayAccountPolicyOptions model
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.UpdatePrivatePathServiceGatewayAccountPolicyOptions)
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.ID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayAccountPolicyPatch = privatePathServiceGatewayAccountPolicyPatchModelAsPatch
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdatePrivatePathServiceGatewayAccountPolicyWithContext(ctx, updatePrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdatePrivatePathServiceGatewayAccountPolicy(updatePrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdatePrivatePathServiceGatewayAccountPolicyWithContext(ctx, updatePrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePrivatePathServiceGatewayAccountPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r006-7268d425-59b7-48fd-9735-81a7271657d5", "resource_type": "private_path_service_gateway_account_policy"}`)
				}))
			})
			It(`Invoke UpdatePrivatePathServiceGatewayAccountPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdatePrivatePathServiceGatewayAccountPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the PrivatePathServiceGatewayAccountPolicyPatch model
				privatePathServiceGatewayAccountPolicyPatchModel := new(vpcv1.PrivatePathServiceGatewayAccountPolicyPatch)
				privatePathServiceGatewayAccountPolicyPatchModel.AccessPolicy = core.StringPtr("review")
				privatePathServiceGatewayAccountPolicyPatchModelAsPatch, asPatchErr := privatePathServiceGatewayAccountPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePrivatePathServiceGatewayAccountPolicyOptions model
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.UpdatePrivatePathServiceGatewayAccountPolicyOptions)
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.ID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayAccountPolicyPatch = privatePathServiceGatewayAccountPolicyPatchModelAsPatch
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdatePrivatePathServiceGatewayAccountPolicy(updatePrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdatePrivatePathServiceGatewayAccountPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the PrivatePathServiceGatewayAccountPolicyPatch model
				privatePathServiceGatewayAccountPolicyPatchModel := new(vpcv1.PrivatePathServiceGatewayAccountPolicyPatch)
				privatePathServiceGatewayAccountPolicyPatchModel.AccessPolicy = core.StringPtr("review")
				privatePathServiceGatewayAccountPolicyPatchModelAsPatch, asPatchErr := privatePathServiceGatewayAccountPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePrivatePathServiceGatewayAccountPolicyOptions model
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.UpdatePrivatePathServiceGatewayAccountPolicyOptions)
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.ID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayAccountPolicyPatch = privatePathServiceGatewayAccountPolicyPatchModelAsPatch
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdatePrivatePathServiceGatewayAccountPolicy(updatePrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdatePrivatePathServiceGatewayAccountPolicyOptions model with no property values
				updatePrivatePathServiceGatewayAccountPolicyOptionsModelNew := new(vpcv1.UpdatePrivatePathServiceGatewayAccountPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdatePrivatePathServiceGatewayAccountPolicy(updatePrivatePathServiceGatewayAccountPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdatePrivatePathServiceGatewayAccountPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the PrivatePathServiceGatewayAccountPolicyPatch model
				privatePathServiceGatewayAccountPolicyPatchModel := new(vpcv1.PrivatePathServiceGatewayAccountPolicyPatch)
				privatePathServiceGatewayAccountPolicyPatchModel.AccessPolicy = core.StringPtr("review")
				privatePathServiceGatewayAccountPolicyPatchModelAsPatch, asPatchErr := privatePathServiceGatewayAccountPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePrivatePathServiceGatewayAccountPolicyOptions model
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel := new(vpcv1.UpdatePrivatePathServiceGatewayAccountPolicyOptions)
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.ID = core.StringPtr("testString")
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayAccountPolicyPatch = privatePathServiceGatewayAccountPolicyPatchModelAsPatch
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdatePrivatePathServiceGatewayAccountPolicy(updatePrivatePathServiceGatewayAccountPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListPrivatePathServiceGatewayEndpointGatewayBindings(listPrivatePathServiceGatewayEndpointGatewayBindingsOptions *ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listPrivatePathServiceGatewayEndpointGatewayBindingsPath := "/private_path_service_gateways/testString/endpoint_gateway_bindings"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPrivatePathServiceGatewayEndpointGatewayBindingsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["status"]).To(Equal([]string{"abandoned"}))
					Expect(req.URL.Query()["account.id"]).To(Equal([]string{"bb1b52262f7441a586f49068482f1e60"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListPrivatePathServiceGatewayEndpointGatewayBindings with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions model
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel := new(vpcv1.ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions)
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Status = core.StringPtr("abandoned")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListPrivatePathServiceGatewayEndpointGatewayBindings(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListPrivatePathServiceGatewayEndpointGatewayBindings(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListPrivatePathServiceGatewayEndpointGatewayBindings(listPrivatePathServiceGatewayEndpointGatewayBindingsOptions *ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions)`, func() {
		version := "2024-06-23"
		listPrivatePathServiceGatewayEndpointGatewayBindingsPath := "/private_path_service_gateways/testString/endpoint_gateway_bindings"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPrivatePathServiceGatewayEndpointGatewayBindingsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["status"]).To(Equal([]string{"abandoned"}))
					Expect(req.URL.Query()["account.id"]).To(Equal([]string{"bb1b52262f7441a586f49068482f1e60"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"endpoint_gateway_bindings": [{"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "expiration_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0", "id": "r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0", "lifecycle_state": "stable", "resource_type": "private_path_service_gateway_endpoint_gateway_binding", "status": "abandoned"}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListPrivatePathServiceGatewayEndpointGatewayBindings successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions model
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel := new(vpcv1.ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions)
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Status = core.StringPtr("abandoned")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListPrivatePathServiceGatewayEndpointGatewayBindingsWithContext(ctx, listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListPrivatePathServiceGatewayEndpointGatewayBindings(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListPrivatePathServiceGatewayEndpointGatewayBindingsWithContext(ctx, listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPrivatePathServiceGatewayEndpointGatewayBindingsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["status"]).To(Equal([]string{"abandoned"}))
					Expect(req.URL.Query()["account.id"]).To(Equal([]string{"bb1b52262f7441a586f49068482f1e60"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"endpoint_gateway_bindings": [{"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "expiration_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0", "id": "r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0", "lifecycle_state": "stable", "resource_type": "private_path_service_gateway_endpoint_gateway_binding", "status": "abandoned"}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListPrivatePathServiceGatewayEndpointGatewayBindings successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListPrivatePathServiceGatewayEndpointGatewayBindings(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions model
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel := new(vpcv1.ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions)
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Status = core.StringPtr("abandoned")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListPrivatePathServiceGatewayEndpointGatewayBindings(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListPrivatePathServiceGatewayEndpointGatewayBindings with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions model
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel := new(vpcv1.ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions)
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Status = core.StringPtr("abandoned")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListPrivatePathServiceGatewayEndpointGatewayBindings(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions model with no property values
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModelNew := new(vpcv1.ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListPrivatePathServiceGatewayEndpointGatewayBindings(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListPrivatePathServiceGatewayEndpointGatewayBindings successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions model
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel := new(vpcv1.ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions)
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Start = core.StringPtr("testString")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Status = core.StringPtr("abandoned")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListPrivatePathServiceGatewayEndpointGatewayBindings(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.PrivatePathServiceGatewayEndpointGatewayBindingCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.PrivatePathServiceGatewayEndpointGatewayBindingCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.PrivatePathServiceGatewayEndpointGatewayBindingCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPrivatePathServiceGatewayEndpointGatewayBindingsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"endpoint_gateway_bindings":[{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","expiration_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0","id":"r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0","lifecycle_state":"stable","resource_type":"private_path_service_gateway_endpoint_gateway_binding","status":"abandoned"}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"endpoint_gateway_bindings":[{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","expiration_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0","id":"r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0","lifecycle_state":"stable","resource_type":"private_path_service_gateway_endpoint_gateway_binding","status":"abandoned"}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use PrivatePathServiceGatewayEndpointGatewayBindingsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel := &vpcv1.ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions{
					PrivatePathServiceGatewayID: core.StringPtr("testString"),
					Limit:                       core.Int64Ptr(int64(10)),
					Status:                      core.StringPtr("abandoned"),
					AccountID:                   core.StringPtr("bb1b52262f7441a586f49068482f1e60"),
				}

				pager, err := vpcService.NewPrivatePathServiceGatewayEndpointGatewayBindingsPager(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.PrivatePathServiceGatewayEndpointGatewayBinding
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use PrivatePathServiceGatewayEndpointGatewayBindingsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel := &vpcv1.ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions{
					PrivatePathServiceGatewayID: core.StringPtr("testString"),
					Limit:                       core.Int64Ptr(int64(10)),
					Status:                      core.StringPtr("abandoned"),
					AccountID:                   core.StringPtr("bb1b52262f7441a586f49068482f1e60"),
				}

				pager, err := vpcService.NewPrivatePathServiceGatewayEndpointGatewayBindingsPager(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`GetPrivatePathServiceGatewayEndpointGatewayBinding(getPrivatePathServiceGatewayEndpointGatewayBindingOptions *GetPrivatePathServiceGatewayEndpointGatewayBindingOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getPrivatePathServiceGatewayEndpointGatewayBindingPath := "/private_path_service_gateways/testString/endpoint_gateway_bindings/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPrivatePathServiceGatewayEndpointGatewayBindingPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetPrivatePathServiceGatewayEndpointGatewayBinding with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPrivatePathServiceGatewayEndpointGatewayBindingOptions model
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayEndpointGatewayBindingOptions)
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetPrivatePathServiceGatewayEndpointGatewayBinding(getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetPrivatePathServiceGatewayEndpointGatewayBinding(getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetPrivatePathServiceGatewayEndpointGatewayBinding(getPrivatePathServiceGatewayEndpointGatewayBindingOptions *GetPrivatePathServiceGatewayEndpointGatewayBindingOptions)`, func() {
		version := "2024-06-23"
		getPrivatePathServiceGatewayEndpointGatewayBindingPath := "/private_path_service_gateways/testString/endpoint_gateway_bindings/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPrivatePathServiceGatewayEndpointGatewayBindingPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "expiration_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0", "id": "r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0", "lifecycle_state": "stable", "resource_type": "private_path_service_gateway_endpoint_gateway_binding", "status": "abandoned"}`)
				}))
			})
			It(`Invoke GetPrivatePathServiceGatewayEndpointGatewayBinding successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetPrivatePathServiceGatewayEndpointGatewayBindingOptions model
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayEndpointGatewayBindingOptions)
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetPrivatePathServiceGatewayEndpointGatewayBindingWithContext(ctx, getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetPrivatePathServiceGatewayEndpointGatewayBinding(getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetPrivatePathServiceGatewayEndpointGatewayBindingWithContext(ctx, getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPrivatePathServiceGatewayEndpointGatewayBindingPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "expiration_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0", "id": "r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0", "lifecycle_state": "stable", "resource_type": "private_path_service_gateway_endpoint_gateway_binding", "status": "abandoned"}`)
				}))
			})
			It(`Invoke GetPrivatePathServiceGatewayEndpointGatewayBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetPrivatePathServiceGatewayEndpointGatewayBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetPrivatePathServiceGatewayEndpointGatewayBindingOptions model
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayEndpointGatewayBindingOptions)
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetPrivatePathServiceGatewayEndpointGatewayBinding(getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetPrivatePathServiceGatewayEndpointGatewayBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPrivatePathServiceGatewayEndpointGatewayBindingOptions model
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayEndpointGatewayBindingOptions)
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetPrivatePathServiceGatewayEndpointGatewayBinding(getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetPrivatePathServiceGatewayEndpointGatewayBindingOptions model with no property values
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModelNew := new(vpcv1.GetPrivatePathServiceGatewayEndpointGatewayBindingOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetPrivatePathServiceGatewayEndpointGatewayBinding(getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetPrivatePathServiceGatewayEndpointGatewayBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPrivatePathServiceGatewayEndpointGatewayBindingOptions model
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel := new(vpcv1.GetPrivatePathServiceGatewayEndpointGatewayBindingOptions)
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.ID = core.StringPtr("testString")
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetPrivatePathServiceGatewayEndpointGatewayBinding(getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DenyPrivatePathServiceGatewayEndpointGatewayBinding(denyPrivatePathServiceGatewayEndpointGatewayBindingOptions *DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions)`, func() {
		version := "2024-06-23"
		denyPrivatePathServiceGatewayEndpointGatewayBindingPath := "/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/deny"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(denyPrivatePathServiceGatewayEndpointGatewayBindingPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DenyPrivatePathServiceGatewayEndpointGatewayBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DenyPrivatePathServiceGatewayEndpointGatewayBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions model
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel := new(vpcv1.DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions)
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.ID = core.StringPtr("testString")
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetAccountPolicy = core.BoolPtr(true)
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DenyPrivatePathServiceGatewayEndpointGatewayBinding(denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DenyPrivatePathServiceGatewayEndpointGatewayBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions model
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel := new(vpcv1.DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions)
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.ID = core.StringPtr("testString")
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetAccountPolicy = core.BoolPtr(true)
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DenyPrivatePathServiceGatewayEndpointGatewayBinding(denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions model with no property values
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModelNew := new(vpcv1.DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DenyPrivatePathServiceGatewayEndpointGatewayBinding(denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`PermitPrivatePathServiceGatewayEndpointGatewayBinding(permitPrivatePathServiceGatewayEndpointGatewayBindingOptions *PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions)`, func() {
		version := "2024-06-23"
		permitPrivatePathServiceGatewayEndpointGatewayBindingPath := "/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/permit"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(permitPrivatePathServiceGatewayEndpointGatewayBindingPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke PermitPrivatePathServiceGatewayEndpointGatewayBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.PermitPrivatePathServiceGatewayEndpointGatewayBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions model
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel := new(vpcv1.PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions)
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.ID = core.StringPtr("testString")
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetAccountPolicy = core.BoolPtr(true)
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.PermitPrivatePathServiceGatewayEndpointGatewayBinding(permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke PermitPrivatePathServiceGatewayEndpointGatewayBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions model
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel := new(vpcv1.PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions)
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.ID = core.StringPtr("testString")
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetAccountPolicy = core.BoolPtr(true)
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.PermitPrivatePathServiceGatewayEndpointGatewayBinding(permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions model with no property values
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModelNew := new(vpcv1.PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.PermitPrivatePathServiceGatewayEndpointGatewayBinding(permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`PublishPrivatePathServiceGateway(publishPrivatePathServiceGatewayOptions *PublishPrivatePathServiceGatewayOptions)`, func() {
		version := "2024-06-23"
		publishPrivatePathServiceGatewayPath := "/private_path_service_gateways/testString/publish"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(publishPrivatePathServiceGatewayPath))
					Expect(req.Method).To(Equal("POST"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke PublishPrivatePathServiceGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.PublishPrivatePathServiceGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the PublishPrivatePathServiceGatewayOptions model
				publishPrivatePathServiceGatewayOptionsModel := new(vpcv1.PublishPrivatePathServiceGatewayOptions)
				publishPrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				publishPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.PublishPrivatePathServiceGateway(publishPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke PublishPrivatePathServiceGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the PublishPrivatePathServiceGatewayOptions model
				publishPrivatePathServiceGatewayOptionsModel := new(vpcv1.PublishPrivatePathServiceGatewayOptions)
				publishPrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				publishPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.PublishPrivatePathServiceGateway(publishPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the PublishPrivatePathServiceGatewayOptions model with no property values
				publishPrivatePathServiceGatewayOptionsModelNew := new(vpcv1.PublishPrivatePathServiceGatewayOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.PublishPrivatePathServiceGateway(publishPrivatePathServiceGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`RevokeAccountForPrivatePathServiceGateway(revokeAccountForPrivatePathServiceGatewayOptions *RevokeAccountForPrivatePathServiceGatewayOptions)`, func() {
		version := "2024-06-23"
		revokeAccountForPrivatePathServiceGatewayPath := "/private_path_service_gateways/testString/revoke_account"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(revokeAccountForPrivatePathServiceGatewayPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke RevokeAccountForPrivatePathServiceGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.RevokeAccountForPrivatePathServiceGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the AccountIdentityByID model
				accountIdentityModel := new(vpcv1.AccountIdentityByID)
				accountIdentityModel.ID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")

				// Construct an instance of the RevokeAccountForPrivatePathServiceGatewayOptions model
				revokeAccountForPrivatePathServiceGatewayOptionsModel := new(vpcv1.RevokeAccountForPrivatePathServiceGatewayOptions)
				revokeAccountForPrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				revokeAccountForPrivatePathServiceGatewayOptionsModel.Account = accountIdentityModel
				revokeAccountForPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.RevokeAccountForPrivatePathServiceGateway(revokeAccountForPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke RevokeAccountForPrivatePathServiceGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AccountIdentityByID model
				accountIdentityModel := new(vpcv1.AccountIdentityByID)
				accountIdentityModel.ID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")

				// Construct an instance of the RevokeAccountForPrivatePathServiceGatewayOptions model
				revokeAccountForPrivatePathServiceGatewayOptionsModel := new(vpcv1.RevokeAccountForPrivatePathServiceGatewayOptions)
				revokeAccountForPrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				revokeAccountForPrivatePathServiceGatewayOptionsModel.Account = accountIdentityModel
				revokeAccountForPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.RevokeAccountForPrivatePathServiceGateway(revokeAccountForPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the RevokeAccountForPrivatePathServiceGatewayOptions model with no property values
				revokeAccountForPrivatePathServiceGatewayOptionsModelNew := new(vpcv1.RevokeAccountForPrivatePathServiceGatewayOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.RevokeAccountForPrivatePathServiceGateway(revokeAccountForPrivatePathServiceGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UnpublishPrivatePathServiceGateway(unpublishPrivatePathServiceGatewayOptions *UnpublishPrivatePathServiceGatewayOptions)`, func() {
		version := "2024-06-23"
		unpublishPrivatePathServiceGatewayPath := "/private_path_service_gateways/testString/unpublish"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(unpublishPrivatePathServiceGatewayPath))
					Expect(req.Method).To(Equal("POST"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke UnpublishPrivatePathServiceGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.UnpublishPrivatePathServiceGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the UnpublishPrivatePathServiceGatewayOptions model
				unpublishPrivatePathServiceGatewayOptionsModel := new(vpcv1.UnpublishPrivatePathServiceGatewayOptions)
				unpublishPrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				unpublishPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.UnpublishPrivatePathServiceGateway(unpublishPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke UnpublishPrivatePathServiceGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the UnpublishPrivatePathServiceGatewayOptions model
				unpublishPrivatePathServiceGatewayOptionsModel := new(vpcv1.UnpublishPrivatePathServiceGatewayOptions)
				unpublishPrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayID = core.StringPtr("testString")
				unpublishPrivatePathServiceGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.UnpublishPrivatePathServiceGateway(unpublishPrivatePathServiceGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the UnpublishPrivatePathServiceGatewayOptions model with no property values
				unpublishPrivatePathServiceGatewayOptionsModelNew := new(vpcv1.UnpublishPrivatePathServiceGatewayOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.UnpublishPrivatePathServiceGateway(unpublishPrivatePathServiceGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListPublicAddressRanges(listPublicAddressRangesOptions *ListPublicAddressRangesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listPublicAddressRangesPath := "/public_address_ranges"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPublicAddressRangesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListPublicAddressRanges with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPublicAddressRangesOptions model
				listPublicAddressRangesOptionsModel := new(vpcv1.ListPublicAddressRangesOptions)
				listPublicAddressRangesOptionsModel.Start = core.StringPtr("testString")
				listPublicAddressRangesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPublicAddressRangesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPublicAddressRangesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListPublicAddressRanges(listPublicAddressRangesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListPublicAddressRanges(listPublicAddressRangesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListPublicAddressRanges(listPublicAddressRangesOptions *ListPublicAddressRangesOptions)`, func() {
		version := "2024-06-23"
		listPublicAddressRangesPath := "/public_address_ranges"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPublicAddressRangesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "public_address_ranges": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "ipv4_address_count": 8, "lifecycle_state": "stable", "name": "my-public-address-range", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_address_range", "target": {"vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListPublicAddressRanges successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListPublicAddressRangesOptions model
				listPublicAddressRangesOptionsModel := new(vpcv1.ListPublicAddressRangesOptions)
				listPublicAddressRangesOptionsModel.Start = core.StringPtr("testString")
				listPublicAddressRangesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPublicAddressRangesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPublicAddressRangesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListPublicAddressRangesWithContext(ctx, listPublicAddressRangesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListPublicAddressRanges(listPublicAddressRangesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListPublicAddressRangesWithContext(ctx, listPublicAddressRangesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPublicAddressRangesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "public_address_ranges": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "ipv4_address_count": 8, "lifecycle_state": "stable", "name": "my-public-address-range", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_address_range", "target": {"vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListPublicAddressRanges successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListPublicAddressRanges(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListPublicAddressRangesOptions model
				listPublicAddressRangesOptionsModel := new(vpcv1.ListPublicAddressRangesOptions)
				listPublicAddressRangesOptionsModel.Start = core.StringPtr("testString")
				listPublicAddressRangesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPublicAddressRangesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPublicAddressRangesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListPublicAddressRanges(listPublicAddressRangesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListPublicAddressRanges with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPublicAddressRangesOptions model
				listPublicAddressRangesOptionsModel := new(vpcv1.ListPublicAddressRangesOptions)
				listPublicAddressRangesOptionsModel.Start = core.StringPtr("testString")
				listPublicAddressRangesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPublicAddressRangesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPublicAddressRangesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListPublicAddressRanges(listPublicAddressRangesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListPublicAddressRanges successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPublicAddressRangesOptions model
				listPublicAddressRangesOptionsModel := new(vpcv1.ListPublicAddressRangesOptions)
				listPublicAddressRangesOptionsModel.Start = core.StringPtr("testString")
				listPublicAddressRangesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPublicAddressRangesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPublicAddressRangesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListPublicAddressRanges(listPublicAddressRangesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.PublicAddressRangeCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.PublicAddressRangeCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.PublicAddressRangeCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPublicAddressRangesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"public_address_ranges":[{"cidr":"192.168.3.0/24","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a","href":"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a","id":"r006-a4841334-b584-4293-938e-3bc63b4a5b6a","ipv4_address_count":8,"lifecycle_state":"stable","name":"my-public-address-range","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_address_range","target":{"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"public_address_ranges":[{"cidr":"192.168.3.0/24","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a","href":"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a","id":"r006-a4841334-b584-4293-938e-3bc63b4a5b6a","ipv4_address_count":8,"lifecycle_state":"stable","name":"my-public-address-range","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_address_range","target":{"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use PublicAddressRangesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listPublicAddressRangesOptionsModel := &vpcv1.ListPublicAddressRangesOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewPublicAddressRangesPager(listPublicAddressRangesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.PublicAddressRange
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use PublicAddressRangesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listPublicAddressRangesOptionsModel := &vpcv1.ListPublicAddressRangesOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewPublicAddressRangesPager(listPublicAddressRangesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreatePublicAddressRange(createPublicAddressRangeOptions *CreatePublicAddressRangeOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createPublicAddressRangePath := "/public_address_ranges"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPublicAddressRangePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreatePublicAddressRange with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicAddressRangeTargetPrototype model
				publicAddressRangeTargetPrototypeModel := new(vpcv1.PublicAddressRangeTargetPrototype)
				publicAddressRangeTargetPrototypeModel.VPC = vpcIdentityModel
				publicAddressRangeTargetPrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreatePublicAddressRangeOptions model
				createPublicAddressRangeOptionsModel := new(vpcv1.CreatePublicAddressRangeOptions)
				createPublicAddressRangeOptionsModel.Ipv4AddressCount = core.Int64Ptr(int64(8))
				createPublicAddressRangeOptionsModel.Name = core.StringPtr("my-public-address-range")
				createPublicAddressRangeOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPublicAddressRangeOptionsModel.Target = publicAddressRangeTargetPrototypeModel
				createPublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreatePublicAddressRange(createPublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreatePublicAddressRange(createPublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreatePublicAddressRange(createPublicAddressRangeOptions *CreatePublicAddressRangeOptions)`, func() {
		version := "2024-06-23"
		createPublicAddressRangePath := "/public_address_ranges"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPublicAddressRangePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "ipv4_address_count": 8, "lifecycle_state": "stable", "name": "my-public-address-range", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_address_range", "target": {"vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}}`)
				}))
			})
			It(`Invoke CreatePublicAddressRange successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicAddressRangeTargetPrototype model
				publicAddressRangeTargetPrototypeModel := new(vpcv1.PublicAddressRangeTargetPrototype)
				publicAddressRangeTargetPrototypeModel.VPC = vpcIdentityModel
				publicAddressRangeTargetPrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreatePublicAddressRangeOptions model
				createPublicAddressRangeOptionsModel := new(vpcv1.CreatePublicAddressRangeOptions)
				createPublicAddressRangeOptionsModel.Ipv4AddressCount = core.Int64Ptr(int64(8))
				createPublicAddressRangeOptionsModel.Name = core.StringPtr("my-public-address-range")
				createPublicAddressRangeOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPublicAddressRangeOptionsModel.Target = publicAddressRangeTargetPrototypeModel
				createPublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreatePublicAddressRangeWithContext(ctx, createPublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreatePublicAddressRange(createPublicAddressRangeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreatePublicAddressRangeWithContext(ctx, createPublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPublicAddressRangePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "ipv4_address_count": 8, "lifecycle_state": "stable", "name": "my-public-address-range", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_address_range", "target": {"vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}}`)
				}))
			})
			It(`Invoke CreatePublicAddressRange successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreatePublicAddressRange(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicAddressRangeTargetPrototype model
				publicAddressRangeTargetPrototypeModel := new(vpcv1.PublicAddressRangeTargetPrototype)
				publicAddressRangeTargetPrototypeModel.VPC = vpcIdentityModel
				publicAddressRangeTargetPrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreatePublicAddressRangeOptions model
				createPublicAddressRangeOptionsModel := new(vpcv1.CreatePublicAddressRangeOptions)
				createPublicAddressRangeOptionsModel.Ipv4AddressCount = core.Int64Ptr(int64(8))
				createPublicAddressRangeOptionsModel.Name = core.StringPtr("my-public-address-range")
				createPublicAddressRangeOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPublicAddressRangeOptionsModel.Target = publicAddressRangeTargetPrototypeModel
				createPublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreatePublicAddressRange(createPublicAddressRangeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreatePublicAddressRange with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicAddressRangeTargetPrototype model
				publicAddressRangeTargetPrototypeModel := new(vpcv1.PublicAddressRangeTargetPrototype)
				publicAddressRangeTargetPrototypeModel.VPC = vpcIdentityModel
				publicAddressRangeTargetPrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreatePublicAddressRangeOptions model
				createPublicAddressRangeOptionsModel := new(vpcv1.CreatePublicAddressRangeOptions)
				createPublicAddressRangeOptionsModel.Ipv4AddressCount = core.Int64Ptr(int64(8))
				createPublicAddressRangeOptionsModel.Name = core.StringPtr("my-public-address-range")
				createPublicAddressRangeOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPublicAddressRangeOptionsModel.Target = publicAddressRangeTargetPrototypeModel
				createPublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreatePublicAddressRange(createPublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreatePublicAddressRangeOptions model with no property values
				createPublicAddressRangeOptionsModelNew := new(vpcv1.CreatePublicAddressRangeOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreatePublicAddressRange(createPublicAddressRangeOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreatePublicAddressRange successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicAddressRangeTargetPrototype model
				publicAddressRangeTargetPrototypeModel := new(vpcv1.PublicAddressRangeTargetPrototype)
				publicAddressRangeTargetPrototypeModel.VPC = vpcIdentityModel
				publicAddressRangeTargetPrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreatePublicAddressRangeOptions model
				createPublicAddressRangeOptionsModel := new(vpcv1.CreatePublicAddressRangeOptions)
				createPublicAddressRangeOptionsModel.Ipv4AddressCount = core.Int64Ptr(int64(8))
				createPublicAddressRangeOptionsModel.Name = core.StringPtr("my-public-address-range")
				createPublicAddressRangeOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPublicAddressRangeOptionsModel.Target = publicAddressRangeTargetPrototypeModel
				createPublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreatePublicAddressRange(createPublicAddressRangeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeletePublicAddressRange(deletePublicAddressRangeOptions *DeletePublicAddressRangeOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deletePublicAddressRangePath := "/public_address_ranges/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deletePublicAddressRangePath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeletePublicAddressRange with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeletePublicAddressRangeOptions model
				deletePublicAddressRangeOptionsModel := new(vpcv1.DeletePublicAddressRangeOptions)
				deletePublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				deletePublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeletePublicAddressRange(deletePublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeletePublicAddressRange(deletePublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeletePublicAddressRange(deletePublicAddressRangeOptions *DeletePublicAddressRangeOptions)`, func() {
		version := "2024-06-23"
		deletePublicAddressRangePath := "/public_address_ranges/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deletePublicAddressRangePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "ipv4_address_count": 8, "lifecycle_state": "stable", "name": "my-public-address-range", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_address_range", "target": {"vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}}`)
				}))
			})
			It(`Invoke DeletePublicAddressRange successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeletePublicAddressRangeOptions model
				deletePublicAddressRangeOptionsModel := new(vpcv1.DeletePublicAddressRangeOptions)
				deletePublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				deletePublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeletePublicAddressRangeWithContext(ctx, deletePublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeletePublicAddressRange(deletePublicAddressRangeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeletePublicAddressRangeWithContext(ctx, deletePublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deletePublicAddressRangePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "ipv4_address_count": 8, "lifecycle_state": "stable", "name": "my-public-address-range", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_address_range", "target": {"vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}}`)
				}))
			})
			It(`Invoke DeletePublicAddressRange successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeletePublicAddressRange(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeletePublicAddressRangeOptions model
				deletePublicAddressRangeOptionsModel := new(vpcv1.DeletePublicAddressRangeOptions)
				deletePublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				deletePublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeletePublicAddressRange(deletePublicAddressRangeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeletePublicAddressRange with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeletePublicAddressRangeOptions model
				deletePublicAddressRangeOptionsModel := new(vpcv1.DeletePublicAddressRangeOptions)
				deletePublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				deletePublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeletePublicAddressRange(deletePublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeletePublicAddressRangeOptions model with no property values
				deletePublicAddressRangeOptionsModelNew := new(vpcv1.DeletePublicAddressRangeOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeletePublicAddressRange(deletePublicAddressRangeOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeletePublicAddressRange successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeletePublicAddressRangeOptions model
				deletePublicAddressRangeOptionsModel := new(vpcv1.DeletePublicAddressRangeOptions)
				deletePublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				deletePublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeletePublicAddressRange(deletePublicAddressRangeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetPublicAddressRange(getPublicAddressRangeOptions *GetPublicAddressRangeOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getPublicAddressRangePath := "/public_address_ranges/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPublicAddressRangePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetPublicAddressRange with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPublicAddressRangeOptions model
				getPublicAddressRangeOptionsModel := new(vpcv1.GetPublicAddressRangeOptions)
				getPublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				getPublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetPublicAddressRange(getPublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetPublicAddressRange(getPublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetPublicAddressRange(getPublicAddressRangeOptions *GetPublicAddressRangeOptions)`, func() {
		version := "2024-06-23"
		getPublicAddressRangePath := "/public_address_ranges/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPublicAddressRangePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "ipv4_address_count": 8, "lifecycle_state": "stable", "name": "my-public-address-range", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_address_range", "target": {"vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}}`)
				}))
			})
			It(`Invoke GetPublicAddressRange successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetPublicAddressRangeOptions model
				getPublicAddressRangeOptionsModel := new(vpcv1.GetPublicAddressRangeOptions)
				getPublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				getPublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetPublicAddressRangeWithContext(ctx, getPublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetPublicAddressRange(getPublicAddressRangeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetPublicAddressRangeWithContext(ctx, getPublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPublicAddressRangePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "ipv4_address_count": 8, "lifecycle_state": "stable", "name": "my-public-address-range", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_address_range", "target": {"vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}}`)
				}))
			})
			It(`Invoke GetPublicAddressRange successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetPublicAddressRange(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetPublicAddressRangeOptions model
				getPublicAddressRangeOptionsModel := new(vpcv1.GetPublicAddressRangeOptions)
				getPublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				getPublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetPublicAddressRange(getPublicAddressRangeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetPublicAddressRange with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPublicAddressRangeOptions model
				getPublicAddressRangeOptionsModel := new(vpcv1.GetPublicAddressRangeOptions)
				getPublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				getPublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetPublicAddressRange(getPublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetPublicAddressRangeOptions model with no property values
				getPublicAddressRangeOptionsModelNew := new(vpcv1.GetPublicAddressRangeOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetPublicAddressRange(getPublicAddressRangeOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetPublicAddressRange successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPublicAddressRangeOptions model
				getPublicAddressRangeOptionsModel := new(vpcv1.GetPublicAddressRangeOptions)
				getPublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				getPublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetPublicAddressRange(getPublicAddressRangeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdatePublicAddressRange(updatePublicAddressRangeOptions *UpdatePublicAddressRangeOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updatePublicAddressRangePath := "/public_address_ranges/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePublicAddressRangePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdatePublicAddressRange with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicAddressRangeTargetPatch model
				publicAddressRangeTargetPatchModel := new(vpcv1.PublicAddressRangeTargetPatch)
				publicAddressRangeTargetPatchModel.VPC = vpcIdentityModel
				publicAddressRangeTargetPatchModel.Zone = zoneIdentityModel

				// Construct an instance of the PublicAddressRangePatch model
				publicAddressRangePatchModel := new(vpcv1.PublicAddressRangePatch)
				publicAddressRangePatchModel.Name = core.StringPtr("my-public-address-range-updated")
				publicAddressRangePatchModel.Target = publicAddressRangeTargetPatchModel
				publicAddressRangePatchModelAsPatch, asPatchErr := publicAddressRangePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePublicAddressRangeOptions model
				updatePublicAddressRangeOptionsModel := new(vpcv1.UpdatePublicAddressRangeOptions)
				updatePublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				updatePublicAddressRangeOptionsModel.PublicAddressRangePatch = publicAddressRangePatchModelAsPatch
				updatePublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdatePublicAddressRange(updatePublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdatePublicAddressRange(updatePublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdatePublicAddressRange(updatePublicAddressRangeOptions *UpdatePublicAddressRangeOptions)`, func() {
		version := "2024-06-23"
		updatePublicAddressRangePath := "/public_address_ranges/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePublicAddressRangePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "ipv4_address_count": 8, "lifecycle_state": "stable", "name": "my-public-address-range", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_address_range", "target": {"vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}}`)
				}))
			})
			It(`Invoke UpdatePublicAddressRange successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicAddressRangeTargetPatch model
				publicAddressRangeTargetPatchModel := new(vpcv1.PublicAddressRangeTargetPatch)
				publicAddressRangeTargetPatchModel.VPC = vpcIdentityModel
				publicAddressRangeTargetPatchModel.Zone = zoneIdentityModel

				// Construct an instance of the PublicAddressRangePatch model
				publicAddressRangePatchModel := new(vpcv1.PublicAddressRangePatch)
				publicAddressRangePatchModel.Name = core.StringPtr("my-public-address-range-updated")
				publicAddressRangePatchModel.Target = publicAddressRangeTargetPatchModel
				publicAddressRangePatchModelAsPatch, asPatchErr := publicAddressRangePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePublicAddressRangeOptions model
				updatePublicAddressRangeOptionsModel := new(vpcv1.UpdatePublicAddressRangeOptions)
				updatePublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				updatePublicAddressRangeOptionsModel.PublicAddressRangePatch = publicAddressRangePatchModelAsPatch
				updatePublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdatePublicAddressRangeWithContext(ctx, updatePublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdatePublicAddressRange(updatePublicAddressRangeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdatePublicAddressRangeWithContext(ctx, updatePublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePublicAddressRangePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "ipv4_address_count": 8, "lifecycle_state": "stable", "name": "my-public-address-range", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_address_range", "target": {"vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}}`)
				}))
			})
			It(`Invoke UpdatePublicAddressRange successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdatePublicAddressRange(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicAddressRangeTargetPatch model
				publicAddressRangeTargetPatchModel := new(vpcv1.PublicAddressRangeTargetPatch)
				publicAddressRangeTargetPatchModel.VPC = vpcIdentityModel
				publicAddressRangeTargetPatchModel.Zone = zoneIdentityModel

				// Construct an instance of the PublicAddressRangePatch model
				publicAddressRangePatchModel := new(vpcv1.PublicAddressRangePatch)
				publicAddressRangePatchModel.Name = core.StringPtr("my-public-address-range-updated")
				publicAddressRangePatchModel.Target = publicAddressRangeTargetPatchModel
				publicAddressRangePatchModelAsPatch, asPatchErr := publicAddressRangePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePublicAddressRangeOptions model
				updatePublicAddressRangeOptionsModel := new(vpcv1.UpdatePublicAddressRangeOptions)
				updatePublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				updatePublicAddressRangeOptionsModel.PublicAddressRangePatch = publicAddressRangePatchModelAsPatch
				updatePublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdatePublicAddressRange(updatePublicAddressRangeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdatePublicAddressRange with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicAddressRangeTargetPatch model
				publicAddressRangeTargetPatchModel := new(vpcv1.PublicAddressRangeTargetPatch)
				publicAddressRangeTargetPatchModel.VPC = vpcIdentityModel
				publicAddressRangeTargetPatchModel.Zone = zoneIdentityModel

				// Construct an instance of the PublicAddressRangePatch model
				publicAddressRangePatchModel := new(vpcv1.PublicAddressRangePatch)
				publicAddressRangePatchModel.Name = core.StringPtr("my-public-address-range-updated")
				publicAddressRangePatchModel.Target = publicAddressRangeTargetPatchModel
				publicAddressRangePatchModelAsPatch, asPatchErr := publicAddressRangePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePublicAddressRangeOptions model
				updatePublicAddressRangeOptionsModel := new(vpcv1.UpdatePublicAddressRangeOptions)
				updatePublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				updatePublicAddressRangeOptionsModel.PublicAddressRangePatch = publicAddressRangePatchModelAsPatch
				updatePublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdatePublicAddressRange(updatePublicAddressRangeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdatePublicAddressRangeOptions model with no property values
				updatePublicAddressRangeOptionsModelNew := new(vpcv1.UpdatePublicAddressRangeOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdatePublicAddressRange(updatePublicAddressRangeOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdatePublicAddressRange successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicAddressRangeTargetPatch model
				publicAddressRangeTargetPatchModel := new(vpcv1.PublicAddressRangeTargetPatch)
				publicAddressRangeTargetPatchModel.VPC = vpcIdentityModel
				publicAddressRangeTargetPatchModel.Zone = zoneIdentityModel

				// Construct an instance of the PublicAddressRangePatch model
				publicAddressRangePatchModel := new(vpcv1.PublicAddressRangePatch)
				publicAddressRangePatchModel.Name = core.StringPtr("my-public-address-range-updated")
				publicAddressRangePatchModel.Target = publicAddressRangeTargetPatchModel
				publicAddressRangePatchModelAsPatch, asPatchErr := publicAddressRangePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePublicAddressRangeOptions model
				updatePublicAddressRangeOptionsModel := new(vpcv1.UpdatePublicAddressRangeOptions)
				updatePublicAddressRangeOptionsModel.ID = core.StringPtr("testString")
				updatePublicAddressRangeOptionsModel.PublicAddressRangePatch = publicAddressRangePatchModelAsPatch
				updatePublicAddressRangeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdatePublicAddressRange(updatePublicAddressRangeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListPublicGateways(listPublicGatewaysOptions *ListPublicGatewaysOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listPublicGatewaysPath := "/public_gateways"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPublicGatewaysPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListPublicGateways with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPublicGatewaysOptions model
				listPublicGatewaysOptionsModel := new(vpcv1.ListPublicGatewaysOptions)
				listPublicGatewaysOptionsModel.Start = core.StringPtr("testString")
				listPublicGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPublicGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPublicGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListPublicGateways(listPublicGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListPublicGateways(listPublicGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListPublicGateways(listPublicGatewaysOptions *ListPublicGatewaysOptions)`, func() {
		version := "2024-06-23"
		listPublicGatewaysPath := "/public_gateways"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPublicGatewaysPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListPublicGateways successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListPublicGatewaysOptions model
				listPublicGatewaysOptionsModel := new(vpcv1.ListPublicGatewaysOptions)
				listPublicGatewaysOptionsModel.Start = core.StringPtr("testString")
				listPublicGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPublicGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPublicGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListPublicGatewaysWithContext(ctx, listPublicGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListPublicGateways(listPublicGatewaysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListPublicGatewaysWithContext(ctx, listPublicGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPublicGatewaysPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListPublicGateways successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListPublicGateways(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListPublicGatewaysOptions model
				listPublicGatewaysOptionsModel := new(vpcv1.ListPublicGatewaysOptions)
				listPublicGatewaysOptionsModel.Start = core.StringPtr("testString")
				listPublicGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPublicGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPublicGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListPublicGateways(listPublicGatewaysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListPublicGateways with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPublicGatewaysOptions model
				listPublicGatewaysOptionsModel := new(vpcv1.ListPublicGatewaysOptions)
				listPublicGatewaysOptionsModel.Start = core.StringPtr("testString")
				listPublicGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPublicGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPublicGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListPublicGateways(listPublicGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListPublicGateways successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListPublicGatewaysOptions model
				listPublicGatewaysOptionsModel := new(vpcv1.ListPublicGatewaysOptions)
				listPublicGatewaysOptionsModel.Start = core.StringPtr("testString")
				listPublicGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listPublicGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listPublicGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListPublicGateways(listPublicGatewaysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.PublicGatewayCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.PublicGatewayCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.PublicGatewayCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listPublicGatewaysPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use PublicGatewaysPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listPublicGatewaysOptionsModel := &vpcv1.ListPublicGatewaysOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewPublicGatewaysPager(listPublicGatewaysOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.PublicGateway
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use PublicGatewaysPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listPublicGatewaysOptionsModel := &vpcv1.ListPublicGatewaysOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewPublicGatewaysPager(listPublicGatewaysOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreatePublicGateway(createPublicGatewayOptions *CreatePublicGatewayOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createPublicGatewayPath := "/public_gateways"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPublicGatewayPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreatePublicGateway with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID model
				publicGatewayFloatingIPPrototypeModel := new(vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID)
				publicGatewayFloatingIPPrototypeModel.ID = core.StringPtr("r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePublicGatewayOptions model
				createPublicGatewayOptionsModel := new(vpcv1.CreatePublicGatewayOptions)
				createPublicGatewayOptionsModel.VPC = vpcIdentityModel
				createPublicGatewayOptionsModel.Zone = zoneIdentityModel
				createPublicGatewayOptionsModel.FloatingIP = publicGatewayFloatingIPPrototypeModel
				createPublicGatewayOptionsModel.Name = core.StringPtr("my-public-gateway")
				createPublicGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreatePublicGateway(createPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreatePublicGateway(createPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreatePublicGateway(createPublicGatewayOptions *CreatePublicGatewayOptions)`, func() {
		version := "2024-06-23"
		createPublicGatewayPath := "/public_gateways"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPublicGatewayPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreatePublicGateway successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID model
				publicGatewayFloatingIPPrototypeModel := new(vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID)
				publicGatewayFloatingIPPrototypeModel.ID = core.StringPtr("r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePublicGatewayOptions model
				createPublicGatewayOptionsModel := new(vpcv1.CreatePublicGatewayOptions)
				createPublicGatewayOptionsModel.VPC = vpcIdentityModel
				createPublicGatewayOptionsModel.Zone = zoneIdentityModel
				createPublicGatewayOptionsModel.FloatingIP = publicGatewayFloatingIPPrototypeModel
				createPublicGatewayOptionsModel.Name = core.StringPtr("my-public-gateway")
				createPublicGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreatePublicGatewayWithContext(ctx, createPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreatePublicGateway(createPublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreatePublicGatewayWithContext(ctx, createPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createPublicGatewayPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreatePublicGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreatePublicGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID model
				publicGatewayFloatingIPPrototypeModel := new(vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID)
				publicGatewayFloatingIPPrototypeModel.ID = core.StringPtr("r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePublicGatewayOptions model
				createPublicGatewayOptionsModel := new(vpcv1.CreatePublicGatewayOptions)
				createPublicGatewayOptionsModel.VPC = vpcIdentityModel
				createPublicGatewayOptionsModel.Zone = zoneIdentityModel
				createPublicGatewayOptionsModel.FloatingIP = publicGatewayFloatingIPPrototypeModel
				createPublicGatewayOptionsModel.Name = core.StringPtr("my-public-gateway")
				createPublicGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreatePublicGateway(createPublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreatePublicGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID model
				publicGatewayFloatingIPPrototypeModel := new(vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID)
				publicGatewayFloatingIPPrototypeModel.ID = core.StringPtr("r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePublicGatewayOptions model
				createPublicGatewayOptionsModel := new(vpcv1.CreatePublicGatewayOptions)
				createPublicGatewayOptionsModel.VPC = vpcIdentityModel
				createPublicGatewayOptionsModel.Zone = zoneIdentityModel
				createPublicGatewayOptionsModel.FloatingIP = publicGatewayFloatingIPPrototypeModel
				createPublicGatewayOptionsModel.Name = core.StringPtr("my-public-gateway")
				createPublicGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreatePublicGateway(createPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreatePublicGatewayOptions model with no property values
				createPublicGatewayOptionsModelNew := new(vpcv1.CreatePublicGatewayOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreatePublicGateway(createPublicGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreatePublicGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID model
				publicGatewayFloatingIPPrototypeModel := new(vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID)
				publicGatewayFloatingIPPrototypeModel.ID = core.StringPtr("r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreatePublicGatewayOptions model
				createPublicGatewayOptionsModel := new(vpcv1.CreatePublicGatewayOptions)
				createPublicGatewayOptionsModel.VPC = vpcIdentityModel
				createPublicGatewayOptionsModel.Zone = zoneIdentityModel
				createPublicGatewayOptionsModel.FloatingIP = publicGatewayFloatingIPPrototypeModel
				createPublicGatewayOptionsModel.Name = core.StringPtr("my-public-gateway")
				createPublicGatewayOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreatePublicGateway(createPublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeletePublicGateway(deletePublicGatewayOptions *DeletePublicGatewayOptions)`, func() {
		version := "2024-06-23"
		deletePublicGatewayPath := "/public_gateways/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deletePublicGatewayPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeletePublicGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeletePublicGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeletePublicGatewayOptions model
				deletePublicGatewayOptionsModel := new(vpcv1.DeletePublicGatewayOptions)
				deletePublicGatewayOptionsModel.ID = core.StringPtr("testString")
				deletePublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeletePublicGateway(deletePublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeletePublicGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeletePublicGatewayOptions model
				deletePublicGatewayOptionsModel := new(vpcv1.DeletePublicGatewayOptions)
				deletePublicGatewayOptionsModel.ID = core.StringPtr("testString")
				deletePublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeletePublicGateway(deletePublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeletePublicGatewayOptions model with no property values
				deletePublicGatewayOptionsModelNew := new(vpcv1.DeletePublicGatewayOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeletePublicGateway(deletePublicGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetPublicGateway(getPublicGatewayOptions *GetPublicGatewayOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getPublicGatewayPath := "/public_gateways/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPublicGatewayPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetPublicGateway with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPublicGatewayOptions model
				getPublicGatewayOptionsModel := new(vpcv1.GetPublicGatewayOptions)
				getPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				getPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetPublicGateway(getPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetPublicGateway(getPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetPublicGateway(getPublicGatewayOptions *GetPublicGatewayOptions)`, func() {
		version := "2024-06-23"
		getPublicGatewayPath := "/public_gateways/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPublicGatewayPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetPublicGateway successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetPublicGatewayOptions model
				getPublicGatewayOptionsModel := new(vpcv1.GetPublicGatewayOptions)
				getPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				getPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetPublicGatewayWithContext(ctx, getPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetPublicGateway(getPublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetPublicGatewayWithContext(ctx, getPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getPublicGatewayPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetPublicGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetPublicGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetPublicGatewayOptions model
				getPublicGatewayOptionsModel := new(vpcv1.GetPublicGatewayOptions)
				getPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				getPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetPublicGateway(getPublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetPublicGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPublicGatewayOptions model
				getPublicGatewayOptionsModel := new(vpcv1.GetPublicGatewayOptions)
				getPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				getPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetPublicGateway(getPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetPublicGatewayOptions model with no property values
				getPublicGatewayOptionsModelNew := new(vpcv1.GetPublicGatewayOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetPublicGateway(getPublicGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetPublicGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetPublicGatewayOptions model
				getPublicGatewayOptionsModel := new(vpcv1.GetPublicGatewayOptions)
				getPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				getPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetPublicGateway(getPublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdatePublicGateway(updatePublicGatewayOptions *UpdatePublicGatewayOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updatePublicGatewayPath := "/public_gateways/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePublicGatewayPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdatePublicGateway with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the PublicGatewayPatch model
				publicGatewayPatchModel := new(vpcv1.PublicGatewayPatch)
				publicGatewayPatchModel.Name = core.StringPtr("my-public-gateway-updated")
				publicGatewayPatchModelAsPatch, asPatchErr := publicGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePublicGatewayOptions model
				updatePublicGatewayOptionsModel := new(vpcv1.UpdatePublicGatewayOptions)
				updatePublicGatewayOptionsModel.ID = core.StringPtr("testString")
				updatePublicGatewayOptionsModel.PublicGatewayPatch = publicGatewayPatchModelAsPatch
				updatePublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdatePublicGateway(updatePublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdatePublicGateway(updatePublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdatePublicGateway(updatePublicGatewayOptions *UpdatePublicGatewayOptions)`, func() {
		version := "2024-06-23"
		updatePublicGatewayPath := "/public_gateways/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePublicGatewayPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdatePublicGateway successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the PublicGatewayPatch model
				publicGatewayPatchModel := new(vpcv1.PublicGatewayPatch)
				publicGatewayPatchModel.Name = core.StringPtr("my-public-gateway-updated")
				publicGatewayPatchModelAsPatch, asPatchErr := publicGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePublicGatewayOptions model
				updatePublicGatewayOptionsModel := new(vpcv1.UpdatePublicGatewayOptions)
				updatePublicGatewayOptionsModel.ID = core.StringPtr("testString")
				updatePublicGatewayOptionsModel.PublicGatewayPatch = publicGatewayPatchModelAsPatch
				updatePublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdatePublicGatewayWithContext(ctx, updatePublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdatePublicGateway(updatePublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdatePublicGatewayWithContext(ctx, updatePublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updatePublicGatewayPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdatePublicGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdatePublicGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the PublicGatewayPatch model
				publicGatewayPatchModel := new(vpcv1.PublicGatewayPatch)
				publicGatewayPatchModel.Name = core.StringPtr("my-public-gateway-updated")
				publicGatewayPatchModelAsPatch, asPatchErr := publicGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePublicGatewayOptions model
				updatePublicGatewayOptionsModel := new(vpcv1.UpdatePublicGatewayOptions)
				updatePublicGatewayOptionsModel.ID = core.StringPtr("testString")
				updatePublicGatewayOptionsModel.PublicGatewayPatch = publicGatewayPatchModelAsPatch
				updatePublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdatePublicGateway(updatePublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdatePublicGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the PublicGatewayPatch model
				publicGatewayPatchModel := new(vpcv1.PublicGatewayPatch)
				publicGatewayPatchModel.Name = core.StringPtr("my-public-gateway-updated")
				publicGatewayPatchModelAsPatch, asPatchErr := publicGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePublicGatewayOptions model
				updatePublicGatewayOptionsModel := new(vpcv1.UpdatePublicGatewayOptions)
				updatePublicGatewayOptionsModel.ID = core.StringPtr("testString")
				updatePublicGatewayOptionsModel.PublicGatewayPatch = publicGatewayPatchModelAsPatch
				updatePublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdatePublicGateway(updatePublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdatePublicGatewayOptions model with no property values
				updatePublicGatewayOptionsModelNew := new(vpcv1.UpdatePublicGatewayOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdatePublicGateway(updatePublicGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdatePublicGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the PublicGatewayPatch model
				publicGatewayPatchModel := new(vpcv1.PublicGatewayPatch)
				publicGatewayPatchModel.Name = core.StringPtr("my-public-gateway-updated")
				publicGatewayPatchModelAsPatch, asPatchErr := publicGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdatePublicGatewayOptions model
				updatePublicGatewayOptionsModel := new(vpcv1.UpdatePublicGatewayOptions)
				updatePublicGatewayOptionsModel.ID = core.StringPtr("testString")
				updatePublicGatewayOptionsModel.PublicGatewayPatch = publicGatewayPatchModelAsPatch
				updatePublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdatePublicGateway(updatePublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListReservations(listReservationsOptions *ListReservationsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listReservationsPath := "/reservations"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listReservationsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["profile.resource_type"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["affinity_policy"]).To(Equal([]string{"automatic"}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListReservations with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListReservationsOptions model
				listReservationsOptionsModel := new(vpcv1.ListReservationsOptions)
				listReservationsOptionsModel.Start = core.StringPtr("testString")
				listReservationsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listReservationsOptionsModel.Name = core.StringPtr("my-name")
				listReservationsOptionsModel.ProfileResourceType = core.StringPtr("testString")
				listReservationsOptionsModel.AffinityPolicy = core.StringPtr("automatic")
				listReservationsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listReservationsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listReservationsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListReservations(listReservationsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListReservations(listReservationsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListReservations(listReservationsOptions *ListReservationsOptions)`, func() {
		version := "2024-06-23"
		listReservationsPath := "/reservations"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listReservationsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["profile.resource_type"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["affinity_policy"]).To(Equal([]string{"automatic"}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "reservations": [{"affinity_policy": "automatic", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "Term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListReservations successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListReservationsOptions model
				listReservationsOptionsModel := new(vpcv1.ListReservationsOptions)
				listReservationsOptionsModel.Start = core.StringPtr("testString")
				listReservationsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listReservationsOptionsModel.Name = core.StringPtr("my-name")
				listReservationsOptionsModel.ProfileResourceType = core.StringPtr("testString")
				listReservationsOptionsModel.AffinityPolicy = core.StringPtr("automatic")
				listReservationsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listReservationsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listReservationsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListReservationsWithContext(ctx, listReservationsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListReservations(listReservationsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListReservationsWithContext(ctx, listReservationsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listReservationsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["profile.resource_type"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["affinity_policy"]).To(Equal([]string{"automatic"}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "reservations": [{"affinity_policy": "automatic", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "Term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListReservations successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListReservations(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListReservationsOptions model
				listReservationsOptionsModel := new(vpcv1.ListReservationsOptions)
				listReservationsOptionsModel.Start = core.StringPtr("testString")
				listReservationsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listReservationsOptionsModel.Name = core.StringPtr("my-name")
				listReservationsOptionsModel.ProfileResourceType = core.StringPtr("testString")
				listReservationsOptionsModel.AffinityPolicy = core.StringPtr("automatic")
				listReservationsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listReservationsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listReservationsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListReservations(listReservationsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListReservations with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListReservationsOptions model
				listReservationsOptionsModel := new(vpcv1.ListReservationsOptions)
				listReservationsOptionsModel.Start = core.StringPtr("testString")
				listReservationsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listReservationsOptionsModel.Name = core.StringPtr("my-name")
				listReservationsOptionsModel.ProfileResourceType = core.StringPtr("testString")
				listReservationsOptionsModel.AffinityPolicy = core.StringPtr("automatic")
				listReservationsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listReservationsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listReservationsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListReservations(listReservationsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListReservations successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListReservationsOptions model
				listReservationsOptionsModel := new(vpcv1.ListReservationsOptions)
				listReservationsOptionsModel.Start = core.StringPtr("testString")
				listReservationsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listReservationsOptionsModel.Name = core.StringPtr("my-name")
				listReservationsOptionsModel.ProfileResourceType = core.StringPtr("testString")
				listReservationsOptionsModel.AffinityPolicy = core.StringPtr("automatic")
				listReservationsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listReservationsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listReservationsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListReservations(listReservationsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ReservationCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ReservationCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ReservationCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listReservationsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"reservations":[{"affinity_policy":"automatic","capacity":{"allocated":10,"available":8,"status":"allocated","total":10,"used":2},"committed_use":{"expiration_at":"2019-01-01T12:00:00.000Z","expiration_policy":"release","term":"Term"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","lifecycle_state":"stable","name":"my-reservation","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"reservation","status":"activating","status_reasons":[{"code":"cannot_activate_no_capacity_available","message":"The reservation cannot be activated because capacity is unavailable","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"reservations":[{"affinity_policy":"automatic","capacity":{"allocated":10,"available":8,"status":"allocated","total":10,"used":2},"committed_use":{"expiration_at":"2019-01-01T12:00:00.000Z","expiration_policy":"release","term":"Term"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","lifecycle_state":"stable","name":"my-reservation","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"reservation","status":"activating","status_reasons":[{"code":"cannot_activate_no_capacity_available","message":"The reservation cannot be activated because capacity is unavailable","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use ReservationsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listReservationsOptionsModel := &vpcv1.ListReservationsOptions{
					Limit:               core.Int64Ptr(int64(10)),
					Name:                core.StringPtr("my-name"),
					ProfileResourceType: core.StringPtr("testString"),
					AffinityPolicy:      core.StringPtr("automatic"),
					ResourceGroupID:     core.StringPtr("testString"),
					ZoneName:            core.StringPtr("us-south-1"),
				}

				pager, err := vpcService.NewReservationsPager(listReservationsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.Reservation
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use ReservationsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listReservationsOptionsModel := &vpcv1.ListReservationsOptions{
					Limit:               core.Int64Ptr(int64(10)),
					Name:                core.StringPtr("my-name"),
					ProfileResourceType: core.StringPtr("testString"),
					AffinityPolicy:      core.StringPtr("automatic"),
					ResourceGroupID:     core.StringPtr("testString"),
					ZoneName:            core.StringPtr("us-south-1"),
				}

				pager, err := vpcService.NewReservationsPager(listReservationsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateReservation(createReservationOptions *CreateReservationOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createReservationPath := "/reservations"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createReservationPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateReservation with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ReservationCapacityPrototype model
				reservationCapacityPrototypeModel := new(vpcv1.ReservationCapacityPrototype)
				reservationCapacityPrototypeModel.Total = core.Int64Ptr(int64(10))

				// Construct an instance of the ReservationCommittedUsePrototype model
				reservationCommittedUsePrototypeModel := new(vpcv1.ReservationCommittedUsePrototype)
				reservationCommittedUsePrototypeModel.ExpirationPolicy = core.StringPtr("release")
				reservationCommittedUsePrototypeModel.Term = core.StringPtr("testString")

				// Construct an instance of the ReservationProfilePrototype model
				reservationProfilePrototypeModel := new(vpcv1.ReservationProfilePrototype)
				reservationProfilePrototypeModel.Name = core.StringPtr("bx2-4x16")
				reservationProfilePrototypeModel.ResourceType = core.StringPtr("bare_metal_server_profile")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateReservationOptions model
				createReservationOptionsModel := new(vpcv1.CreateReservationOptions)
				createReservationOptionsModel.Capacity = reservationCapacityPrototypeModel
				createReservationOptionsModel.CommittedUse = reservationCommittedUsePrototypeModel
				createReservationOptionsModel.Profile = reservationProfilePrototypeModel
				createReservationOptionsModel.Zone = zoneIdentityModel
				createReservationOptionsModel.AffinityPolicy = core.StringPtr("automatic")
				createReservationOptionsModel.Name = core.StringPtr("my-reservation")
				createReservationOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateReservation(createReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateReservation(createReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateReservation(createReservationOptions *CreateReservationOptions)`, func() {
		version := "2024-06-23"
		createReservationPath := "/reservations"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createReservationPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"affinity_policy": "automatic", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "Term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateReservation successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ReservationCapacityPrototype model
				reservationCapacityPrototypeModel := new(vpcv1.ReservationCapacityPrototype)
				reservationCapacityPrototypeModel.Total = core.Int64Ptr(int64(10))

				// Construct an instance of the ReservationCommittedUsePrototype model
				reservationCommittedUsePrototypeModel := new(vpcv1.ReservationCommittedUsePrototype)
				reservationCommittedUsePrototypeModel.ExpirationPolicy = core.StringPtr("release")
				reservationCommittedUsePrototypeModel.Term = core.StringPtr("testString")

				// Construct an instance of the ReservationProfilePrototype model
				reservationProfilePrototypeModel := new(vpcv1.ReservationProfilePrototype)
				reservationProfilePrototypeModel.Name = core.StringPtr("bx2-4x16")
				reservationProfilePrototypeModel.ResourceType = core.StringPtr("bare_metal_server_profile")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateReservationOptions model
				createReservationOptionsModel := new(vpcv1.CreateReservationOptions)
				createReservationOptionsModel.Capacity = reservationCapacityPrototypeModel
				createReservationOptionsModel.CommittedUse = reservationCommittedUsePrototypeModel
				createReservationOptionsModel.Profile = reservationProfilePrototypeModel
				createReservationOptionsModel.Zone = zoneIdentityModel
				createReservationOptionsModel.AffinityPolicy = core.StringPtr("automatic")
				createReservationOptionsModel.Name = core.StringPtr("my-reservation")
				createReservationOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateReservationWithContext(ctx, createReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateReservation(createReservationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateReservationWithContext(ctx, createReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createReservationPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"affinity_policy": "automatic", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "Term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateReservation successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateReservation(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ReservationCapacityPrototype model
				reservationCapacityPrototypeModel := new(vpcv1.ReservationCapacityPrototype)
				reservationCapacityPrototypeModel.Total = core.Int64Ptr(int64(10))

				// Construct an instance of the ReservationCommittedUsePrototype model
				reservationCommittedUsePrototypeModel := new(vpcv1.ReservationCommittedUsePrototype)
				reservationCommittedUsePrototypeModel.ExpirationPolicy = core.StringPtr("release")
				reservationCommittedUsePrototypeModel.Term = core.StringPtr("testString")

				// Construct an instance of the ReservationProfilePrototype model
				reservationProfilePrototypeModel := new(vpcv1.ReservationProfilePrototype)
				reservationProfilePrototypeModel.Name = core.StringPtr("bx2-4x16")
				reservationProfilePrototypeModel.ResourceType = core.StringPtr("bare_metal_server_profile")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateReservationOptions model
				createReservationOptionsModel := new(vpcv1.CreateReservationOptions)
				createReservationOptionsModel.Capacity = reservationCapacityPrototypeModel
				createReservationOptionsModel.CommittedUse = reservationCommittedUsePrototypeModel
				createReservationOptionsModel.Profile = reservationProfilePrototypeModel
				createReservationOptionsModel.Zone = zoneIdentityModel
				createReservationOptionsModel.AffinityPolicy = core.StringPtr("automatic")
				createReservationOptionsModel.Name = core.StringPtr("my-reservation")
				createReservationOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateReservation(createReservationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateReservation with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ReservationCapacityPrototype model
				reservationCapacityPrototypeModel := new(vpcv1.ReservationCapacityPrototype)
				reservationCapacityPrototypeModel.Total = core.Int64Ptr(int64(10))

				// Construct an instance of the ReservationCommittedUsePrototype model
				reservationCommittedUsePrototypeModel := new(vpcv1.ReservationCommittedUsePrototype)
				reservationCommittedUsePrototypeModel.ExpirationPolicy = core.StringPtr("release")
				reservationCommittedUsePrototypeModel.Term = core.StringPtr("testString")

				// Construct an instance of the ReservationProfilePrototype model
				reservationProfilePrototypeModel := new(vpcv1.ReservationProfilePrototype)
				reservationProfilePrototypeModel.Name = core.StringPtr("bx2-4x16")
				reservationProfilePrototypeModel.ResourceType = core.StringPtr("bare_metal_server_profile")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateReservationOptions model
				createReservationOptionsModel := new(vpcv1.CreateReservationOptions)
				createReservationOptionsModel.Capacity = reservationCapacityPrototypeModel
				createReservationOptionsModel.CommittedUse = reservationCommittedUsePrototypeModel
				createReservationOptionsModel.Profile = reservationProfilePrototypeModel
				createReservationOptionsModel.Zone = zoneIdentityModel
				createReservationOptionsModel.AffinityPolicy = core.StringPtr("automatic")
				createReservationOptionsModel.Name = core.StringPtr("my-reservation")
				createReservationOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateReservation(createReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateReservationOptions model with no property values
				createReservationOptionsModelNew := new(vpcv1.CreateReservationOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateReservation(createReservationOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateReservation successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ReservationCapacityPrototype model
				reservationCapacityPrototypeModel := new(vpcv1.ReservationCapacityPrototype)
				reservationCapacityPrototypeModel.Total = core.Int64Ptr(int64(10))

				// Construct an instance of the ReservationCommittedUsePrototype model
				reservationCommittedUsePrototypeModel := new(vpcv1.ReservationCommittedUsePrototype)
				reservationCommittedUsePrototypeModel.ExpirationPolicy = core.StringPtr("release")
				reservationCommittedUsePrototypeModel.Term = core.StringPtr("testString")

				// Construct an instance of the ReservationProfilePrototype model
				reservationProfilePrototypeModel := new(vpcv1.ReservationProfilePrototype)
				reservationProfilePrototypeModel.Name = core.StringPtr("bx2-4x16")
				reservationProfilePrototypeModel.ResourceType = core.StringPtr("bare_metal_server_profile")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateReservationOptions model
				createReservationOptionsModel := new(vpcv1.CreateReservationOptions)
				createReservationOptionsModel.Capacity = reservationCapacityPrototypeModel
				createReservationOptionsModel.CommittedUse = reservationCommittedUsePrototypeModel
				createReservationOptionsModel.Profile = reservationProfilePrototypeModel
				createReservationOptionsModel.Zone = zoneIdentityModel
				createReservationOptionsModel.AffinityPolicy = core.StringPtr("automatic")
				createReservationOptionsModel.Name = core.StringPtr("my-reservation")
				createReservationOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateReservation(createReservationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteReservation(deleteReservationOptions *DeleteReservationOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deleteReservationPath := "/reservations/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteReservationPath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeleteReservation with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteReservationOptions model
				deleteReservationOptionsModel := new(vpcv1.DeleteReservationOptions)
				deleteReservationOptionsModel.ID = core.StringPtr("testString")
				deleteReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeleteReservation(deleteReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeleteReservation(deleteReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteReservation(deleteReservationOptions *DeleteReservationOptions)`, func() {
		version := "2024-06-23"
		deleteReservationPath := "/reservations/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteReservationPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"affinity_policy": "automatic", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "Term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke DeleteReservation successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeleteReservationOptions model
				deleteReservationOptionsModel := new(vpcv1.DeleteReservationOptions)
				deleteReservationOptionsModel.ID = core.StringPtr("testString")
				deleteReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeleteReservationWithContext(ctx, deleteReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeleteReservation(deleteReservationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeleteReservationWithContext(ctx, deleteReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteReservationPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"affinity_policy": "automatic", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "Term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke DeleteReservation successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeleteReservation(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeleteReservationOptions model
				deleteReservationOptionsModel := new(vpcv1.DeleteReservationOptions)
				deleteReservationOptionsModel.ID = core.StringPtr("testString")
				deleteReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeleteReservation(deleteReservationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeleteReservation with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteReservationOptions model
				deleteReservationOptionsModel := new(vpcv1.DeleteReservationOptions)
				deleteReservationOptionsModel.ID = core.StringPtr("testString")
				deleteReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeleteReservation(deleteReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeleteReservationOptions model with no property values
				deleteReservationOptionsModelNew := new(vpcv1.DeleteReservationOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeleteReservation(deleteReservationOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteReservation successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteReservationOptions model
				deleteReservationOptionsModel := new(vpcv1.DeleteReservationOptions)
				deleteReservationOptionsModel.ID = core.StringPtr("testString")
				deleteReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeleteReservation(deleteReservationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetReservation(getReservationOptions *GetReservationOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getReservationPath := "/reservations/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getReservationPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetReservation with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetReservationOptions model
				getReservationOptionsModel := new(vpcv1.GetReservationOptions)
				getReservationOptionsModel.ID = core.StringPtr("testString")
				getReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetReservation(getReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetReservation(getReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetReservation(getReservationOptions *GetReservationOptions)`, func() {
		version := "2024-06-23"
		getReservationPath := "/reservations/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getReservationPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"affinity_policy": "automatic", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "Term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetReservation successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetReservationOptions model
				getReservationOptionsModel := new(vpcv1.GetReservationOptions)
				getReservationOptionsModel.ID = core.StringPtr("testString")
				getReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetReservationWithContext(ctx, getReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetReservation(getReservationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetReservationWithContext(ctx, getReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getReservationPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"affinity_policy": "automatic", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "Term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetReservation successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetReservation(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetReservationOptions model
				getReservationOptionsModel := new(vpcv1.GetReservationOptions)
				getReservationOptionsModel.ID = core.StringPtr("testString")
				getReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetReservation(getReservationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetReservation with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetReservationOptions model
				getReservationOptionsModel := new(vpcv1.GetReservationOptions)
				getReservationOptionsModel.ID = core.StringPtr("testString")
				getReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetReservation(getReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetReservationOptions model with no property values
				getReservationOptionsModelNew := new(vpcv1.GetReservationOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetReservation(getReservationOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetReservation successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetReservationOptions model
				getReservationOptionsModel := new(vpcv1.GetReservationOptions)
				getReservationOptionsModel.ID = core.StringPtr("testString")
				getReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetReservation(getReservationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateReservation(updateReservationOptions *UpdateReservationOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateReservationPath := "/reservations/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateReservationPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateReservation with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ReservationCapacityPatch model
				reservationCapacityPatchModel := new(vpcv1.ReservationCapacityPatch)
				reservationCapacityPatchModel.Total = core.Int64Ptr(int64(10))

				// Construct an instance of the ReservationCommittedUsePatch model
				reservationCommittedUsePatchModel := new(vpcv1.ReservationCommittedUsePatch)
				reservationCommittedUsePatchModel.ExpirationPolicy = core.StringPtr("release")
				reservationCommittedUsePatchModel.Term = core.StringPtr("testString")

				// Construct an instance of the ReservationProfilePatch model
				reservationProfilePatchModel := new(vpcv1.ReservationProfilePatch)
				reservationProfilePatchModel.Name = core.StringPtr("bx2-4x16")
				reservationProfilePatchModel.ResourceType = core.StringPtr("bare_metal_server_profile")

				// Construct an instance of the ReservationPatch model
				reservationPatchModel := new(vpcv1.ReservationPatch)
				reservationPatchModel.AffinityPolicy = core.StringPtr("automatic")
				reservationPatchModel.Capacity = reservationCapacityPatchModel
				reservationPatchModel.CommittedUse = reservationCommittedUsePatchModel
				reservationPatchModel.Name = core.StringPtr("my-reservation")
				reservationPatchModel.Profile = reservationProfilePatchModel
				reservationPatchModelAsPatch, asPatchErr := reservationPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateReservationOptions model
				updateReservationOptionsModel := new(vpcv1.UpdateReservationOptions)
				updateReservationOptionsModel.ID = core.StringPtr("testString")
				updateReservationOptionsModel.ReservationPatch = reservationPatchModelAsPatch
				updateReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateReservation(updateReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateReservation(updateReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateReservation(updateReservationOptions *UpdateReservationOptions)`, func() {
		version := "2024-06-23"
		updateReservationPath := "/reservations/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateReservationPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"affinity_policy": "automatic", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "Term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateReservation successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ReservationCapacityPatch model
				reservationCapacityPatchModel := new(vpcv1.ReservationCapacityPatch)
				reservationCapacityPatchModel.Total = core.Int64Ptr(int64(10))

				// Construct an instance of the ReservationCommittedUsePatch model
				reservationCommittedUsePatchModel := new(vpcv1.ReservationCommittedUsePatch)
				reservationCommittedUsePatchModel.ExpirationPolicy = core.StringPtr("release")
				reservationCommittedUsePatchModel.Term = core.StringPtr("testString")

				// Construct an instance of the ReservationProfilePatch model
				reservationProfilePatchModel := new(vpcv1.ReservationProfilePatch)
				reservationProfilePatchModel.Name = core.StringPtr("bx2-4x16")
				reservationProfilePatchModel.ResourceType = core.StringPtr("bare_metal_server_profile")

				// Construct an instance of the ReservationPatch model
				reservationPatchModel := new(vpcv1.ReservationPatch)
				reservationPatchModel.AffinityPolicy = core.StringPtr("automatic")
				reservationPatchModel.Capacity = reservationCapacityPatchModel
				reservationPatchModel.CommittedUse = reservationCommittedUsePatchModel
				reservationPatchModel.Name = core.StringPtr("my-reservation")
				reservationPatchModel.Profile = reservationProfilePatchModel
				reservationPatchModelAsPatch, asPatchErr := reservationPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateReservationOptions model
				updateReservationOptionsModel := new(vpcv1.UpdateReservationOptions)
				updateReservationOptionsModel.ID = core.StringPtr("testString")
				updateReservationOptionsModel.ReservationPatch = reservationPatchModelAsPatch
				updateReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateReservationWithContext(ctx, updateReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateReservation(updateReservationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateReservationWithContext(ctx, updateReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateReservationPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"affinity_policy": "automatic", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "Term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateReservation successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateReservation(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ReservationCapacityPatch model
				reservationCapacityPatchModel := new(vpcv1.ReservationCapacityPatch)
				reservationCapacityPatchModel.Total = core.Int64Ptr(int64(10))

				// Construct an instance of the ReservationCommittedUsePatch model
				reservationCommittedUsePatchModel := new(vpcv1.ReservationCommittedUsePatch)
				reservationCommittedUsePatchModel.ExpirationPolicy = core.StringPtr("release")
				reservationCommittedUsePatchModel.Term = core.StringPtr("testString")

				// Construct an instance of the ReservationProfilePatch model
				reservationProfilePatchModel := new(vpcv1.ReservationProfilePatch)
				reservationProfilePatchModel.Name = core.StringPtr("bx2-4x16")
				reservationProfilePatchModel.ResourceType = core.StringPtr("bare_metal_server_profile")

				// Construct an instance of the ReservationPatch model
				reservationPatchModel := new(vpcv1.ReservationPatch)
				reservationPatchModel.AffinityPolicy = core.StringPtr("automatic")
				reservationPatchModel.Capacity = reservationCapacityPatchModel
				reservationPatchModel.CommittedUse = reservationCommittedUsePatchModel
				reservationPatchModel.Name = core.StringPtr("my-reservation")
				reservationPatchModel.Profile = reservationProfilePatchModel
				reservationPatchModelAsPatch, asPatchErr := reservationPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateReservationOptions model
				updateReservationOptionsModel := new(vpcv1.UpdateReservationOptions)
				updateReservationOptionsModel.ID = core.StringPtr("testString")
				updateReservationOptionsModel.ReservationPatch = reservationPatchModelAsPatch
				updateReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateReservation(updateReservationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateReservation with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ReservationCapacityPatch model
				reservationCapacityPatchModel := new(vpcv1.ReservationCapacityPatch)
				reservationCapacityPatchModel.Total = core.Int64Ptr(int64(10))

				// Construct an instance of the ReservationCommittedUsePatch model
				reservationCommittedUsePatchModel := new(vpcv1.ReservationCommittedUsePatch)
				reservationCommittedUsePatchModel.ExpirationPolicy = core.StringPtr("release")
				reservationCommittedUsePatchModel.Term = core.StringPtr("testString")

				// Construct an instance of the ReservationProfilePatch model
				reservationProfilePatchModel := new(vpcv1.ReservationProfilePatch)
				reservationProfilePatchModel.Name = core.StringPtr("bx2-4x16")
				reservationProfilePatchModel.ResourceType = core.StringPtr("bare_metal_server_profile")

				// Construct an instance of the ReservationPatch model
				reservationPatchModel := new(vpcv1.ReservationPatch)
				reservationPatchModel.AffinityPolicy = core.StringPtr("automatic")
				reservationPatchModel.Capacity = reservationCapacityPatchModel
				reservationPatchModel.CommittedUse = reservationCommittedUsePatchModel
				reservationPatchModel.Name = core.StringPtr("my-reservation")
				reservationPatchModel.Profile = reservationProfilePatchModel
				reservationPatchModelAsPatch, asPatchErr := reservationPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateReservationOptions model
				updateReservationOptionsModel := new(vpcv1.UpdateReservationOptions)
				updateReservationOptionsModel.ID = core.StringPtr("testString")
				updateReservationOptionsModel.ReservationPatch = reservationPatchModelAsPatch
				updateReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateReservation(updateReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateReservationOptions model with no property values
				updateReservationOptionsModelNew := new(vpcv1.UpdateReservationOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateReservation(updateReservationOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateReservation successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ReservationCapacityPatch model
				reservationCapacityPatchModel := new(vpcv1.ReservationCapacityPatch)
				reservationCapacityPatchModel.Total = core.Int64Ptr(int64(10))

				// Construct an instance of the ReservationCommittedUsePatch model
				reservationCommittedUsePatchModel := new(vpcv1.ReservationCommittedUsePatch)
				reservationCommittedUsePatchModel.ExpirationPolicy = core.StringPtr("release")
				reservationCommittedUsePatchModel.Term = core.StringPtr("testString")

				// Construct an instance of the ReservationProfilePatch model
				reservationProfilePatchModel := new(vpcv1.ReservationProfilePatch)
				reservationProfilePatchModel.Name = core.StringPtr("bx2-4x16")
				reservationProfilePatchModel.ResourceType = core.StringPtr("bare_metal_server_profile")

				// Construct an instance of the ReservationPatch model
				reservationPatchModel := new(vpcv1.ReservationPatch)
				reservationPatchModel.AffinityPolicy = core.StringPtr("automatic")
				reservationPatchModel.Capacity = reservationCapacityPatchModel
				reservationPatchModel.CommittedUse = reservationCommittedUsePatchModel
				reservationPatchModel.Name = core.StringPtr("my-reservation")
				reservationPatchModel.Profile = reservationProfilePatchModel
				reservationPatchModelAsPatch, asPatchErr := reservationPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateReservationOptions model
				updateReservationOptionsModel := new(vpcv1.UpdateReservationOptions)
				updateReservationOptionsModel.ID = core.StringPtr("testString")
				updateReservationOptionsModel.ReservationPatch = reservationPatchModelAsPatch
				updateReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateReservation(updateReservationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ActivateReservation(activateReservationOptions *ActivateReservationOptions)`, func() {
		version := "2024-06-23"
		activateReservationPath := "/reservations/testString/activate"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(activateReservationPath))
					Expect(req.Method).To(Equal("POST"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke ActivateReservation successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.ActivateReservation(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the ActivateReservationOptions model
				activateReservationOptionsModel := new(vpcv1.ActivateReservationOptions)
				activateReservationOptionsModel.ID = core.StringPtr("testString")
				activateReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.ActivateReservation(activateReservationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke ActivateReservation with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ActivateReservationOptions model
				activateReservationOptionsModel := new(vpcv1.ActivateReservationOptions)
				activateReservationOptionsModel.ID = core.StringPtr("testString")
				activateReservationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.ActivateReservation(activateReservationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the ActivateReservationOptions model with no property values
				activateReservationOptionsModelNew := new(vpcv1.ActivateReservationOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.ActivateReservation(activateReservationOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSecurityGroups(listSecurityGroupsOptions *ListSecurityGroupsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listSecurityGroupsPath := "/security_groups"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSecurityGroupsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListSecurityGroups with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSecurityGroupsOptions model
				listSecurityGroupsOptionsModel := new(vpcv1.ListSecurityGroupsOptions)
				listSecurityGroupsOptionsModel.Start = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSecurityGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.VPCID = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listSecurityGroupsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listSecurityGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListSecurityGroups(listSecurityGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListSecurityGroups(listSecurityGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSecurityGroups(listSecurityGroupsOptions *ListSecurityGroupsOptions)`, func() {
		version := "2024-06-23"
		listSecurityGroupsPath := "/security_groups"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSecurityGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListSecurityGroups successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListSecurityGroupsOptions model
				listSecurityGroupsOptionsModel := new(vpcv1.ListSecurityGroupsOptions)
				listSecurityGroupsOptionsModel.Start = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSecurityGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.VPCID = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listSecurityGroupsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listSecurityGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListSecurityGroupsWithContext(ctx, listSecurityGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListSecurityGroups(listSecurityGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListSecurityGroupsWithContext(ctx, listSecurityGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSecurityGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListSecurityGroups successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListSecurityGroups(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListSecurityGroupsOptions model
				listSecurityGroupsOptionsModel := new(vpcv1.ListSecurityGroupsOptions)
				listSecurityGroupsOptionsModel.Start = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSecurityGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.VPCID = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listSecurityGroupsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listSecurityGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListSecurityGroups(listSecurityGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListSecurityGroups with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSecurityGroupsOptions model
				listSecurityGroupsOptionsModel := new(vpcv1.ListSecurityGroupsOptions)
				listSecurityGroupsOptionsModel.Start = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSecurityGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.VPCID = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listSecurityGroupsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listSecurityGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListSecurityGroups(listSecurityGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListSecurityGroups successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSecurityGroupsOptions model
				listSecurityGroupsOptionsModel := new(vpcv1.ListSecurityGroupsOptions)
				listSecurityGroupsOptionsModel.Start = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSecurityGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.VPCID = core.StringPtr("testString")
				listSecurityGroupsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listSecurityGroupsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listSecurityGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListSecurityGroups(listSecurityGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.SecurityGroupCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.SecurityGroupCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.SecurityGroupCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSecurityGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","local":{"address":"192.168.3.4"},"remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","local":{"address":"192.168.3.4"},"remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use SecurityGroupsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSecurityGroupsOptionsModel := &vpcv1.ListSecurityGroupsOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					VPCID:           core.StringPtr("testString"),
					VPCCRN:          core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:         core.StringPtr("my-vpc"),
				}

				pager, err := vpcService.NewSecurityGroupsPager(listSecurityGroupsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.SecurityGroup
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use SecurityGroupsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSecurityGroupsOptionsModel := &vpcv1.ListSecurityGroupsOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					VPCID:           core.StringPtr("testString"),
					VPCCRN:          core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:         core.StringPtr("my-vpc"),
				}

				pager, err := vpcService.NewSecurityGroupsPager(listSecurityGroupsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateSecurityGroup(createSecurityGroupOptions *CreateSecurityGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createSecurityGroupPath := "/security_groups"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSecurityGroupPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateSecurityGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupRuleLocalPrototypeIP model
				securityGroupRuleLocalPrototypeModel := new(vpcv1.SecurityGroupRuleLocalPrototypeIP)
				securityGroupRuleLocalPrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePrototypeIP model
				securityGroupRuleRemotePrototypeModel := new(vpcv1.SecurityGroupRuleRemotePrototypeIP)
				securityGroupRuleRemotePrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model
				securityGroupRulePrototypeModel := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll)
				securityGroupRulePrototypeModel.Direction = core.StringPtr("inbound")
				securityGroupRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePrototypeModel.Local = securityGroupRuleLocalPrototypeModel
				securityGroupRulePrototypeModel.Remote = securityGroupRuleRemotePrototypeModel
				securityGroupRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateSecurityGroupOptions model
				createSecurityGroupOptionsModel := new(vpcv1.CreateSecurityGroupOptions)
				createSecurityGroupOptionsModel.VPC = vpcIdentityModel
				createSecurityGroupOptionsModel.Name = core.StringPtr("my-security-group")
				createSecurityGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createSecurityGroupOptionsModel.Rules = []vpcv1.SecurityGroupRulePrototypeIntf{securityGroupRulePrototypeModel}
				createSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateSecurityGroup(createSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateSecurityGroup(createSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateSecurityGroup(createSecurityGroupOptions *CreateSecurityGroupOptions)`, func() {
		version := "2024-06-23"
		createSecurityGroupPath := "/security_groups"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSecurityGroupPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateSecurityGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupRuleLocalPrototypeIP model
				securityGroupRuleLocalPrototypeModel := new(vpcv1.SecurityGroupRuleLocalPrototypeIP)
				securityGroupRuleLocalPrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePrototypeIP model
				securityGroupRuleRemotePrototypeModel := new(vpcv1.SecurityGroupRuleRemotePrototypeIP)
				securityGroupRuleRemotePrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model
				securityGroupRulePrototypeModel := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll)
				securityGroupRulePrototypeModel.Direction = core.StringPtr("inbound")
				securityGroupRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePrototypeModel.Local = securityGroupRuleLocalPrototypeModel
				securityGroupRulePrototypeModel.Remote = securityGroupRuleRemotePrototypeModel
				securityGroupRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateSecurityGroupOptions model
				createSecurityGroupOptionsModel := new(vpcv1.CreateSecurityGroupOptions)
				createSecurityGroupOptionsModel.VPC = vpcIdentityModel
				createSecurityGroupOptionsModel.Name = core.StringPtr("my-security-group")
				createSecurityGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createSecurityGroupOptionsModel.Rules = []vpcv1.SecurityGroupRulePrototypeIntf{securityGroupRulePrototypeModel}
				createSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateSecurityGroupWithContext(ctx, createSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateSecurityGroup(createSecurityGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateSecurityGroupWithContext(ctx, createSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSecurityGroupPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateSecurityGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateSecurityGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupRuleLocalPrototypeIP model
				securityGroupRuleLocalPrototypeModel := new(vpcv1.SecurityGroupRuleLocalPrototypeIP)
				securityGroupRuleLocalPrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePrototypeIP model
				securityGroupRuleRemotePrototypeModel := new(vpcv1.SecurityGroupRuleRemotePrototypeIP)
				securityGroupRuleRemotePrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model
				securityGroupRulePrototypeModel := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll)
				securityGroupRulePrototypeModel.Direction = core.StringPtr("inbound")
				securityGroupRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePrototypeModel.Local = securityGroupRuleLocalPrototypeModel
				securityGroupRulePrototypeModel.Remote = securityGroupRuleRemotePrototypeModel
				securityGroupRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateSecurityGroupOptions model
				createSecurityGroupOptionsModel := new(vpcv1.CreateSecurityGroupOptions)
				createSecurityGroupOptionsModel.VPC = vpcIdentityModel
				createSecurityGroupOptionsModel.Name = core.StringPtr("my-security-group")
				createSecurityGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createSecurityGroupOptionsModel.Rules = []vpcv1.SecurityGroupRulePrototypeIntf{securityGroupRulePrototypeModel}
				createSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateSecurityGroup(createSecurityGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateSecurityGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupRuleLocalPrototypeIP model
				securityGroupRuleLocalPrototypeModel := new(vpcv1.SecurityGroupRuleLocalPrototypeIP)
				securityGroupRuleLocalPrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePrototypeIP model
				securityGroupRuleRemotePrototypeModel := new(vpcv1.SecurityGroupRuleRemotePrototypeIP)
				securityGroupRuleRemotePrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model
				securityGroupRulePrototypeModel := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll)
				securityGroupRulePrototypeModel.Direction = core.StringPtr("inbound")
				securityGroupRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePrototypeModel.Local = securityGroupRuleLocalPrototypeModel
				securityGroupRulePrototypeModel.Remote = securityGroupRuleRemotePrototypeModel
				securityGroupRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateSecurityGroupOptions model
				createSecurityGroupOptionsModel := new(vpcv1.CreateSecurityGroupOptions)
				createSecurityGroupOptionsModel.VPC = vpcIdentityModel
				createSecurityGroupOptionsModel.Name = core.StringPtr("my-security-group")
				createSecurityGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createSecurityGroupOptionsModel.Rules = []vpcv1.SecurityGroupRulePrototypeIntf{securityGroupRulePrototypeModel}
				createSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateSecurityGroup(createSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateSecurityGroupOptions model with no property values
				createSecurityGroupOptionsModelNew := new(vpcv1.CreateSecurityGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateSecurityGroup(createSecurityGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateSecurityGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupRuleLocalPrototypeIP model
				securityGroupRuleLocalPrototypeModel := new(vpcv1.SecurityGroupRuleLocalPrototypeIP)
				securityGroupRuleLocalPrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePrototypeIP model
				securityGroupRuleRemotePrototypeModel := new(vpcv1.SecurityGroupRuleRemotePrototypeIP)
				securityGroupRuleRemotePrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model
				securityGroupRulePrototypeModel := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll)
				securityGroupRulePrototypeModel.Direction = core.StringPtr("inbound")
				securityGroupRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePrototypeModel.Local = securityGroupRuleLocalPrototypeModel
				securityGroupRulePrototypeModel.Remote = securityGroupRuleRemotePrototypeModel
				securityGroupRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateSecurityGroupOptions model
				createSecurityGroupOptionsModel := new(vpcv1.CreateSecurityGroupOptions)
				createSecurityGroupOptionsModel.VPC = vpcIdentityModel
				createSecurityGroupOptionsModel.Name = core.StringPtr("my-security-group")
				createSecurityGroupOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createSecurityGroupOptionsModel.Rules = []vpcv1.SecurityGroupRulePrototypeIntf{securityGroupRulePrototypeModel}
				createSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateSecurityGroup(createSecurityGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteSecurityGroup(deleteSecurityGroupOptions *DeleteSecurityGroupOptions)`, func() {
		version := "2024-06-23"
		deleteSecurityGroupPath := "/security_groups/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteSecurityGroupPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteSecurityGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteSecurityGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteSecurityGroupOptions model
				deleteSecurityGroupOptionsModel := new(vpcv1.DeleteSecurityGroupOptions)
				deleteSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				deleteSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteSecurityGroup(deleteSecurityGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteSecurityGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteSecurityGroupOptions model
				deleteSecurityGroupOptionsModel := new(vpcv1.DeleteSecurityGroupOptions)
				deleteSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				deleteSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteSecurityGroup(deleteSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteSecurityGroupOptions model with no property values
				deleteSecurityGroupOptionsModelNew := new(vpcv1.DeleteSecurityGroupOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteSecurityGroup(deleteSecurityGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSecurityGroup(getSecurityGroupOptions *GetSecurityGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getSecurityGroupPath := "/security_groups/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSecurityGroupPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetSecurityGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSecurityGroupOptions model
				getSecurityGroupOptionsModel := new(vpcv1.GetSecurityGroupOptions)
				getSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetSecurityGroup(getSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetSecurityGroup(getSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSecurityGroup(getSecurityGroupOptions *GetSecurityGroupOptions)`, func() {
		version := "2024-06-23"
		getSecurityGroupPath := "/security_groups/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSecurityGroupPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetSecurityGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetSecurityGroupOptions model
				getSecurityGroupOptionsModel := new(vpcv1.GetSecurityGroupOptions)
				getSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetSecurityGroupWithContext(ctx, getSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetSecurityGroup(getSecurityGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetSecurityGroupWithContext(ctx, getSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSecurityGroupPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetSecurityGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetSecurityGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetSecurityGroupOptions model
				getSecurityGroupOptionsModel := new(vpcv1.GetSecurityGroupOptions)
				getSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetSecurityGroup(getSecurityGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetSecurityGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSecurityGroupOptions model
				getSecurityGroupOptionsModel := new(vpcv1.GetSecurityGroupOptions)
				getSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetSecurityGroup(getSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetSecurityGroupOptions model with no property values
				getSecurityGroupOptionsModelNew := new(vpcv1.GetSecurityGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetSecurityGroup(getSecurityGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetSecurityGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSecurityGroupOptions model
				getSecurityGroupOptionsModel := new(vpcv1.GetSecurityGroupOptions)
				getSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetSecurityGroup(getSecurityGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateSecurityGroup(updateSecurityGroupOptions *UpdateSecurityGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateSecurityGroupPath := "/security_groups/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSecurityGroupPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateSecurityGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SecurityGroupPatch model
				securityGroupPatchModel := new(vpcv1.SecurityGroupPatch)
				securityGroupPatchModel.Name = core.StringPtr("my-security-group")
				securityGroupPatchModelAsPatch, asPatchErr := securityGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSecurityGroupOptions model
				updateSecurityGroupOptionsModel := new(vpcv1.UpdateSecurityGroupOptions)
				updateSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				updateSecurityGroupOptionsModel.SecurityGroupPatch = securityGroupPatchModelAsPatch
				updateSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateSecurityGroup(updateSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateSecurityGroup(updateSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateSecurityGroup(updateSecurityGroupOptions *UpdateSecurityGroupOptions)`, func() {
		version := "2024-06-23"
		updateSecurityGroupPath := "/security_groups/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSecurityGroupPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateSecurityGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the SecurityGroupPatch model
				securityGroupPatchModel := new(vpcv1.SecurityGroupPatch)
				securityGroupPatchModel.Name = core.StringPtr("my-security-group")
				securityGroupPatchModelAsPatch, asPatchErr := securityGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSecurityGroupOptions model
				updateSecurityGroupOptionsModel := new(vpcv1.UpdateSecurityGroupOptions)
				updateSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				updateSecurityGroupOptionsModel.SecurityGroupPatch = securityGroupPatchModelAsPatch
				updateSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateSecurityGroupWithContext(ctx, updateSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateSecurityGroup(updateSecurityGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateSecurityGroupWithContext(ctx, updateSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSecurityGroupPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateSecurityGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateSecurityGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the SecurityGroupPatch model
				securityGroupPatchModel := new(vpcv1.SecurityGroupPatch)
				securityGroupPatchModel.Name = core.StringPtr("my-security-group")
				securityGroupPatchModelAsPatch, asPatchErr := securityGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSecurityGroupOptions model
				updateSecurityGroupOptionsModel := new(vpcv1.UpdateSecurityGroupOptions)
				updateSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				updateSecurityGroupOptionsModel.SecurityGroupPatch = securityGroupPatchModelAsPatch
				updateSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateSecurityGroup(updateSecurityGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateSecurityGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SecurityGroupPatch model
				securityGroupPatchModel := new(vpcv1.SecurityGroupPatch)
				securityGroupPatchModel.Name = core.StringPtr("my-security-group")
				securityGroupPatchModelAsPatch, asPatchErr := securityGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSecurityGroupOptions model
				updateSecurityGroupOptionsModel := new(vpcv1.UpdateSecurityGroupOptions)
				updateSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				updateSecurityGroupOptionsModel.SecurityGroupPatch = securityGroupPatchModelAsPatch
				updateSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateSecurityGroup(updateSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateSecurityGroupOptions model with no property values
				updateSecurityGroupOptionsModelNew := new(vpcv1.UpdateSecurityGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateSecurityGroup(updateSecurityGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateSecurityGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SecurityGroupPatch model
				securityGroupPatchModel := new(vpcv1.SecurityGroupPatch)
				securityGroupPatchModel.Name = core.StringPtr("my-security-group")
				securityGroupPatchModelAsPatch, asPatchErr := securityGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSecurityGroupOptions model
				updateSecurityGroupOptionsModel := new(vpcv1.UpdateSecurityGroupOptions)
				updateSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				updateSecurityGroupOptionsModel.SecurityGroupPatch = securityGroupPatchModelAsPatch
				updateSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateSecurityGroup(updateSecurityGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSecurityGroupRules(listSecurityGroupRulesOptions *ListSecurityGroupRulesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listSecurityGroupRulesPath := "/security_groups/testString/rules"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSecurityGroupRulesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListSecurityGroupRules with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSecurityGroupRulesOptions model
				listSecurityGroupRulesOptionsModel := new(vpcv1.ListSecurityGroupRulesOptions)
				listSecurityGroupRulesOptionsModel.SecurityGroupID = core.StringPtr("testString")
				listSecurityGroupRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListSecurityGroupRules(listSecurityGroupRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListSecurityGroupRules(listSecurityGroupRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSecurityGroupRules(listSecurityGroupRulesOptions *ListSecurityGroupRulesOptions)`, func() {
		version := "2024-06-23"
		listSecurityGroupRulesPath := "/security_groups/testString/rules"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSecurityGroupRulesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}]}`)
				}))
			})
			It(`Invoke ListSecurityGroupRules successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListSecurityGroupRulesOptions model
				listSecurityGroupRulesOptionsModel := new(vpcv1.ListSecurityGroupRulesOptions)
				listSecurityGroupRulesOptionsModel.SecurityGroupID = core.StringPtr("testString")
				listSecurityGroupRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListSecurityGroupRulesWithContext(ctx, listSecurityGroupRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListSecurityGroupRules(listSecurityGroupRulesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListSecurityGroupRulesWithContext(ctx, listSecurityGroupRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSecurityGroupRulesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}]}`)
				}))
			})
			It(`Invoke ListSecurityGroupRules successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListSecurityGroupRules(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListSecurityGroupRulesOptions model
				listSecurityGroupRulesOptionsModel := new(vpcv1.ListSecurityGroupRulesOptions)
				listSecurityGroupRulesOptionsModel.SecurityGroupID = core.StringPtr("testString")
				listSecurityGroupRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListSecurityGroupRules(listSecurityGroupRulesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListSecurityGroupRules with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSecurityGroupRulesOptions model
				listSecurityGroupRulesOptionsModel := new(vpcv1.ListSecurityGroupRulesOptions)
				listSecurityGroupRulesOptionsModel.SecurityGroupID = core.StringPtr("testString")
				listSecurityGroupRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListSecurityGroupRules(listSecurityGroupRulesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListSecurityGroupRulesOptions model with no property values
				listSecurityGroupRulesOptionsModelNew := new(vpcv1.ListSecurityGroupRulesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListSecurityGroupRules(listSecurityGroupRulesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListSecurityGroupRules successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSecurityGroupRulesOptions model
				listSecurityGroupRulesOptionsModel := new(vpcv1.ListSecurityGroupRulesOptions)
				listSecurityGroupRulesOptionsModel.SecurityGroupID = core.StringPtr("testString")
				listSecurityGroupRulesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListSecurityGroupRules(listSecurityGroupRulesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateSecurityGroupRule(createSecurityGroupRuleOptions *CreateSecurityGroupRuleOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createSecurityGroupRulePath := "/security_groups/testString/rules"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSecurityGroupRulePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateSecurityGroupRule with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SecurityGroupRuleLocalPrototypeIP model
				securityGroupRuleLocalPrototypeModel := new(vpcv1.SecurityGroupRuleLocalPrototypeIP)
				securityGroupRuleLocalPrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePrototypeIP model
				securityGroupRuleRemotePrototypeModel := new(vpcv1.SecurityGroupRuleRemotePrototypeIP)
				securityGroupRuleRemotePrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model
				securityGroupRulePrototypeModel := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll)
				securityGroupRulePrototypeModel.Direction = core.StringPtr("inbound")
				securityGroupRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePrototypeModel.Local = securityGroupRuleLocalPrototypeModel
				securityGroupRulePrototypeModel.Remote = securityGroupRuleRemotePrototypeModel
				securityGroupRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateSecurityGroupRuleOptions model
				createSecurityGroupRuleOptionsModel := new(vpcv1.CreateSecurityGroupRuleOptions)
				createSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				createSecurityGroupRuleOptionsModel.SecurityGroupRulePrototype = securityGroupRulePrototypeModel
				createSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateSecurityGroupRule(createSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateSecurityGroupRule(createSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateSecurityGroupRule(createSecurityGroupRuleOptions *CreateSecurityGroupRuleOptions)`, func() {
		version := "2024-06-23"
		createSecurityGroupRulePath := "/security_groups/testString/rules"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSecurityGroupRulePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}`)
				}))
			})
			It(`Invoke CreateSecurityGroupRule successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the SecurityGroupRuleLocalPrototypeIP model
				securityGroupRuleLocalPrototypeModel := new(vpcv1.SecurityGroupRuleLocalPrototypeIP)
				securityGroupRuleLocalPrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePrototypeIP model
				securityGroupRuleRemotePrototypeModel := new(vpcv1.SecurityGroupRuleRemotePrototypeIP)
				securityGroupRuleRemotePrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model
				securityGroupRulePrototypeModel := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll)
				securityGroupRulePrototypeModel.Direction = core.StringPtr("inbound")
				securityGroupRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePrototypeModel.Local = securityGroupRuleLocalPrototypeModel
				securityGroupRulePrototypeModel.Remote = securityGroupRuleRemotePrototypeModel
				securityGroupRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateSecurityGroupRuleOptions model
				createSecurityGroupRuleOptionsModel := new(vpcv1.CreateSecurityGroupRuleOptions)
				createSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				createSecurityGroupRuleOptionsModel.SecurityGroupRulePrototype = securityGroupRulePrototypeModel
				createSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateSecurityGroupRuleWithContext(ctx, createSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateSecurityGroupRule(createSecurityGroupRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateSecurityGroupRuleWithContext(ctx, createSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSecurityGroupRulePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}`)
				}))
			})
			It(`Invoke CreateSecurityGroupRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateSecurityGroupRule(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the SecurityGroupRuleLocalPrototypeIP model
				securityGroupRuleLocalPrototypeModel := new(vpcv1.SecurityGroupRuleLocalPrototypeIP)
				securityGroupRuleLocalPrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePrototypeIP model
				securityGroupRuleRemotePrototypeModel := new(vpcv1.SecurityGroupRuleRemotePrototypeIP)
				securityGroupRuleRemotePrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model
				securityGroupRulePrototypeModel := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll)
				securityGroupRulePrototypeModel.Direction = core.StringPtr("inbound")
				securityGroupRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePrototypeModel.Local = securityGroupRuleLocalPrototypeModel
				securityGroupRulePrototypeModel.Remote = securityGroupRuleRemotePrototypeModel
				securityGroupRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateSecurityGroupRuleOptions model
				createSecurityGroupRuleOptionsModel := new(vpcv1.CreateSecurityGroupRuleOptions)
				createSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				createSecurityGroupRuleOptionsModel.SecurityGroupRulePrototype = securityGroupRulePrototypeModel
				createSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateSecurityGroupRule(createSecurityGroupRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateSecurityGroupRule with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SecurityGroupRuleLocalPrototypeIP model
				securityGroupRuleLocalPrototypeModel := new(vpcv1.SecurityGroupRuleLocalPrototypeIP)
				securityGroupRuleLocalPrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePrototypeIP model
				securityGroupRuleRemotePrototypeModel := new(vpcv1.SecurityGroupRuleRemotePrototypeIP)
				securityGroupRuleRemotePrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model
				securityGroupRulePrototypeModel := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll)
				securityGroupRulePrototypeModel.Direction = core.StringPtr("inbound")
				securityGroupRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePrototypeModel.Local = securityGroupRuleLocalPrototypeModel
				securityGroupRulePrototypeModel.Remote = securityGroupRuleRemotePrototypeModel
				securityGroupRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateSecurityGroupRuleOptions model
				createSecurityGroupRuleOptionsModel := new(vpcv1.CreateSecurityGroupRuleOptions)
				createSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				createSecurityGroupRuleOptionsModel.SecurityGroupRulePrototype = securityGroupRulePrototypeModel
				createSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateSecurityGroupRule(createSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateSecurityGroupRuleOptions model with no property values
				createSecurityGroupRuleOptionsModelNew := new(vpcv1.CreateSecurityGroupRuleOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateSecurityGroupRule(createSecurityGroupRuleOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateSecurityGroupRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SecurityGroupRuleLocalPrototypeIP model
				securityGroupRuleLocalPrototypeModel := new(vpcv1.SecurityGroupRuleLocalPrototypeIP)
				securityGroupRuleLocalPrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePrototypeIP model
				securityGroupRuleRemotePrototypeModel := new(vpcv1.SecurityGroupRuleRemotePrototypeIP)
				securityGroupRuleRemotePrototypeModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model
				securityGroupRulePrototypeModel := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll)
				securityGroupRulePrototypeModel.Direction = core.StringPtr("inbound")
				securityGroupRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePrototypeModel.Local = securityGroupRuleLocalPrototypeModel
				securityGroupRulePrototypeModel.Remote = securityGroupRuleRemotePrototypeModel
				securityGroupRulePrototypeModel.Protocol = core.StringPtr("all")

				// Construct an instance of the CreateSecurityGroupRuleOptions model
				createSecurityGroupRuleOptionsModel := new(vpcv1.CreateSecurityGroupRuleOptions)
				createSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				createSecurityGroupRuleOptionsModel.SecurityGroupRulePrototype = securityGroupRulePrototypeModel
				createSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateSecurityGroupRule(createSecurityGroupRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteSecurityGroupRule(deleteSecurityGroupRuleOptions *DeleteSecurityGroupRuleOptions)`, func() {
		version := "2024-06-23"
		deleteSecurityGroupRulePath := "/security_groups/testString/rules/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteSecurityGroupRulePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteSecurityGroupRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteSecurityGroupRule(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteSecurityGroupRuleOptions model
				deleteSecurityGroupRuleOptionsModel := new(vpcv1.DeleteSecurityGroupRuleOptions)
				deleteSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				deleteSecurityGroupRuleOptionsModel.ID = core.StringPtr("testString")
				deleteSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteSecurityGroupRule(deleteSecurityGroupRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteSecurityGroupRule with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteSecurityGroupRuleOptions model
				deleteSecurityGroupRuleOptionsModel := new(vpcv1.DeleteSecurityGroupRuleOptions)
				deleteSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				deleteSecurityGroupRuleOptionsModel.ID = core.StringPtr("testString")
				deleteSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteSecurityGroupRule(deleteSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteSecurityGroupRuleOptions model with no property values
				deleteSecurityGroupRuleOptionsModelNew := new(vpcv1.DeleteSecurityGroupRuleOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteSecurityGroupRule(deleteSecurityGroupRuleOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSecurityGroupRule(getSecurityGroupRuleOptions *GetSecurityGroupRuleOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getSecurityGroupRulePath := "/security_groups/testString/rules/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSecurityGroupRulePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetSecurityGroupRule with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSecurityGroupRuleOptions model
				getSecurityGroupRuleOptionsModel := new(vpcv1.GetSecurityGroupRuleOptions)
				getSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				getSecurityGroupRuleOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetSecurityGroupRule(getSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetSecurityGroupRule(getSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSecurityGroupRule(getSecurityGroupRuleOptions *GetSecurityGroupRuleOptions)`, func() {
		version := "2024-06-23"
		getSecurityGroupRulePath := "/security_groups/testString/rules/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSecurityGroupRulePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}`)
				}))
			})
			It(`Invoke GetSecurityGroupRule successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetSecurityGroupRuleOptions model
				getSecurityGroupRuleOptionsModel := new(vpcv1.GetSecurityGroupRuleOptions)
				getSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				getSecurityGroupRuleOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetSecurityGroupRuleWithContext(ctx, getSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetSecurityGroupRule(getSecurityGroupRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetSecurityGroupRuleWithContext(ctx, getSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSecurityGroupRulePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}`)
				}))
			})
			It(`Invoke GetSecurityGroupRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetSecurityGroupRule(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetSecurityGroupRuleOptions model
				getSecurityGroupRuleOptionsModel := new(vpcv1.GetSecurityGroupRuleOptions)
				getSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				getSecurityGroupRuleOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetSecurityGroupRule(getSecurityGroupRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetSecurityGroupRule with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSecurityGroupRuleOptions model
				getSecurityGroupRuleOptionsModel := new(vpcv1.GetSecurityGroupRuleOptions)
				getSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				getSecurityGroupRuleOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetSecurityGroupRule(getSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetSecurityGroupRuleOptions model with no property values
				getSecurityGroupRuleOptionsModelNew := new(vpcv1.GetSecurityGroupRuleOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetSecurityGroupRule(getSecurityGroupRuleOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetSecurityGroupRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSecurityGroupRuleOptions model
				getSecurityGroupRuleOptionsModel := new(vpcv1.GetSecurityGroupRuleOptions)
				getSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				getSecurityGroupRuleOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetSecurityGroupRule(getSecurityGroupRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateSecurityGroupRule(updateSecurityGroupRuleOptions *UpdateSecurityGroupRuleOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateSecurityGroupRulePath := "/security_groups/testString/rules/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSecurityGroupRulePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateSecurityGroupRule with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SecurityGroupRuleLocalPatchIP model
				securityGroupRuleLocalPatchModel := new(vpcv1.SecurityGroupRuleLocalPatchIP)
				securityGroupRuleLocalPatchModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePatchCIDR model
				securityGroupRuleRemotePatchModel := new(vpcv1.SecurityGroupRuleRemotePatchCIDR)
				securityGroupRuleRemotePatchModel.CIDRBlock = core.StringPtr("10.0.0.0/8")

				// Construct an instance of the SecurityGroupRulePatch model
				securityGroupRulePatchModel := new(vpcv1.SecurityGroupRulePatch)
				securityGroupRulePatchModel.Code = core.Int64Ptr(int64(0))
				securityGroupRulePatchModel.Direction = core.StringPtr("inbound")
				securityGroupRulePatchModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePatchModel.Local = securityGroupRuleLocalPatchModel
				securityGroupRulePatchModel.PortMax = core.Int64Ptr(int64(22))
				securityGroupRulePatchModel.PortMin = core.Int64Ptr(int64(22))
				securityGroupRulePatchModel.Remote = securityGroupRuleRemotePatchModel
				securityGroupRulePatchModel.Type = core.Int64Ptr(int64(8))
				securityGroupRulePatchModelAsPatch, asPatchErr := securityGroupRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSecurityGroupRuleOptions model
				updateSecurityGroupRuleOptionsModel := new(vpcv1.UpdateSecurityGroupRuleOptions)
				updateSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				updateSecurityGroupRuleOptionsModel.ID = core.StringPtr("testString")
				updateSecurityGroupRuleOptionsModel.SecurityGroupRulePatch = securityGroupRulePatchModelAsPatch
				updateSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateSecurityGroupRule(updateSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateSecurityGroupRule(updateSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateSecurityGroupRule(updateSecurityGroupRuleOptions *UpdateSecurityGroupRuleOptions)`, func() {
		version := "2024-06-23"
		updateSecurityGroupRulePath := "/security_groups/testString/rules/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSecurityGroupRulePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}`)
				}))
			})
			It(`Invoke UpdateSecurityGroupRule successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the SecurityGroupRuleLocalPatchIP model
				securityGroupRuleLocalPatchModel := new(vpcv1.SecurityGroupRuleLocalPatchIP)
				securityGroupRuleLocalPatchModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePatchCIDR model
				securityGroupRuleRemotePatchModel := new(vpcv1.SecurityGroupRuleRemotePatchCIDR)
				securityGroupRuleRemotePatchModel.CIDRBlock = core.StringPtr("10.0.0.0/8")

				// Construct an instance of the SecurityGroupRulePatch model
				securityGroupRulePatchModel := new(vpcv1.SecurityGroupRulePatch)
				securityGroupRulePatchModel.Code = core.Int64Ptr(int64(0))
				securityGroupRulePatchModel.Direction = core.StringPtr("inbound")
				securityGroupRulePatchModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePatchModel.Local = securityGroupRuleLocalPatchModel
				securityGroupRulePatchModel.PortMax = core.Int64Ptr(int64(22))
				securityGroupRulePatchModel.PortMin = core.Int64Ptr(int64(22))
				securityGroupRulePatchModel.Remote = securityGroupRuleRemotePatchModel
				securityGroupRulePatchModel.Type = core.Int64Ptr(int64(8))
				securityGroupRulePatchModelAsPatch, asPatchErr := securityGroupRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSecurityGroupRuleOptions model
				updateSecurityGroupRuleOptionsModel := new(vpcv1.UpdateSecurityGroupRuleOptions)
				updateSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				updateSecurityGroupRuleOptionsModel.ID = core.StringPtr("testString")
				updateSecurityGroupRuleOptionsModel.SecurityGroupRulePatch = securityGroupRulePatchModelAsPatch
				updateSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateSecurityGroupRuleWithContext(ctx, updateSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateSecurityGroupRule(updateSecurityGroupRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateSecurityGroupRuleWithContext(ctx, updateSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSecurityGroupRulePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}`)
				}))
			})
			It(`Invoke UpdateSecurityGroupRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateSecurityGroupRule(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the SecurityGroupRuleLocalPatchIP model
				securityGroupRuleLocalPatchModel := new(vpcv1.SecurityGroupRuleLocalPatchIP)
				securityGroupRuleLocalPatchModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePatchCIDR model
				securityGroupRuleRemotePatchModel := new(vpcv1.SecurityGroupRuleRemotePatchCIDR)
				securityGroupRuleRemotePatchModel.CIDRBlock = core.StringPtr("10.0.0.0/8")

				// Construct an instance of the SecurityGroupRulePatch model
				securityGroupRulePatchModel := new(vpcv1.SecurityGroupRulePatch)
				securityGroupRulePatchModel.Code = core.Int64Ptr(int64(0))
				securityGroupRulePatchModel.Direction = core.StringPtr("inbound")
				securityGroupRulePatchModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePatchModel.Local = securityGroupRuleLocalPatchModel
				securityGroupRulePatchModel.PortMax = core.Int64Ptr(int64(22))
				securityGroupRulePatchModel.PortMin = core.Int64Ptr(int64(22))
				securityGroupRulePatchModel.Remote = securityGroupRuleRemotePatchModel
				securityGroupRulePatchModel.Type = core.Int64Ptr(int64(8))
				securityGroupRulePatchModelAsPatch, asPatchErr := securityGroupRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSecurityGroupRuleOptions model
				updateSecurityGroupRuleOptionsModel := new(vpcv1.UpdateSecurityGroupRuleOptions)
				updateSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				updateSecurityGroupRuleOptionsModel.ID = core.StringPtr("testString")
				updateSecurityGroupRuleOptionsModel.SecurityGroupRulePatch = securityGroupRulePatchModelAsPatch
				updateSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateSecurityGroupRule(updateSecurityGroupRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateSecurityGroupRule with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SecurityGroupRuleLocalPatchIP model
				securityGroupRuleLocalPatchModel := new(vpcv1.SecurityGroupRuleLocalPatchIP)
				securityGroupRuleLocalPatchModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePatchCIDR model
				securityGroupRuleRemotePatchModel := new(vpcv1.SecurityGroupRuleRemotePatchCIDR)
				securityGroupRuleRemotePatchModel.CIDRBlock = core.StringPtr("10.0.0.0/8")

				// Construct an instance of the SecurityGroupRulePatch model
				securityGroupRulePatchModel := new(vpcv1.SecurityGroupRulePatch)
				securityGroupRulePatchModel.Code = core.Int64Ptr(int64(0))
				securityGroupRulePatchModel.Direction = core.StringPtr("inbound")
				securityGroupRulePatchModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePatchModel.Local = securityGroupRuleLocalPatchModel
				securityGroupRulePatchModel.PortMax = core.Int64Ptr(int64(22))
				securityGroupRulePatchModel.PortMin = core.Int64Ptr(int64(22))
				securityGroupRulePatchModel.Remote = securityGroupRuleRemotePatchModel
				securityGroupRulePatchModel.Type = core.Int64Ptr(int64(8))
				securityGroupRulePatchModelAsPatch, asPatchErr := securityGroupRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSecurityGroupRuleOptions model
				updateSecurityGroupRuleOptionsModel := new(vpcv1.UpdateSecurityGroupRuleOptions)
				updateSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				updateSecurityGroupRuleOptionsModel.ID = core.StringPtr("testString")
				updateSecurityGroupRuleOptionsModel.SecurityGroupRulePatch = securityGroupRulePatchModelAsPatch
				updateSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateSecurityGroupRule(updateSecurityGroupRuleOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateSecurityGroupRuleOptions model with no property values
				updateSecurityGroupRuleOptionsModelNew := new(vpcv1.UpdateSecurityGroupRuleOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateSecurityGroupRule(updateSecurityGroupRuleOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateSecurityGroupRule successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SecurityGroupRuleLocalPatchIP model
				securityGroupRuleLocalPatchModel := new(vpcv1.SecurityGroupRuleLocalPatchIP)
				securityGroupRuleLocalPatchModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SecurityGroupRuleRemotePatchCIDR model
				securityGroupRuleRemotePatchModel := new(vpcv1.SecurityGroupRuleRemotePatchCIDR)
				securityGroupRuleRemotePatchModel.CIDRBlock = core.StringPtr("10.0.0.0/8")

				// Construct an instance of the SecurityGroupRulePatch model
				securityGroupRulePatchModel := new(vpcv1.SecurityGroupRulePatch)
				securityGroupRulePatchModel.Code = core.Int64Ptr(int64(0))
				securityGroupRulePatchModel.Direction = core.StringPtr("inbound")
				securityGroupRulePatchModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePatchModel.Local = securityGroupRuleLocalPatchModel
				securityGroupRulePatchModel.PortMax = core.Int64Ptr(int64(22))
				securityGroupRulePatchModel.PortMin = core.Int64Ptr(int64(22))
				securityGroupRulePatchModel.Remote = securityGroupRuleRemotePatchModel
				securityGroupRulePatchModel.Type = core.Int64Ptr(int64(8))
				securityGroupRulePatchModelAsPatch, asPatchErr := securityGroupRulePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSecurityGroupRuleOptions model
				updateSecurityGroupRuleOptionsModel := new(vpcv1.UpdateSecurityGroupRuleOptions)
				updateSecurityGroupRuleOptionsModel.SecurityGroupID = core.StringPtr("testString")
				updateSecurityGroupRuleOptionsModel.ID = core.StringPtr("testString")
				updateSecurityGroupRuleOptionsModel.SecurityGroupRulePatch = securityGroupRulePatchModelAsPatch
				updateSecurityGroupRuleOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateSecurityGroupRule(updateSecurityGroupRuleOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSecurityGroupTargets(listSecurityGroupTargetsOptions *ListSecurityGroupTargetsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listSecurityGroupTargetsPath := "/security_groups/testString/targets"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSecurityGroupTargetsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListSecurityGroupTargets with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSecurityGroupTargetsOptions model
				listSecurityGroupTargetsOptionsModel := new(vpcv1.ListSecurityGroupTargetsOptions)
				listSecurityGroupTargetsOptionsModel.SecurityGroupID = core.StringPtr("testString")
				listSecurityGroupTargetsOptionsModel.Start = core.StringPtr("testString")
				listSecurityGroupTargetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSecurityGroupTargetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListSecurityGroupTargets(listSecurityGroupTargetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListSecurityGroupTargets(listSecurityGroupTargetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSecurityGroupTargets(listSecurityGroupTargetsOptions *ListSecurityGroupTargetsOptions)`, func() {
		version := "2024-06-23"
		listSecurityGroupTargetsPath := "/security_groups/testString/targets"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSecurityGroupTargetsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListSecurityGroupTargets successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListSecurityGroupTargetsOptions model
				listSecurityGroupTargetsOptionsModel := new(vpcv1.ListSecurityGroupTargetsOptions)
				listSecurityGroupTargetsOptionsModel.SecurityGroupID = core.StringPtr("testString")
				listSecurityGroupTargetsOptionsModel.Start = core.StringPtr("testString")
				listSecurityGroupTargetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSecurityGroupTargetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListSecurityGroupTargetsWithContext(ctx, listSecurityGroupTargetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListSecurityGroupTargets(listSecurityGroupTargetsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListSecurityGroupTargetsWithContext(ctx, listSecurityGroupTargetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSecurityGroupTargetsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListSecurityGroupTargets successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListSecurityGroupTargets(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListSecurityGroupTargetsOptions model
				listSecurityGroupTargetsOptionsModel := new(vpcv1.ListSecurityGroupTargetsOptions)
				listSecurityGroupTargetsOptionsModel.SecurityGroupID = core.StringPtr("testString")
				listSecurityGroupTargetsOptionsModel.Start = core.StringPtr("testString")
				listSecurityGroupTargetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSecurityGroupTargetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListSecurityGroupTargets(listSecurityGroupTargetsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListSecurityGroupTargets with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSecurityGroupTargetsOptions model
				listSecurityGroupTargetsOptionsModel := new(vpcv1.ListSecurityGroupTargetsOptions)
				listSecurityGroupTargetsOptionsModel.SecurityGroupID = core.StringPtr("testString")
				listSecurityGroupTargetsOptionsModel.Start = core.StringPtr("testString")
				listSecurityGroupTargetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSecurityGroupTargetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListSecurityGroupTargets(listSecurityGroupTargetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListSecurityGroupTargetsOptions model with no property values
				listSecurityGroupTargetsOptionsModelNew := new(vpcv1.ListSecurityGroupTargetsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListSecurityGroupTargets(listSecurityGroupTargetsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListSecurityGroupTargets successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSecurityGroupTargetsOptions model
				listSecurityGroupTargetsOptionsModel := new(vpcv1.ListSecurityGroupTargetsOptions)
				listSecurityGroupTargetsOptionsModel.SecurityGroupID = core.StringPtr("testString")
				listSecurityGroupTargetsOptionsModel.Start = core.StringPtr("testString")
				listSecurityGroupTargetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSecurityGroupTargetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListSecurityGroupTargets(listSecurityGroupTargetsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.SecurityGroupTargetCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.SecurityGroupTargetCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.SecurityGroupTargetCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSecurityGroupTargetsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","resource_type":"network_interface"}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","resource_type":"network_interface"}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use SecurityGroupTargetsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSecurityGroupTargetsOptionsModel := &vpcv1.ListSecurityGroupTargetsOptions{
					SecurityGroupID: core.StringPtr("testString"),
					Limit:           core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewSecurityGroupTargetsPager(listSecurityGroupTargetsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.SecurityGroupTargetReferenceIntf
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use SecurityGroupTargetsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSecurityGroupTargetsOptionsModel := &vpcv1.ListSecurityGroupTargetsOptions{
					SecurityGroupID: core.StringPtr("testString"),
					Limit:           core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewSecurityGroupTargetsPager(listSecurityGroupTargetsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`DeleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptions *DeleteSecurityGroupTargetBindingOptions)`, func() {
		version := "2024-06-23"
		deleteSecurityGroupTargetBindingPath := "/security_groups/testString/targets/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteSecurityGroupTargetBindingPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteSecurityGroupTargetBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteSecurityGroupTargetBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteSecurityGroupTargetBindingOptions model
				deleteSecurityGroupTargetBindingOptionsModel := new(vpcv1.DeleteSecurityGroupTargetBindingOptions)
				deleteSecurityGroupTargetBindingOptionsModel.SecurityGroupID = core.StringPtr("testString")
				deleteSecurityGroupTargetBindingOptionsModel.ID = core.StringPtr("testString")
				deleteSecurityGroupTargetBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteSecurityGroupTargetBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteSecurityGroupTargetBindingOptions model
				deleteSecurityGroupTargetBindingOptionsModel := new(vpcv1.DeleteSecurityGroupTargetBindingOptions)
				deleteSecurityGroupTargetBindingOptionsModel.SecurityGroupID = core.StringPtr("testString")
				deleteSecurityGroupTargetBindingOptionsModel.ID = core.StringPtr("testString")
				deleteSecurityGroupTargetBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteSecurityGroupTargetBindingOptions model with no property values
				deleteSecurityGroupTargetBindingOptionsModelNew := new(vpcv1.DeleteSecurityGroupTargetBindingOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSecurityGroupTarget(getSecurityGroupTargetOptions *GetSecurityGroupTargetOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getSecurityGroupTargetPath := "/security_groups/testString/targets/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSecurityGroupTargetPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetSecurityGroupTarget with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSecurityGroupTargetOptions model
				getSecurityGroupTargetOptionsModel := new(vpcv1.GetSecurityGroupTargetOptions)
				getSecurityGroupTargetOptionsModel.SecurityGroupID = core.StringPtr("testString")
				getSecurityGroupTargetOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetSecurityGroupTarget(getSecurityGroupTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetSecurityGroupTarget(getSecurityGroupTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSecurityGroupTarget(getSecurityGroupTargetOptions *GetSecurityGroupTargetOptions)`, func() {
		version := "2024-06-23"
		getSecurityGroupTargetPath := "/security_groups/testString/targets/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSecurityGroupTargetPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}`)
				}))
			})
			It(`Invoke GetSecurityGroupTarget successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetSecurityGroupTargetOptions model
				getSecurityGroupTargetOptionsModel := new(vpcv1.GetSecurityGroupTargetOptions)
				getSecurityGroupTargetOptionsModel.SecurityGroupID = core.StringPtr("testString")
				getSecurityGroupTargetOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetSecurityGroupTargetWithContext(ctx, getSecurityGroupTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetSecurityGroupTarget(getSecurityGroupTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetSecurityGroupTargetWithContext(ctx, getSecurityGroupTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSecurityGroupTargetPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}`)
				}))
			})
			It(`Invoke GetSecurityGroupTarget successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetSecurityGroupTarget(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetSecurityGroupTargetOptions model
				getSecurityGroupTargetOptionsModel := new(vpcv1.GetSecurityGroupTargetOptions)
				getSecurityGroupTargetOptionsModel.SecurityGroupID = core.StringPtr("testString")
				getSecurityGroupTargetOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetSecurityGroupTarget(getSecurityGroupTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetSecurityGroupTarget with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSecurityGroupTargetOptions model
				getSecurityGroupTargetOptionsModel := new(vpcv1.GetSecurityGroupTargetOptions)
				getSecurityGroupTargetOptionsModel.SecurityGroupID = core.StringPtr("testString")
				getSecurityGroupTargetOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetSecurityGroupTarget(getSecurityGroupTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetSecurityGroupTargetOptions model with no property values
				getSecurityGroupTargetOptionsModelNew := new(vpcv1.GetSecurityGroupTargetOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetSecurityGroupTarget(getSecurityGroupTargetOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetSecurityGroupTarget successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSecurityGroupTargetOptions model
				getSecurityGroupTargetOptionsModel := new(vpcv1.GetSecurityGroupTargetOptions)
				getSecurityGroupTargetOptionsModel.SecurityGroupID = core.StringPtr("testString")
				getSecurityGroupTargetOptionsModel.ID = core.StringPtr("testString")
				getSecurityGroupTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetSecurityGroupTarget(getSecurityGroupTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptions *CreateSecurityGroupTargetBindingOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createSecurityGroupTargetBindingPath := "/security_groups/testString/targets/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSecurityGroupTargetBindingPath))
					Expect(req.Method).To(Equal("PUT"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateSecurityGroupTargetBinding with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateSecurityGroupTargetBindingOptions model
				createSecurityGroupTargetBindingOptionsModel := new(vpcv1.CreateSecurityGroupTargetBindingOptions)
				createSecurityGroupTargetBindingOptionsModel.SecurityGroupID = core.StringPtr("testString")
				createSecurityGroupTargetBindingOptionsModel.ID = core.StringPtr("testString")
				createSecurityGroupTargetBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptions *CreateSecurityGroupTargetBindingOptions)`, func() {
		version := "2024-06-23"
		createSecurityGroupTargetBindingPath := "/security_groups/testString/targets/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSecurityGroupTargetBindingPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}`)
				}))
			})
			It(`Invoke CreateSecurityGroupTargetBinding successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the CreateSecurityGroupTargetBindingOptions model
				createSecurityGroupTargetBindingOptionsModel := new(vpcv1.CreateSecurityGroupTargetBindingOptions)
				createSecurityGroupTargetBindingOptionsModel.SecurityGroupID = core.StringPtr("testString")
				createSecurityGroupTargetBindingOptionsModel.ID = core.StringPtr("testString")
				createSecurityGroupTargetBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateSecurityGroupTargetBindingWithContext(ctx, createSecurityGroupTargetBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateSecurityGroupTargetBindingWithContext(ctx, createSecurityGroupTargetBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSecurityGroupTargetBindingPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}`)
				}))
			})
			It(`Invoke CreateSecurityGroupTargetBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateSecurityGroupTargetBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the CreateSecurityGroupTargetBindingOptions model
				createSecurityGroupTargetBindingOptionsModel := new(vpcv1.CreateSecurityGroupTargetBindingOptions)
				createSecurityGroupTargetBindingOptionsModel.SecurityGroupID = core.StringPtr("testString")
				createSecurityGroupTargetBindingOptionsModel.ID = core.StringPtr("testString")
				createSecurityGroupTargetBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateSecurityGroupTargetBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateSecurityGroupTargetBindingOptions model
				createSecurityGroupTargetBindingOptionsModel := new(vpcv1.CreateSecurityGroupTargetBindingOptions)
				createSecurityGroupTargetBindingOptionsModel.SecurityGroupID = core.StringPtr("testString")
				createSecurityGroupTargetBindingOptionsModel.ID = core.StringPtr("testString")
				createSecurityGroupTargetBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateSecurityGroupTargetBindingOptions model with no property values
				createSecurityGroupTargetBindingOptionsModelNew := new(vpcv1.CreateSecurityGroupTargetBindingOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke CreateSecurityGroupTargetBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateSecurityGroupTargetBindingOptions model
				createSecurityGroupTargetBindingOptionsModel := new(vpcv1.CreateSecurityGroupTargetBindingOptions)
				createSecurityGroupTargetBindingOptionsModel.SecurityGroupID = core.StringPtr("testString")
				createSecurityGroupTargetBindingOptionsModel.ID = core.StringPtr("testString")
				createSecurityGroupTargetBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListShareProfiles(listShareProfilesOptions *ListShareProfilesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listShareProfilesPath := "/share/profiles"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareProfilesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListShareProfiles with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListShareProfilesOptions model
				listShareProfilesOptionsModel := new(vpcv1.ListShareProfilesOptions)
				listShareProfilesOptionsModel.Start = core.StringPtr("testString")
				listShareProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareProfilesOptionsModel.Sort = core.StringPtr("name")
				listShareProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListShareProfiles(listShareProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListShareProfiles(listShareProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListShareProfiles(listShareProfilesOptions *ListShareProfilesOptions)`, func() {
		version := "2024-06-23"
		listShareProfilesPath := "/share/profiles"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "profiles": [{"allowed_access_protocols": {"default": ["nfs4"], "type": "subset", "values": ["nfs4"]}, "allowed_transit_encryption_modes": {"default": ["ipsec"], "type": "subset", "values": ["ipsec"]}, "availability_modes": {"default": "zonal", "type": "enum", "values": ["zonal"]}, "bandwidth": {"default": 100, "max": 1024, "min": 1, "step": 1, "type": "range", "value": 5}, "capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile", "storage_generation": {"type": "fixed", "value": 1}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListShareProfiles successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListShareProfilesOptions model
				listShareProfilesOptionsModel := new(vpcv1.ListShareProfilesOptions)
				listShareProfilesOptionsModel.Start = core.StringPtr("testString")
				listShareProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareProfilesOptionsModel.Sort = core.StringPtr("name")
				listShareProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListShareProfilesWithContext(ctx, listShareProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListShareProfiles(listShareProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListShareProfilesWithContext(ctx, listShareProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "profiles": [{"allowed_access_protocols": {"default": ["nfs4"], "type": "subset", "values": ["nfs4"]}, "allowed_transit_encryption_modes": {"default": ["ipsec"], "type": "subset", "values": ["ipsec"]}, "availability_modes": {"default": "zonal", "type": "enum", "values": ["zonal"]}, "bandwidth": {"default": 100, "max": 1024, "min": 1, "step": 1, "type": "range", "value": 5}, "capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile", "storage_generation": {"type": "fixed", "value": 1}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListShareProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListShareProfiles(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListShareProfilesOptions model
				listShareProfilesOptionsModel := new(vpcv1.ListShareProfilesOptions)
				listShareProfilesOptionsModel.Start = core.StringPtr("testString")
				listShareProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareProfilesOptionsModel.Sort = core.StringPtr("name")
				listShareProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListShareProfiles(listShareProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListShareProfiles with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListShareProfilesOptions model
				listShareProfilesOptionsModel := new(vpcv1.ListShareProfilesOptions)
				listShareProfilesOptionsModel.Start = core.StringPtr("testString")
				listShareProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareProfilesOptionsModel.Sort = core.StringPtr("name")
				listShareProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListShareProfiles(listShareProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListShareProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListShareProfilesOptions model
				listShareProfilesOptionsModel := new(vpcv1.ListShareProfilesOptions)
				listShareProfilesOptionsModel.Start = core.StringPtr("testString")
				listShareProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareProfilesOptionsModel.Sort = core.StringPtr("name")
				listShareProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListShareProfiles(listShareProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ShareProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ShareProfileCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ShareProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"allowed_access_protocols":{"default":["nfs4"],"type":"subset","values":["nfs4"]},"allowed_transit_encryption_modes":{"default":["ipsec"],"type":"subset","values":["ipsec"]},"availability_modes":{"default":"zonal","type":"enum","values":["zonal"]},"bandwidth":{"default":100,"max":1024,"min":1,"step":1,"type":"range","value":5},"capacity":{"type":"fixed","value":4800},"family":"defined_performance","href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","iops":{"type":"fixed","value":4000},"name":"tier-3iops","resource_type":"share_profile","storage_generation":{"type":"fixed","value":1}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"profiles":[{"allowed_access_protocols":{"default":["nfs4"],"type":"subset","values":["nfs4"]},"allowed_transit_encryption_modes":{"default":["ipsec"],"type":"subset","values":["ipsec"]},"availability_modes":{"default":"zonal","type":"enum","values":["zonal"]},"bandwidth":{"default":100,"max":1024,"min":1,"step":1,"type":"range","value":5},"capacity":{"type":"fixed","value":4800},"family":"defined_performance","href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","iops":{"type":"fixed","value":4000},"name":"tier-3iops","resource_type":"share_profile","storage_generation":{"type":"fixed","value":1}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use ShareProfilesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listShareProfilesOptionsModel := &vpcv1.ListShareProfilesOptions{
					Limit: core.Int64Ptr(int64(10)),
					Sort:  core.StringPtr("name"),
				}

				pager, err := vpcService.NewShareProfilesPager(listShareProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.ShareProfile
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use ShareProfilesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listShareProfilesOptionsModel := &vpcv1.ListShareProfilesOptions{
					Limit: core.Int64Ptr(int64(10)),
					Sort:  core.StringPtr("name"),
				}

				pager, err := vpcService.NewShareProfilesPager(listShareProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`GetShareProfile(getShareProfileOptions *GetShareProfileOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getShareProfilePath := "/share/profiles/dp2"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareProfilePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetShareProfile with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareProfileOptions model
				getShareProfileOptionsModel := new(vpcv1.GetShareProfileOptions)
				getShareProfileOptionsModel.Name = core.StringPtr("dp2")
				getShareProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetShareProfile(getShareProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetShareProfile(getShareProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetShareProfile(getShareProfileOptions *GetShareProfileOptions)`, func() {
		version := "2024-06-23"
		getShareProfilePath := "/share/profiles/dp2"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareProfilePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allowed_access_protocols": {"default": ["nfs4"], "type": "subset", "values": ["nfs4"]}, "allowed_transit_encryption_modes": {"default": ["ipsec"], "type": "subset", "values": ["ipsec"]}, "availability_modes": {"default": "zonal", "type": "enum", "values": ["zonal"]}, "bandwidth": {"default": 100, "max": 1024, "min": 1, "step": 1, "type": "range", "value": 5}, "capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile", "storage_generation": {"type": "fixed", "value": 1}}`)
				}))
			})
			It(`Invoke GetShareProfile successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetShareProfileOptions model
				getShareProfileOptionsModel := new(vpcv1.GetShareProfileOptions)
				getShareProfileOptionsModel.Name = core.StringPtr("dp2")
				getShareProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetShareProfileWithContext(ctx, getShareProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetShareProfile(getShareProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetShareProfileWithContext(ctx, getShareProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareProfilePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allowed_access_protocols": {"default": ["nfs4"], "type": "subset", "values": ["nfs4"]}, "allowed_transit_encryption_modes": {"default": ["ipsec"], "type": "subset", "values": ["ipsec"]}, "availability_modes": {"default": "zonal", "type": "enum", "values": ["zonal"]}, "bandwidth": {"default": 100, "max": 1024, "min": 1, "step": 1, "type": "range", "value": 5}, "capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile", "storage_generation": {"type": "fixed", "value": 1}}`)
				}))
			})
			It(`Invoke GetShareProfile successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetShareProfile(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetShareProfileOptions model
				getShareProfileOptionsModel := new(vpcv1.GetShareProfileOptions)
				getShareProfileOptionsModel.Name = core.StringPtr("dp2")
				getShareProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetShareProfile(getShareProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetShareProfile with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareProfileOptions model
				getShareProfileOptionsModel := new(vpcv1.GetShareProfileOptions)
				getShareProfileOptionsModel.Name = core.StringPtr("dp2")
				getShareProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetShareProfile(getShareProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetShareProfileOptions model with no property values
				getShareProfileOptionsModelNew := new(vpcv1.GetShareProfileOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetShareProfile(getShareProfileOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetShareProfile successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareProfileOptions model
				getShareProfileOptionsModel := new(vpcv1.GetShareProfileOptions)
				getShareProfileOptionsModel.Name = core.StringPtr("dp2")
				getShareProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetShareProfile(getShareProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListShares(listSharesOptions *ListSharesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listSharesPath := "/shares"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSharesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["replication_role"]).To(Equal([]string{"none"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListShares with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSharesOptions model
				listSharesOptionsModel := new(vpcv1.ListSharesOptions)
				listSharesOptionsModel.Start = core.StringPtr("testString")
				listSharesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSharesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSharesOptionsModel.Name = core.StringPtr("my-name")
				listSharesOptionsModel.Sort = core.StringPtr("name")
				listSharesOptionsModel.ReplicationRole = core.StringPtr("none")
				listSharesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListShares(listSharesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListShares(listSharesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListShares(listSharesOptions *ListSharesOptions)`, func() {
		version := "2024-06-23"
		listSharesPath := "/shares"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSharesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["replication_role"]).To(Equal([]string{"none"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "shares": [{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r006-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_access_protocols": ["nfs4"], "allowed_transit_encryption_modes": ["ipsec"], "availability_mode": "zonal", "bandwidth": 1, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "initial_owner": {"gid": 50, "uid": 50}, "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "cloning_in_progress", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "snapshot_count": 0, "snapshot_size": 0, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "name": "my-share-snapshot", "resource_type": "share_snapshot"}, "storage_generation": 1, "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListShares successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListSharesOptions model
				listSharesOptionsModel := new(vpcv1.ListSharesOptions)
				listSharesOptionsModel.Start = core.StringPtr("testString")
				listSharesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSharesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSharesOptionsModel.Name = core.StringPtr("my-name")
				listSharesOptionsModel.Sort = core.StringPtr("name")
				listSharesOptionsModel.ReplicationRole = core.StringPtr("none")
				listSharesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListSharesWithContext(ctx, listSharesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListShares(listSharesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListSharesWithContext(ctx, listSharesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSharesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["replication_role"]).To(Equal([]string{"none"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "shares": [{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r006-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_access_protocols": ["nfs4"], "allowed_transit_encryption_modes": ["ipsec"], "availability_mode": "zonal", "bandwidth": 1, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "initial_owner": {"gid": 50, "uid": 50}, "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "cloning_in_progress", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "snapshot_count": 0, "snapshot_size": 0, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "name": "my-share-snapshot", "resource_type": "share_snapshot"}, "storage_generation": 1, "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListShares successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListShares(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListSharesOptions model
				listSharesOptionsModel := new(vpcv1.ListSharesOptions)
				listSharesOptionsModel.Start = core.StringPtr("testString")
				listSharesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSharesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSharesOptionsModel.Name = core.StringPtr("my-name")
				listSharesOptionsModel.Sort = core.StringPtr("name")
				listSharesOptionsModel.ReplicationRole = core.StringPtr("none")
				listSharesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListShares(listSharesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListShares with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSharesOptions model
				listSharesOptionsModel := new(vpcv1.ListSharesOptions)
				listSharesOptionsModel.Start = core.StringPtr("testString")
				listSharesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSharesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSharesOptionsModel.Name = core.StringPtr("my-name")
				listSharesOptionsModel.Sort = core.StringPtr("name")
				listSharesOptionsModel.ReplicationRole = core.StringPtr("none")
				listSharesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListShares(listSharesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListShares successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSharesOptions model
				listSharesOptionsModel := new(vpcv1.ListSharesOptions)
				listSharesOptionsModel.Start = core.StringPtr("testString")
				listSharesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSharesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSharesOptionsModel.Name = core.StringPtr("my-name")
				listSharesOptionsModel.Sort = core.StringPtr("name")
				listSharesOptionsModel.ReplicationRole = core.StringPtr("none")
				listSharesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListShares(listSharesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ShareCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ShareCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ShareCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSharesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"shares":[{"access_control_mode":"security_group","accessor_binding_role":"accessor","accessor_bindings":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r006-ce9dac18-dea0-4392-841c-142d3300674f","resource_type":"share_accessor_binding"}],"allowed_access_protocols":["nfs4"],"allowed_transit_encryption_modes":["ipsec"],"availability_mode":"zonal","bandwidth":1,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","initial_owner":{"gid":50,"uid":50},"iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"latest_sync":{"completed_at":"2019-01-01T12:00:00.000Z","data_transferred":0,"started_at":"2019-01-01T12:00:00.000Z"},"lifecycle_reasons":[{"code":"cloning_in_progress","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1","id":"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","origin_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"snapshot_count":0,"snapshot_size":0,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4","id":"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4","name":"my-share-snapshot","resource_type":"share_snapshot"},"storage_generation":1,"user_tags":["UserTags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"shares":[{"access_control_mode":"security_group","accessor_binding_role":"accessor","accessor_bindings":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r006-ce9dac18-dea0-4392-841c-142d3300674f","resource_type":"share_accessor_binding"}],"allowed_access_protocols":["nfs4"],"allowed_transit_encryption_modes":["ipsec"],"availability_mode":"zonal","bandwidth":1,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","initial_owner":{"gid":50,"uid":50},"iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"latest_sync":{"completed_at":"2019-01-01T12:00:00.000Z","data_transferred":0,"started_at":"2019-01-01T12:00:00.000Z"},"lifecycle_reasons":[{"code":"cloning_in_progress","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1","id":"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","origin_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"snapshot_count":0,"snapshot_size":0,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4","id":"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4","name":"my-share-snapshot","resource_type":"share_snapshot"},"storage_generation":1,"user_tags":["UserTags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use SharesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSharesOptionsModel := &vpcv1.ListSharesOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					Name:            core.StringPtr("my-name"),
					Sort:            core.StringPtr("name"),
					ReplicationRole: core.StringPtr("none"),
				}

				pager, err := vpcService.NewSharesPager(listSharesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.Share
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use SharesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSharesOptionsModel := &vpcv1.ListSharesOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					Name:            core.StringPtr("my-name"),
					Sort:            core.StringPtr("name"),
					ReplicationRole: core.StringPtr("none"),
				}

				pager, err := vpcService.NewSharesPager(listSharesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateShare(createShareOptions *CreateShareOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createSharePath := "/shares"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSharePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateShare with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
				shareMountTargetVirtualNetworkInterfacePrototypeModel := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AutoDelete = core.BoolPtr(false)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Name = core.StringPtr("my-virtual-network-interface")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
				shareMountTargetPrototypeModel := new(vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup)
				shareMountTargetPrototypeModel.AccessProtocol = core.StringPtr("nfs4")
				shareMountTargetPrototypeModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPrototypeModel.TransitEncryption = core.StringPtr("none")
				shareMountTargetPrototypeModel.VirtualNetworkInterface = shareMountTargetVirtualNetworkInterfacePrototypeModel

				// Construct an instance of the ShareProfileIdentityByName model
				shareProfileIdentityModel := new(vpcv1.ShareProfileIdentityByName)
				shareProfileIdentityModel.Name = core.StringPtr("tier-3iops")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SharePrototypeShareContext model
				sharePrototypeShareContextModel := new(vpcv1.SharePrototypeShareContext)
				sharePrototypeShareContextModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePrototypeShareContextModel.Iops = core.Int64Ptr(int64(100))
				sharePrototypeShareContextModel.MountTargets = []vpcv1.ShareMountTargetPrototypeIntf{shareMountTargetPrototypeModel}
				sharePrototypeShareContextModel.Name = core.StringPtr("my-share")
				sharePrototypeShareContextModel.Profile = shareProfileIdentityModel
				sharePrototypeShareContextModel.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
				sharePrototypeShareContextModel.ResourceGroup = resourceGroupIdentityModel
				sharePrototypeShareContextModel.UserTags = []string{}
				sharePrototypeShareContextModel.Zone = zoneIdentityModel

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the ShareInitialOwner model
				shareInitialOwnerModel := new(vpcv1.ShareInitialOwner)
				shareInitialOwnerModel.Gid = core.Int64Ptr(int64(50))
				shareInitialOwnerModel.Uid = core.Int64Ptr(int64(50))

				// Construct an instance of the SharePrototypeShareBySize model
				sharePrototypeModel := new(vpcv1.SharePrototypeShareBySize)
				sharePrototypeModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePrototypeModel.MountTargets = []vpcv1.ShareMountTargetPrototypeIntf{shareMountTargetPrototypeModel}
				sharePrototypeModel.Name = core.StringPtr("my-share")
				sharePrototypeModel.ReplicaShare = sharePrototypeShareContextModel
				sharePrototypeModel.UserTags = []string{}
				sharePrototypeModel.AccessControlMode = core.StringPtr("security_group")
				sharePrototypeModel.AllowedAccessProtocols = []string{"nfs4"}
				sharePrototypeModel.Bandwidth = core.Int64Ptr(int64(100))
				sharePrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				sharePrototypeModel.InitialOwner = shareInitialOwnerModel
				sharePrototypeModel.Iops = core.Int64Ptr(int64(100))
				sharePrototypeModel.Profile = shareProfileIdentityModel
				sharePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				sharePrototypeModel.Size = core.Int64Ptr(int64(200))
				sharePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateShareOptions model
				createShareOptionsModel := new(vpcv1.CreateShareOptions)
				createShareOptionsModel.SharePrototype = sharePrototypeModel
				createShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateShare(createShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateShare(createShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateShare(createShareOptions *CreateShareOptions)`, func() {
		version := "2024-06-23"
		createSharePath := "/shares"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSharePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r006-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_access_protocols": ["nfs4"], "allowed_transit_encryption_modes": ["ipsec"], "availability_mode": "zonal", "bandwidth": 1, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "initial_owner": {"gid": 50, "uid": 50}, "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "cloning_in_progress", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "snapshot_count": 0, "snapshot_size": 0, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "name": "my-share-snapshot", "resource_type": "share_snapshot"}, "storage_generation": 1, "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateShare successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
				shareMountTargetVirtualNetworkInterfacePrototypeModel := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AutoDelete = core.BoolPtr(false)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Name = core.StringPtr("my-virtual-network-interface")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
				shareMountTargetPrototypeModel := new(vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup)
				shareMountTargetPrototypeModel.AccessProtocol = core.StringPtr("nfs4")
				shareMountTargetPrototypeModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPrototypeModel.TransitEncryption = core.StringPtr("none")
				shareMountTargetPrototypeModel.VirtualNetworkInterface = shareMountTargetVirtualNetworkInterfacePrototypeModel

				// Construct an instance of the ShareProfileIdentityByName model
				shareProfileIdentityModel := new(vpcv1.ShareProfileIdentityByName)
				shareProfileIdentityModel.Name = core.StringPtr("tier-3iops")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SharePrototypeShareContext model
				sharePrototypeShareContextModel := new(vpcv1.SharePrototypeShareContext)
				sharePrototypeShareContextModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePrototypeShareContextModel.Iops = core.Int64Ptr(int64(100))
				sharePrototypeShareContextModel.MountTargets = []vpcv1.ShareMountTargetPrototypeIntf{shareMountTargetPrototypeModel}
				sharePrototypeShareContextModel.Name = core.StringPtr("my-share")
				sharePrototypeShareContextModel.Profile = shareProfileIdentityModel
				sharePrototypeShareContextModel.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
				sharePrototypeShareContextModel.ResourceGroup = resourceGroupIdentityModel
				sharePrototypeShareContextModel.UserTags = []string{}
				sharePrototypeShareContextModel.Zone = zoneIdentityModel

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the ShareInitialOwner model
				shareInitialOwnerModel := new(vpcv1.ShareInitialOwner)
				shareInitialOwnerModel.Gid = core.Int64Ptr(int64(50))
				shareInitialOwnerModel.Uid = core.Int64Ptr(int64(50))

				// Construct an instance of the SharePrototypeShareBySize model
				sharePrototypeModel := new(vpcv1.SharePrototypeShareBySize)
				sharePrototypeModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePrototypeModel.MountTargets = []vpcv1.ShareMountTargetPrototypeIntf{shareMountTargetPrototypeModel}
				sharePrototypeModel.Name = core.StringPtr("my-share")
				sharePrototypeModel.ReplicaShare = sharePrototypeShareContextModel
				sharePrototypeModel.UserTags = []string{}
				sharePrototypeModel.AccessControlMode = core.StringPtr("security_group")
				sharePrototypeModel.AllowedAccessProtocols = []string{"nfs4"}
				sharePrototypeModel.Bandwidth = core.Int64Ptr(int64(100))
				sharePrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				sharePrototypeModel.InitialOwner = shareInitialOwnerModel
				sharePrototypeModel.Iops = core.Int64Ptr(int64(100))
				sharePrototypeModel.Profile = shareProfileIdentityModel
				sharePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				sharePrototypeModel.Size = core.Int64Ptr(int64(200))
				sharePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateShareOptions model
				createShareOptionsModel := new(vpcv1.CreateShareOptions)
				createShareOptionsModel.SharePrototype = sharePrototypeModel
				createShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateShareWithContext(ctx, createShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateShare(createShareOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateShareWithContext(ctx, createShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSharePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r006-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_access_protocols": ["nfs4"], "allowed_transit_encryption_modes": ["ipsec"], "availability_mode": "zonal", "bandwidth": 1, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "initial_owner": {"gid": 50, "uid": 50}, "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "cloning_in_progress", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "snapshot_count": 0, "snapshot_size": 0, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "name": "my-share-snapshot", "resource_type": "share_snapshot"}, "storage_generation": 1, "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateShare successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateShare(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
				shareMountTargetVirtualNetworkInterfacePrototypeModel := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AutoDelete = core.BoolPtr(false)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Name = core.StringPtr("my-virtual-network-interface")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
				shareMountTargetPrototypeModel := new(vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup)
				shareMountTargetPrototypeModel.AccessProtocol = core.StringPtr("nfs4")
				shareMountTargetPrototypeModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPrototypeModel.TransitEncryption = core.StringPtr("none")
				shareMountTargetPrototypeModel.VirtualNetworkInterface = shareMountTargetVirtualNetworkInterfacePrototypeModel

				// Construct an instance of the ShareProfileIdentityByName model
				shareProfileIdentityModel := new(vpcv1.ShareProfileIdentityByName)
				shareProfileIdentityModel.Name = core.StringPtr("tier-3iops")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SharePrototypeShareContext model
				sharePrototypeShareContextModel := new(vpcv1.SharePrototypeShareContext)
				sharePrototypeShareContextModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePrototypeShareContextModel.Iops = core.Int64Ptr(int64(100))
				sharePrototypeShareContextModel.MountTargets = []vpcv1.ShareMountTargetPrototypeIntf{shareMountTargetPrototypeModel}
				sharePrototypeShareContextModel.Name = core.StringPtr("my-share")
				sharePrototypeShareContextModel.Profile = shareProfileIdentityModel
				sharePrototypeShareContextModel.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
				sharePrototypeShareContextModel.ResourceGroup = resourceGroupIdentityModel
				sharePrototypeShareContextModel.UserTags = []string{}
				sharePrototypeShareContextModel.Zone = zoneIdentityModel

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the ShareInitialOwner model
				shareInitialOwnerModel := new(vpcv1.ShareInitialOwner)
				shareInitialOwnerModel.Gid = core.Int64Ptr(int64(50))
				shareInitialOwnerModel.Uid = core.Int64Ptr(int64(50))

				// Construct an instance of the SharePrototypeShareBySize model
				sharePrototypeModel := new(vpcv1.SharePrototypeShareBySize)
				sharePrototypeModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePrototypeModel.MountTargets = []vpcv1.ShareMountTargetPrototypeIntf{shareMountTargetPrototypeModel}
				sharePrototypeModel.Name = core.StringPtr("my-share")
				sharePrototypeModel.ReplicaShare = sharePrototypeShareContextModel
				sharePrototypeModel.UserTags = []string{}
				sharePrototypeModel.AccessControlMode = core.StringPtr("security_group")
				sharePrototypeModel.AllowedAccessProtocols = []string{"nfs4"}
				sharePrototypeModel.Bandwidth = core.Int64Ptr(int64(100))
				sharePrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				sharePrototypeModel.InitialOwner = shareInitialOwnerModel
				sharePrototypeModel.Iops = core.Int64Ptr(int64(100))
				sharePrototypeModel.Profile = shareProfileIdentityModel
				sharePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				sharePrototypeModel.Size = core.Int64Ptr(int64(200))
				sharePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateShareOptions model
				createShareOptionsModel := new(vpcv1.CreateShareOptions)
				createShareOptionsModel.SharePrototype = sharePrototypeModel
				createShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateShare(createShareOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateShare with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
				shareMountTargetVirtualNetworkInterfacePrototypeModel := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AutoDelete = core.BoolPtr(false)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Name = core.StringPtr("my-virtual-network-interface")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
				shareMountTargetPrototypeModel := new(vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup)
				shareMountTargetPrototypeModel.AccessProtocol = core.StringPtr("nfs4")
				shareMountTargetPrototypeModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPrototypeModel.TransitEncryption = core.StringPtr("none")
				shareMountTargetPrototypeModel.VirtualNetworkInterface = shareMountTargetVirtualNetworkInterfacePrototypeModel

				// Construct an instance of the ShareProfileIdentityByName model
				shareProfileIdentityModel := new(vpcv1.ShareProfileIdentityByName)
				shareProfileIdentityModel.Name = core.StringPtr("tier-3iops")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SharePrototypeShareContext model
				sharePrototypeShareContextModel := new(vpcv1.SharePrototypeShareContext)
				sharePrototypeShareContextModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePrototypeShareContextModel.Iops = core.Int64Ptr(int64(100))
				sharePrototypeShareContextModel.MountTargets = []vpcv1.ShareMountTargetPrototypeIntf{shareMountTargetPrototypeModel}
				sharePrototypeShareContextModel.Name = core.StringPtr("my-share")
				sharePrototypeShareContextModel.Profile = shareProfileIdentityModel
				sharePrototypeShareContextModel.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
				sharePrototypeShareContextModel.ResourceGroup = resourceGroupIdentityModel
				sharePrototypeShareContextModel.UserTags = []string{}
				sharePrototypeShareContextModel.Zone = zoneIdentityModel

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the ShareInitialOwner model
				shareInitialOwnerModel := new(vpcv1.ShareInitialOwner)
				shareInitialOwnerModel.Gid = core.Int64Ptr(int64(50))
				shareInitialOwnerModel.Uid = core.Int64Ptr(int64(50))

				// Construct an instance of the SharePrototypeShareBySize model
				sharePrototypeModel := new(vpcv1.SharePrototypeShareBySize)
				sharePrototypeModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePrototypeModel.MountTargets = []vpcv1.ShareMountTargetPrototypeIntf{shareMountTargetPrototypeModel}
				sharePrototypeModel.Name = core.StringPtr("my-share")
				sharePrototypeModel.ReplicaShare = sharePrototypeShareContextModel
				sharePrototypeModel.UserTags = []string{}
				sharePrototypeModel.AccessControlMode = core.StringPtr("security_group")
				sharePrototypeModel.AllowedAccessProtocols = []string{"nfs4"}
				sharePrototypeModel.Bandwidth = core.Int64Ptr(int64(100))
				sharePrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				sharePrototypeModel.InitialOwner = shareInitialOwnerModel
				sharePrototypeModel.Iops = core.Int64Ptr(int64(100))
				sharePrototypeModel.Profile = shareProfileIdentityModel
				sharePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				sharePrototypeModel.Size = core.Int64Ptr(int64(200))
				sharePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateShareOptions model
				createShareOptionsModel := new(vpcv1.CreateShareOptions)
				createShareOptionsModel.SharePrototype = sharePrototypeModel
				createShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateShare(createShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateShareOptions model with no property values
				createShareOptionsModelNew := new(vpcv1.CreateShareOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateShare(createShareOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateShare successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
				shareMountTargetVirtualNetworkInterfacePrototypeModel := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AutoDelete = core.BoolPtr(false)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Name = core.StringPtr("my-virtual-network-interface")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
				shareMountTargetPrototypeModel := new(vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup)
				shareMountTargetPrototypeModel.AccessProtocol = core.StringPtr("nfs4")
				shareMountTargetPrototypeModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPrototypeModel.TransitEncryption = core.StringPtr("none")
				shareMountTargetPrototypeModel.VirtualNetworkInterface = shareMountTargetVirtualNetworkInterfacePrototypeModel

				// Construct an instance of the ShareProfileIdentityByName model
				shareProfileIdentityModel := new(vpcv1.ShareProfileIdentityByName)
				shareProfileIdentityModel.Name = core.StringPtr("tier-3iops")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SharePrototypeShareContext model
				sharePrototypeShareContextModel := new(vpcv1.SharePrototypeShareContext)
				sharePrototypeShareContextModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePrototypeShareContextModel.Iops = core.Int64Ptr(int64(100))
				sharePrototypeShareContextModel.MountTargets = []vpcv1.ShareMountTargetPrototypeIntf{shareMountTargetPrototypeModel}
				sharePrototypeShareContextModel.Name = core.StringPtr("my-share")
				sharePrototypeShareContextModel.Profile = shareProfileIdentityModel
				sharePrototypeShareContextModel.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
				sharePrototypeShareContextModel.ResourceGroup = resourceGroupIdentityModel
				sharePrototypeShareContextModel.UserTags = []string{}
				sharePrototypeShareContextModel.Zone = zoneIdentityModel

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the ShareInitialOwner model
				shareInitialOwnerModel := new(vpcv1.ShareInitialOwner)
				shareInitialOwnerModel.Gid = core.Int64Ptr(int64(50))
				shareInitialOwnerModel.Uid = core.Int64Ptr(int64(50))

				// Construct an instance of the SharePrototypeShareBySize model
				sharePrototypeModel := new(vpcv1.SharePrototypeShareBySize)
				sharePrototypeModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePrototypeModel.MountTargets = []vpcv1.ShareMountTargetPrototypeIntf{shareMountTargetPrototypeModel}
				sharePrototypeModel.Name = core.StringPtr("my-share")
				sharePrototypeModel.ReplicaShare = sharePrototypeShareContextModel
				sharePrototypeModel.UserTags = []string{}
				sharePrototypeModel.AccessControlMode = core.StringPtr("security_group")
				sharePrototypeModel.AllowedAccessProtocols = []string{"nfs4"}
				sharePrototypeModel.Bandwidth = core.Int64Ptr(int64(100))
				sharePrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				sharePrototypeModel.InitialOwner = shareInitialOwnerModel
				sharePrototypeModel.Iops = core.Int64Ptr(int64(100))
				sharePrototypeModel.Profile = shareProfileIdentityModel
				sharePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				sharePrototypeModel.Size = core.Int64Ptr(int64(200))
				sharePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateShareOptions model
				createShareOptionsModel := new(vpcv1.CreateShareOptions)
				createShareOptionsModel.SharePrototype = sharePrototypeModel
				createShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateShare(createShareOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteShare(deleteShareOptions *DeleteShareOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deleteSharePath := "/shares/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteSharePath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/96d225c4-56bd-43d9-98fc-d7148e5c5028")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeleteShare with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteShareOptions model
				deleteShareOptionsModel := new(vpcv1.DeleteShareOptions)
				deleteShareOptionsModel.ID = core.StringPtr("testString")
				deleteShareOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				deleteShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeleteShare(deleteShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeleteShare(deleteShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteShare(deleteShareOptions *DeleteShareOptions)`, func() {
		version := "2024-06-23"
		deleteSharePath := "/shares/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteSharePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/96d225c4-56bd-43d9-98fc-d7148e5c5028")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r006-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_access_protocols": ["nfs4"], "allowed_transit_encryption_modes": ["ipsec"], "availability_mode": "zonal", "bandwidth": 1, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "initial_owner": {"gid": 50, "uid": 50}, "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "cloning_in_progress", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "snapshot_count": 0, "snapshot_size": 0, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "name": "my-share-snapshot", "resource_type": "share_snapshot"}, "storage_generation": 1, "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke DeleteShare successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeleteShareOptions model
				deleteShareOptionsModel := new(vpcv1.DeleteShareOptions)
				deleteShareOptionsModel.ID = core.StringPtr("testString")
				deleteShareOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				deleteShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeleteShareWithContext(ctx, deleteShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeleteShare(deleteShareOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeleteShareWithContext(ctx, deleteShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteSharePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/96d225c4-56bd-43d9-98fc-d7148e5c5028")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r006-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_access_protocols": ["nfs4"], "allowed_transit_encryption_modes": ["ipsec"], "availability_mode": "zonal", "bandwidth": 1, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "initial_owner": {"gid": 50, "uid": 50}, "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "cloning_in_progress", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "snapshot_count": 0, "snapshot_size": 0, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "name": "my-share-snapshot", "resource_type": "share_snapshot"}, "storage_generation": 1, "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke DeleteShare successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeleteShare(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeleteShareOptions model
				deleteShareOptionsModel := new(vpcv1.DeleteShareOptions)
				deleteShareOptionsModel.ID = core.StringPtr("testString")
				deleteShareOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				deleteShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeleteShare(deleteShareOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeleteShare with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteShareOptions model
				deleteShareOptionsModel := new(vpcv1.DeleteShareOptions)
				deleteShareOptionsModel.ID = core.StringPtr("testString")
				deleteShareOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				deleteShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeleteShare(deleteShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeleteShareOptions model with no property values
				deleteShareOptionsModelNew := new(vpcv1.DeleteShareOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeleteShare(deleteShareOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteShare successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteShareOptions model
				deleteShareOptionsModel := new(vpcv1.DeleteShareOptions)
				deleteShareOptionsModel.ID = core.StringPtr("testString")
				deleteShareOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				deleteShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeleteShare(deleteShareOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetShare(getShareOptions *GetShareOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getSharePath := "/shares/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSharePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetShare with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareOptions model
				getShareOptionsModel := new(vpcv1.GetShareOptions)
				getShareOptionsModel.ID = core.StringPtr("testString")
				getShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetShare(getShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetShare(getShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetShare(getShareOptions *GetShareOptions)`, func() {
		version := "2024-06-23"
		getSharePath := "/shares/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSharePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r006-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_access_protocols": ["nfs4"], "allowed_transit_encryption_modes": ["ipsec"], "availability_mode": "zonal", "bandwidth": 1, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "initial_owner": {"gid": 50, "uid": 50}, "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "cloning_in_progress", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "snapshot_count": 0, "snapshot_size": 0, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "name": "my-share-snapshot", "resource_type": "share_snapshot"}, "storage_generation": 1, "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetShare successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetShareOptions model
				getShareOptionsModel := new(vpcv1.GetShareOptions)
				getShareOptionsModel.ID = core.StringPtr("testString")
				getShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetShareWithContext(ctx, getShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetShare(getShareOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetShareWithContext(ctx, getShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSharePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r006-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_access_protocols": ["nfs4"], "allowed_transit_encryption_modes": ["ipsec"], "availability_mode": "zonal", "bandwidth": 1, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "initial_owner": {"gid": 50, "uid": 50}, "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "cloning_in_progress", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "snapshot_count": 0, "snapshot_size": 0, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "name": "my-share-snapshot", "resource_type": "share_snapshot"}, "storage_generation": 1, "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetShare successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetShare(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetShareOptions model
				getShareOptionsModel := new(vpcv1.GetShareOptions)
				getShareOptionsModel.ID = core.StringPtr("testString")
				getShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetShare(getShareOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetShare with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareOptions model
				getShareOptionsModel := new(vpcv1.GetShareOptions)
				getShareOptionsModel.ID = core.StringPtr("testString")
				getShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetShare(getShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetShareOptions model with no property values
				getShareOptionsModelNew := new(vpcv1.GetShareOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetShare(getShareOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetShare successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareOptions model
				getShareOptionsModel := new(vpcv1.GetShareOptions)
				getShareOptionsModel.ID = core.StringPtr("testString")
				getShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetShare(getShareOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateShare(updateShareOptions *UpdateShareOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateSharePath := "/shares/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSharePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/96d225c4-56bd-43d9-98fc-d7148e5c5028")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateShare with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ShareProfileIdentityByName model
				shareProfileIdentityModel := new(vpcv1.ShareProfileIdentityByName)
				shareProfileIdentityModel.Name = core.StringPtr("tier-3iops")

				// Construct an instance of the SharePatch model
				sharePatchModel := new(vpcv1.SharePatch)
				sharePatchModel.AccessControlMode = core.StringPtr("security_group")
				sharePatchModel.AllowedAccessProtocols = []string{"nfs4"}
				sharePatchModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePatchModel.Bandwidth = core.Int64Ptr(int64(1))
				sharePatchModel.Iops = core.Int64Ptr(int64(100))
				sharePatchModel.Name = core.StringPtr("my-share")
				sharePatchModel.Profile = shareProfileIdentityModel
				sharePatchModel.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
				sharePatchModel.Size = core.Int64Ptr(int64(8000))
				sharePatchModel.UserTags = []string{"testString"}
				sharePatchModelAsPatch, asPatchErr := sharePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareOptions model
				updateShareOptionsModel := new(vpcv1.UpdateShareOptions)
				updateShareOptionsModel.ID = core.StringPtr("testString")
				updateShareOptionsModel.SharePatch = sharePatchModelAsPatch
				updateShareOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				updateShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateShare(updateShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateShare(updateShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateShare(updateShareOptions *UpdateShareOptions)`, func() {
		version := "2024-06-23"
		updateSharePath := "/shares/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSharePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/96d225c4-56bd-43d9-98fc-d7148e5c5028")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r006-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_access_protocols": ["nfs4"], "allowed_transit_encryption_modes": ["ipsec"], "availability_mode": "zonal", "bandwidth": 1, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "initial_owner": {"gid": 50, "uid": 50}, "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "cloning_in_progress", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "snapshot_count": 0, "snapshot_size": 0, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "name": "my-share-snapshot", "resource_type": "share_snapshot"}, "storage_generation": 1, "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateShare successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ShareProfileIdentityByName model
				shareProfileIdentityModel := new(vpcv1.ShareProfileIdentityByName)
				shareProfileIdentityModel.Name = core.StringPtr("tier-3iops")

				// Construct an instance of the SharePatch model
				sharePatchModel := new(vpcv1.SharePatch)
				sharePatchModel.AccessControlMode = core.StringPtr("security_group")
				sharePatchModel.AllowedAccessProtocols = []string{"nfs4"}
				sharePatchModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePatchModel.Bandwidth = core.Int64Ptr(int64(1))
				sharePatchModel.Iops = core.Int64Ptr(int64(100))
				sharePatchModel.Name = core.StringPtr("my-share")
				sharePatchModel.Profile = shareProfileIdentityModel
				sharePatchModel.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
				sharePatchModel.Size = core.Int64Ptr(int64(8000))
				sharePatchModel.UserTags = []string{"testString"}
				sharePatchModelAsPatch, asPatchErr := sharePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareOptions model
				updateShareOptionsModel := new(vpcv1.UpdateShareOptions)
				updateShareOptionsModel.ID = core.StringPtr("testString")
				updateShareOptionsModel.SharePatch = sharePatchModelAsPatch
				updateShareOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				updateShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateShareWithContext(ctx, updateShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateShare(updateShareOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateShareWithContext(ctx, updateShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSharePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/96d225c4-56bd-43d9-98fc-d7148e5c5028")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r006-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_access_protocols": ["nfs4"], "allowed_transit_encryption_modes": ["ipsec"], "availability_mode": "zonal", "bandwidth": 1, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "initial_owner": {"gid": 50, "uid": 50}, "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "cloning_in_progress", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "snapshot_count": 0, "snapshot_size": 0, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "name": "my-share-snapshot", "resource_type": "share_snapshot"}, "storage_generation": 1, "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateShare successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateShare(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ShareProfileIdentityByName model
				shareProfileIdentityModel := new(vpcv1.ShareProfileIdentityByName)
				shareProfileIdentityModel.Name = core.StringPtr("tier-3iops")

				// Construct an instance of the SharePatch model
				sharePatchModel := new(vpcv1.SharePatch)
				sharePatchModel.AccessControlMode = core.StringPtr("security_group")
				sharePatchModel.AllowedAccessProtocols = []string{"nfs4"}
				sharePatchModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePatchModel.Bandwidth = core.Int64Ptr(int64(1))
				sharePatchModel.Iops = core.Int64Ptr(int64(100))
				sharePatchModel.Name = core.StringPtr("my-share")
				sharePatchModel.Profile = shareProfileIdentityModel
				sharePatchModel.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
				sharePatchModel.Size = core.Int64Ptr(int64(8000))
				sharePatchModel.UserTags = []string{"testString"}
				sharePatchModelAsPatch, asPatchErr := sharePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareOptions model
				updateShareOptionsModel := new(vpcv1.UpdateShareOptions)
				updateShareOptionsModel.ID = core.StringPtr("testString")
				updateShareOptionsModel.SharePatch = sharePatchModelAsPatch
				updateShareOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				updateShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateShare(updateShareOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateShare with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ShareProfileIdentityByName model
				shareProfileIdentityModel := new(vpcv1.ShareProfileIdentityByName)
				shareProfileIdentityModel.Name = core.StringPtr("tier-3iops")

				// Construct an instance of the SharePatch model
				sharePatchModel := new(vpcv1.SharePatch)
				sharePatchModel.AccessControlMode = core.StringPtr("security_group")
				sharePatchModel.AllowedAccessProtocols = []string{"nfs4"}
				sharePatchModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePatchModel.Bandwidth = core.Int64Ptr(int64(1))
				sharePatchModel.Iops = core.Int64Ptr(int64(100))
				sharePatchModel.Name = core.StringPtr("my-share")
				sharePatchModel.Profile = shareProfileIdentityModel
				sharePatchModel.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
				sharePatchModel.Size = core.Int64Ptr(int64(8000))
				sharePatchModel.UserTags = []string{"testString"}
				sharePatchModelAsPatch, asPatchErr := sharePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareOptions model
				updateShareOptionsModel := new(vpcv1.UpdateShareOptions)
				updateShareOptionsModel.ID = core.StringPtr("testString")
				updateShareOptionsModel.SharePatch = sharePatchModelAsPatch
				updateShareOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				updateShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateShare(updateShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateShareOptions model with no property values
				updateShareOptionsModelNew := new(vpcv1.UpdateShareOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateShare(updateShareOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateShare successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ShareProfileIdentityByName model
				shareProfileIdentityModel := new(vpcv1.ShareProfileIdentityByName)
				shareProfileIdentityModel.Name = core.StringPtr("tier-3iops")

				// Construct an instance of the SharePatch model
				sharePatchModel := new(vpcv1.SharePatch)
				sharePatchModel.AccessControlMode = core.StringPtr("security_group")
				sharePatchModel.AllowedAccessProtocols = []string{"nfs4"}
				sharePatchModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePatchModel.Bandwidth = core.Int64Ptr(int64(1))
				sharePatchModel.Iops = core.Int64Ptr(int64(100))
				sharePatchModel.Name = core.StringPtr("my-share")
				sharePatchModel.Profile = shareProfileIdentityModel
				sharePatchModel.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
				sharePatchModel.Size = core.Int64Ptr(int64(8000))
				sharePatchModel.UserTags = []string{"testString"}
				sharePatchModelAsPatch, asPatchErr := sharePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareOptions model
				updateShareOptionsModel := new(vpcv1.UpdateShareOptions)
				updateShareOptionsModel.ID = core.StringPtr("testString")
				updateShareOptionsModel.SharePatch = sharePatchModelAsPatch
				updateShareOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				updateShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateShare(updateShareOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListShareAccessorBindings(listShareAccessorBindingsOptions *ListShareAccessorBindingsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listShareAccessorBindingsPath := "/shares/testString/accessor_bindings"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareAccessorBindingsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListShareAccessorBindings with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListShareAccessorBindingsOptions model
				listShareAccessorBindingsOptionsModel := new(vpcv1.ListShareAccessorBindingsOptions)
				listShareAccessorBindingsOptionsModel.ID = core.StringPtr("testString")
				listShareAccessorBindingsOptionsModel.Start = core.StringPtr("testString")
				listShareAccessorBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareAccessorBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListShareAccessorBindings(listShareAccessorBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListShareAccessorBindings(listShareAccessorBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListShareAccessorBindings(listShareAccessorBindingsOptions *ListShareAccessorBindingsOptions)`, func() {
		version := "2024-06-23"
		listShareAccessorBindingsPath := "/shares/testString/accessor_bindings"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareAccessorBindingsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accessor_bindings": [{"accessor": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r006-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "share_accessor_binding"}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListShareAccessorBindings successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListShareAccessorBindingsOptions model
				listShareAccessorBindingsOptionsModel := new(vpcv1.ListShareAccessorBindingsOptions)
				listShareAccessorBindingsOptionsModel.ID = core.StringPtr("testString")
				listShareAccessorBindingsOptionsModel.Start = core.StringPtr("testString")
				listShareAccessorBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareAccessorBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListShareAccessorBindingsWithContext(ctx, listShareAccessorBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListShareAccessorBindings(listShareAccessorBindingsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListShareAccessorBindingsWithContext(ctx, listShareAccessorBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareAccessorBindingsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accessor_bindings": [{"accessor": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r006-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "share_accessor_binding"}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListShareAccessorBindings successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListShareAccessorBindings(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListShareAccessorBindingsOptions model
				listShareAccessorBindingsOptionsModel := new(vpcv1.ListShareAccessorBindingsOptions)
				listShareAccessorBindingsOptionsModel.ID = core.StringPtr("testString")
				listShareAccessorBindingsOptionsModel.Start = core.StringPtr("testString")
				listShareAccessorBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareAccessorBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListShareAccessorBindings(listShareAccessorBindingsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListShareAccessorBindings with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListShareAccessorBindingsOptions model
				listShareAccessorBindingsOptionsModel := new(vpcv1.ListShareAccessorBindingsOptions)
				listShareAccessorBindingsOptionsModel.ID = core.StringPtr("testString")
				listShareAccessorBindingsOptionsModel.Start = core.StringPtr("testString")
				listShareAccessorBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareAccessorBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListShareAccessorBindings(listShareAccessorBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListShareAccessorBindingsOptions model with no property values
				listShareAccessorBindingsOptionsModelNew := new(vpcv1.ListShareAccessorBindingsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListShareAccessorBindings(listShareAccessorBindingsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListShareAccessorBindings successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListShareAccessorBindingsOptions model
				listShareAccessorBindingsOptionsModel := new(vpcv1.ListShareAccessorBindingsOptions)
				listShareAccessorBindingsOptionsModel.ID = core.StringPtr("testString")
				listShareAccessorBindingsOptionsModel.Start = core.StringPtr("testString")
				listShareAccessorBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareAccessorBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListShareAccessorBindings(listShareAccessorBindingsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ShareAccessorBindingCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ShareAccessorBindingCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ShareAccessorBindingCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareAccessorBindingsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"accessor_bindings":[{"accessor":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r006-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"share_accessor_binding"}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"accessor_bindings":[{"accessor":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r006-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"share_accessor_binding"}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use ShareAccessorBindingsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listShareAccessorBindingsOptionsModel := &vpcv1.ListShareAccessorBindingsOptions{
					ID:    core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewShareAccessorBindingsPager(listShareAccessorBindingsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.ShareAccessorBinding
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use ShareAccessorBindingsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listShareAccessorBindingsOptionsModel := &vpcv1.ListShareAccessorBindingsOptions{
					ID:    core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewShareAccessorBindingsPager(listShareAccessorBindingsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`DeleteShareAccessorBinding(deleteShareAccessorBindingOptions *DeleteShareAccessorBindingOptions)`, func() {
		version := "2024-06-23"
		deleteShareAccessorBindingPath := "/shares/testString/accessor_bindings/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteShareAccessorBindingPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteShareAccessorBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteShareAccessorBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteShareAccessorBindingOptions model
				deleteShareAccessorBindingOptionsModel := new(vpcv1.DeleteShareAccessorBindingOptions)
				deleteShareAccessorBindingOptionsModel.ShareID = core.StringPtr("testString")
				deleteShareAccessorBindingOptionsModel.ID = core.StringPtr("testString")
				deleteShareAccessorBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteShareAccessorBinding(deleteShareAccessorBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteShareAccessorBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteShareAccessorBindingOptions model
				deleteShareAccessorBindingOptionsModel := new(vpcv1.DeleteShareAccessorBindingOptions)
				deleteShareAccessorBindingOptionsModel.ShareID = core.StringPtr("testString")
				deleteShareAccessorBindingOptionsModel.ID = core.StringPtr("testString")
				deleteShareAccessorBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteShareAccessorBinding(deleteShareAccessorBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteShareAccessorBindingOptions model with no property values
				deleteShareAccessorBindingOptionsModelNew := new(vpcv1.DeleteShareAccessorBindingOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteShareAccessorBinding(deleteShareAccessorBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetShareAccessorBinding(getShareAccessorBindingOptions *GetShareAccessorBindingOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getShareAccessorBindingPath := "/shares/testString/accessor_bindings/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareAccessorBindingPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetShareAccessorBinding with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareAccessorBindingOptions model
				getShareAccessorBindingOptionsModel := new(vpcv1.GetShareAccessorBindingOptions)
				getShareAccessorBindingOptionsModel.ShareID = core.StringPtr("testString")
				getShareAccessorBindingOptionsModel.ID = core.StringPtr("testString")
				getShareAccessorBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetShareAccessorBinding(getShareAccessorBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetShareAccessorBinding(getShareAccessorBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetShareAccessorBinding(getShareAccessorBindingOptions *GetShareAccessorBindingOptions)`, func() {
		version := "2024-06-23"
		getShareAccessorBindingPath := "/shares/testString/accessor_bindings/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareAccessorBindingPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accessor": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r006-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "share_accessor_binding"}`)
				}))
			})
			It(`Invoke GetShareAccessorBinding successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetShareAccessorBindingOptions model
				getShareAccessorBindingOptionsModel := new(vpcv1.GetShareAccessorBindingOptions)
				getShareAccessorBindingOptionsModel.ShareID = core.StringPtr("testString")
				getShareAccessorBindingOptionsModel.ID = core.StringPtr("testString")
				getShareAccessorBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetShareAccessorBindingWithContext(ctx, getShareAccessorBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetShareAccessorBinding(getShareAccessorBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetShareAccessorBindingWithContext(ctx, getShareAccessorBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareAccessorBindingPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accessor": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r006-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "share_accessor_binding"}`)
				}))
			})
			It(`Invoke GetShareAccessorBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetShareAccessorBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetShareAccessorBindingOptions model
				getShareAccessorBindingOptionsModel := new(vpcv1.GetShareAccessorBindingOptions)
				getShareAccessorBindingOptionsModel.ShareID = core.StringPtr("testString")
				getShareAccessorBindingOptionsModel.ID = core.StringPtr("testString")
				getShareAccessorBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetShareAccessorBinding(getShareAccessorBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetShareAccessorBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareAccessorBindingOptions model
				getShareAccessorBindingOptionsModel := new(vpcv1.GetShareAccessorBindingOptions)
				getShareAccessorBindingOptionsModel.ShareID = core.StringPtr("testString")
				getShareAccessorBindingOptionsModel.ID = core.StringPtr("testString")
				getShareAccessorBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetShareAccessorBinding(getShareAccessorBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetShareAccessorBindingOptions model with no property values
				getShareAccessorBindingOptionsModelNew := new(vpcv1.GetShareAccessorBindingOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetShareAccessorBinding(getShareAccessorBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetShareAccessorBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareAccessorBindingOptions model
				getShareAccessorBindingOptionsModel := new(vpcv1.GetShareAccessorBindingOptions)
				getShareAccessorBindingOptionsModel.ShareID = core.StringPtr("testString")
				getShareAccessorBindingOptionsModel.ID = core.StringPtr("testString")
				getShareAccessorBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetShareAccessorBinding(getShareAccessorBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`FailoverShare(failoverShareOptions *FailoverShareOptions)`, func() {
		version := "2024-06-23"
		failoverSharePath := "/shares/testString/failover"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(failoverSharePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke FailoverShare successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.FailoverShare(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the FailoverShareOptions model
				failoverShareOptionsModel := new(vpcv1.FailoverShareOptions)
				failoverShareOptionsModel.ShareID = core.StringPtr("testString")
				failoverShareOptionsModel.FallbackPolicy = core.StringPtr("fail")
				failoverShareOptionsModel.Timeout = core.Int64Ptr(int64(600))
				failoverShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.FailoverShare(failoverShareOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke FailoverShare with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the FailoverShareOptions model
				failoverShareOptionsModel := new(vpcv1.FailoverShareOptions)
				failoverShareOptionsModel.ShareID = core.StringPtr("testString")
				failoverShareOptionsModel.FallbackPolicy = core.StringPtr("fail")
				failoverShareOptionsModel.Timeout = core.Int64Ptr(int64(600))
				failoverShareOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.FailoverShare(failoverShareOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the FailoverShareOptions model with no property values
				failoverShareOptionsModelNew := new(vpcv1.FailoverShareOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.FailoverShare(failoverShareOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListShareMountTargets(listShareMountTargetsOptions *ListShareMountTargetsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listShareMountTargetsPath := "/shares/testString/mount_targets"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareMountTargetsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListShareMountTargets with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListShareMountTargetsOptions model
				listShareMountTargetsOptionsModel := new(vpcv1.ListShareMountTargetsOptions)
				listShareMountTargetsOptionsModel.ShareID = core.StringPtr("testString")
				listShareMountTargetsOptionsModel.Name = core.StringPtr("my-name")
				listShareMountTargetsOptionsModel.Start = core.StringPtr("testString")
				listShareMountTargetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareMountTargetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListShareMountTargets(listShareMountTargetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListShareMountTargets(listShareMountTargetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListShareMountTargets(listShareMountTargetsOptions *ListShareMountTargetsOptions)`, func() {
		version := "2024-06-23"
		listShareMountTargetsPath := "/shares/testString/mount_targets"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareMountTargetsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "access_protocol": "nfs4", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListShareMountTargets successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListShareMountTargetsOptions model
				listShareMountTargetsOptionsModel := new(vpcv1.ListShareMountTargetsOptions)
				listShareMountTargetsOptionsModel.ShareID = core.StringPtr("testString")
				listShareMountTargetsOptionsModel.Name = core.StringPtr("my-name")
				listShareMountTargetsOptionsModel.Start = core.StringPtr("testString")
				listShareMountTargetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareMountTargetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListShareMountTargetsWithContext(ctx, listShareMountTargetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListShareMountTargets(listShareMountTargetsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListShareMountTargetsWithContext(ctx, listShareMountTargetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareMountTargetsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "access_protocol": "nfs4", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListShareMountTargets successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListShareMountTargets(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListShareMountTargetsOptions model
				listShareMountTargetsOptionsModel := new(vpcv1.ListShareMountTargetsOptions)
				listShareMountTargetsOptionsModel.ShareID = core.StringPtr("testString")
				listShareMountTargetsOptionsModel.Name = core.StringPtr("my-name")
				listShareMountTargetsOptionsModel.Start = core.StringPtr("testString")
				listShareMountTargetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareMountTargetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListShareMountTargets(listShareMountTargetsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListShareMountTargets with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListShareMountTargetsOptions model
				listShareMountTargetsOptionsModel := new(vpcv1.ListShareMountTargetsOptions)
				listShareMountTargetsOptionsModel.ShareID = core.StringPtr("testString")
				listShareMountTargetsOptionsModel.Name = core.StringPtr("my-name")
				listShareMountTargetsOptionsModel.Start = core.StringPtr("testString")
				listShareMountTargetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareMountTargetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListShareMountTargets(listShareMountTargetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListShareMountTargetsOptions model with no property values
				listShareMountTargetsOptionsModelNew := new(vpcv1.ListShareMountTargetsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListShareMountTargets(listShareMountTargetsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListShareMountTargets successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListShareMountTargetsOptions model
				listShareMountTargetsOptionsModel := new(vpcv1.ListShareMountTargetsOptions)
				listShareMountTargetsOptionsModel.ShareID = core.StringPtr("testString")
				listShareMountTargetsOptionsModel.Name = core.StringPtr("my-name")
				listShareMountTargetsOptionsModel.Start = core.StringPtr("testString")
				listShareMountTargetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareMountTargetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListShareMountTargets(listShareMountTargetsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ShareMountTargetCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ShareMountTargetCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ShareMountTargetCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareMountTargetsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","access_protocol":"nfs4","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1","id":"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","access_protocol":"nfs4","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1","id":"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use ShareMountTargetsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listShareMountTargetsOptionsModel := &vpcv1.ListShareMountTargetsOptions{
					ShareID: core.StringPtr("testString"),
					Name:    core.StringPtr("my-name"),
					Limit:   core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewShareMountTargetsPager(listShareMountTargetsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.ShareMountTarget
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use ShareMountTargetsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listShareMountTargetsOptionsModel := &vpcv1.ListShareMountTargetsOptions{
					ShareID: core.StringPtr("testString"),
					Name:    core.StringPtr("my-name"),
					Limit:   core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewShareMountTargetsPager(listShareMountTargetsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateShareMountTarget(createShareMountTargetOptions *CreateShareMountTargetOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createShareMountTargetPath := "/shares/testString/mount_targets"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createShareMountTargetPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateShareMountTarget with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
				shareMountTargetVirtualNetworkInterfacePrototypeModel := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AutoDelete = core.BoolPtr(false)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Name = core.StringPtr("my-virtual-network-interface")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
				shareMountTargetPrototypeModel := new(vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup)
				shareMountTargetPrototypeModel.AccessProtocol = core.StringPtr("nfs4")
				shareMountTargetPrototypeModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPrototypeModel.TransitEncryption = core.StringPtr("none")
				shareMountTargetPrototypeModel.VirtualNetworkInterface = shareMountTargetVirtualNetworkInterfacePrototypeModel

				// Construct an instance of the CreateShareMountTargetOptions model
				createShareMountTargetOptionsModel := new(vpcv1.CreateShareMountTargetOptions)
				createShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				createShareMountTargetOptionsModel.ShareMountTargetPrototype = shareMountTargetPrototypeModel
				createShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateShareMountTarget(createShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateShareMountTarget(createShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateShareMountTarget(createShareMountTargetOptions *CreateShareMountTargetOptions)`, func() {
		version := "2024-06-23"
		createShareMountTargetPath := "/shares/testString/mount_targets"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createShareMountTargetPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "access_protocol": "nfs4", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateShareMountTarget successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
				shareMountTargetVirtualNetworkInterfacePrototypeModel := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AutoDelete = core.BoolPtr(false)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Name = core.StringPtr("my-virtual-network-interface")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
				shareMountTargetPrototypeModel := new(vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup)
				shareMountTargetPrototypeModel.AccessProtocol = core.StringPtr("nfs4")
				shareMountTargetPrototypeModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPrototypeModel.TransitEncryption = core.StringPtr("none")
				shareMountTargetPrototypeModel.VirtualNetworkInterface = shareMountTargetVirtualNetworkInterfacePrototypeModel

				// Construct an instance of the CreateShareMountTargetOptions model
				createShareMountTargetOptionsModel := new(vpcv1.CreateShareMountTargetOptions)
				createShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				createShareMountTargetOptionsModel.ShareMountTargetPrototype = shareMountTargetPrototypeModel
				createShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateShareMountTargetWithContext(ctx, createShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateShareMountTarget(createShareMountTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateShareMountTargetWithContext(ctx, createShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createShareMountTargetPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "access_protocol": "nfs4", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateShareMountTarget successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateShareMountTarget(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
				shareMountTargetVirtualNetworkInterfacePrototypeModel := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AutoDelete = core.BoolPtr(false)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Name = core.StringPtr("my-virtual-network-interface")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
				shareMountTargetPrototypeModel := new(vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup)
				shareMountTargetPrototypeModel.AccessProtocol = core.StringPtr("nfs4")
				shareMountTargetPrototypeModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPrototypeModel.TransitEncryption = core.StringPtr("none")
				shareMountTargetPrototypeModel.VirtualNetworkInterface = shareMountTargetVirtualNetworkInterfacePrototypeModel

				// Construct an instance of the CreateShareMountTargetOptions model
				createShareMountTargetOptionsModel := new(vpcv1.CreateShareMountTargetOptions)
				createShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				createShareMountTargetOptionsModel.ShareMountTargetPrototype = shareMountTargetPrototypeModel
				createShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateShareMountTarget(createShareMountTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateShareMountTarget with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
				shareMountTargetVirtualNetworkInterfacePrototypeModel := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AutoDelete = core.BoolPtr(false)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Name = core.StringPtr("my-virtual-network-interface")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
				shareMountTargetPrototypeModel := new(vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup)
				shareMountTargetPrototypeModel.AccessProtocol = core.StringPtr("nfs4")
				shareMountTargetPrototypeModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPrototypeModel.TransitEncryption = core.StringPtr("none")
				shareMountTargetPrototypeModel.VirtualNetworkInterface = shareMountTargetVirtualNetworkInterfacePrototypeModel

				// Construct an instance of the CreateShareMountTargetOptions model
				createShareMountTargetOptionsModel := new(vpcv1.CreateShareMountTargetOptions)
				createShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				createShareMountTargetOptionsModel.ShareMountTargetPrototype = shareMountTargetPrototypeModel
				createShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateShareMountTarget(createShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateShareMountTargetOptions model with no property values
				createShareMountTargetOptionsModelNew := new(vpcv1.CreateShareMountTargetOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateShareMountTarget(createShareMountTargetOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateShareMountTarget successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
				shareMountTargetVirtualNetworkInterfacePrototypeModel := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AutoDelete = core.BoolPtr(false)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Name = core.StringPtr("my-virtual-network-interface")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel

				// Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
				shareMountTargetPrototypeModel := new(vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup)
				shareMountTargetPrototypeModel.AccessProtocol = core.StringPtr("nfs4")
				shareMountTargetPrototypeModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPrototypeModel.TransitEncryption = core.StringPtr("none")
				shareMountTargetPrototypeModel.VirtualNetworkInterface = shareMountTargetVirtualNetworkInterfacePrototypeModel

				// Construct an instance of the CreateShareMountTargetOptions model
				createShareMountTargetOptionsModel := new(vpcv1.CreateShareMountTargetOptions)
				createShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				createShareMountTargetOptionsModel.ShareMountTargetPrototype = shareMountTargetPrototypeModel
				createShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateShareMountTarget(createShareMountTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteShareMountTarget(deleteShareMountTargetOptions *DeleteShareMountTargetOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deleteShareMountTargetPath := "/shares/testString/mount_targets/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteShareMountTargetPath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeleteShareMountTarget with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteShareMountTargetOptions model
				deleteShareMountTargetOptionsModel := new(vpcv1.DeleteShareMountTargetOptions)
				deleteShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				deleteShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				deleteShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeleteShareMountTarget(deleteShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeleteShareMountTarget(deleteShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteShareMountTarget(deleteShareMountTargetOptions *DeleteShareMountTargetOptions)`, func() {
		version := "2024-06-23"
		deleteShareMountTargetPath := "/shares/testString/mount_targets/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteShareMountTargetPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "access_protocol": "nfs4", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke DeleteShareMountTarget successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeleteShareMountTargetOptions model
				deleteShareMountTargetOptionsModel := new(vpcv1.DeleteShareMountTargetOptions)
				deleteShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				deleteShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				deleteShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeleteShareMountTargetWithContext(ctx, deleteShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeleteShareMountTarget(deleteShareMountTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeleteShareMountTargetWithContext(ctx, deleteShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteShareMountTargetPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "access_protocol": "nfs4", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke DeleteShareMountTarget successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeleteShareMountTarget(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeleteShareMountTargetOptions model
				deleteShareMountTargetOptionsModel := new(vpcv1.DeleteShareMountTargetOptions)
				deleteShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				deleteShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				deleteShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeleteShareMountTarget(deleteShareMountTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeleteShareMountTarget with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteShareMountTargetOptions model
				deleteShareMountTargetOptionsModel := new(vpcv1.DeleteShareMountTargetOptions)
				deleteShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				deleteShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				deleteShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeleteShareMountTarget(deleteShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeleteShareMountTargetOptions model with no property values
				deleteShareMountTargetOptionsModelNew := new(vpcv1.DeleteShareMountTargetOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeleteShareMountTarget(deleteShareMountTargetOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteShareMountTarget successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteShareMountTargetOptions model
				deleteShareMountTargetOptionsModel := new(vpcv1.DeleteShareMountTargetOptions)
				deleteShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				deleteShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				deleteShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeleteShareMountTarget(deleteShareMountTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetShareMountTarget(getShareMountTargetOptions *GetShareMountTargetOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getShareMountTargetPath := "/shares/testString/mount_targets/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareMountTargetPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetShareMountTarget with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareMountTargetOptions model
				getShareMountTargetOptionsModel := new(vpcv1.GetShareMountTargetOptions)
				getShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				getShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				getShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetShareMountTarget(getShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetShareMountTarget(getShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetShareMountTarget(getShareMountTargetOptions *GetShareMountTargetOptions)`, func() {
		version := "2024-06-23"
		getShareMountTargetPath := "/shares/testString/mount_targets/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareMountTargetPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "access_protocol": "nfs4", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetShareMountTarget successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetShareMountTargetOptions model
				getShareMountTargetOptionsModel := new(vpcv1.GetShareMountTargetOptions)
				getShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				getShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				getShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetShareMountTargetWithContext(ctx, getShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetShareMountTarget(getShareMountTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetShareMountTargetWithContext(ctx, getShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareMountTargetPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "access_protocol": "nfs4", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetShareMountTarget successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetShareMountTarget(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetShareMountTargetOptions model
				getShareMountTargetOptionsModel := new(vpcv1.GetShareMountTargetOptions)
				getShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				getShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				getShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetShareMountTarget(getShareMountTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetShareMountTarget with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareMountTargetOptions model
				getShareMountTargetOptionsModel := new(vpcv1.GetShareMountTargetOptions)
				getShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				getShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				getShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetShareMountTarget(getShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetShareMountTargetOptions model with no property values
				getShareMountTargetOptionsModelNew := new(vpcv1.GetShareMountTargetOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetShareMountTarget(getShareMountTargetOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetShareMountTarget successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareMountTargetOptions model
				getShareMountTargetOptionsModel := new(vpcv1.GetShareMountTargetOptions)
				getShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				getShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				getShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetShareMountTarget(getShareMountTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateShareMountTarget(updateShareMountTargetOptions *UpdateShareMountTargetOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateShareMountTargetPath := "/shares/testString/mount_targets/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateShareMountTargetPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateShareMountTarget with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ShareMountTargetPatch model
				shareMountTargetPatchModel := new(vpcv1.ShareMountTargetPatch)
				shareMountTargetPatchModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPatchModelAsPatch, asPatchErr := shareMountTargetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareMountTargetOptions model
				updateShareMountTargetOptionsModel := new(vpcv1.UpdateShareMountTargetOptions)
				updateShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				updateShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				updateShareMountTargetOptionsModel.ShareMountTargetPatch = shareMountTargetPatchModelAsPatch
				updateShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateShareMountTarget(updateShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateShareMountTarget(updateShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateShareMountTarget(updateShareMountTargetOptions *UpdateShareMountTargetOptions)`, func() {
		version := "2024-06-23"
		updateShareMountTargetPath := "/shares/testString/mount_targets/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateShareMountTargetPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "access_protocol": "nfs4", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateShareMountTarget successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ShareMountTargetPatch model
				shareMountTargetPatchModel := new(vpcv1.ShareMountTargetPatch)
				shareMountTargetPatchModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPatchModelAsPatch, asPatchErr := shareMountTargetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareMountTargetOptions model
				updateShareMountTargetOptionsModel := new(vpcv1.UpdateShareMountTargetOptions)
				updateShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				updateShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				updateShareMountTargetOptionsModel.ShareMountTargetPatch = shareMountTargetPatchModelAsPatch
				updateShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateShareMountTargetWithContext(ctx, updateShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateShareMountTarget(updateShareMountTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateShareMountTargetWithContext(ctx, updateShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateShareMountTargetPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"access_control_mode": "security_group", "access_protocol": "nfs4", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateShareMountTarget successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateShareMountTarget(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ShareMountTargetPatch model
				shareMountTargetPatchModel := new(vpcv1.ShareMountTargetPatch)
				shareMountTargetPatchModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPatchModelAsPatch, asPatchErr := shareMountTargetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareMountTargetOptions model
				updateShareMountTargetOptionsModel := new(vpcv1.UpdateShareMountTargetOptions)
				updateShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				updateShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				updateShareMountTargetOptionsModel.ShareMountTargetPatch = shareMountTargetPatchModelAsPatch
				updateShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateShareMountTarget(updateShareMountTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateShareMountTarget with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ShareMountTargetPatch model
				shareMountTargetPatchModel := new(vpcv1.ShareMountTargetPatch)
				shareMountTargetPatchModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPatchModelAsPatch, asPatchErr := shareMountTargetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareMountTargetOptions model
				updateShareMountTargetOptionsModel := new(vpcv1.UpdateShareMountTargetOptions)
				updateShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				updateShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				updateShareMountTargetOptionsModel.ShareMountTargetPatch = shareMountTargetPatchModelAsPatch
				updateShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateShareMountTarget(updateShareMountTargetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateShareMountTargetOptions model with no property values
				updateShareMountTargetOptionsModelNew := new(vpcv1.UpdateShareMountTargetOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateShareMountTarget(updateShareMountTargetOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateShareMountTarget successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ShareMountTargetPatch model
				shareMountTargetPatchModel := new(vpcv1.ShareMountTargetPatch)
				shareMountTargetPatchModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPatchModelAsPatch, asPatchErr := shareMountTargetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareMountTargetOptions model
				updateShareMountTargetOptionsModel := new(vpcv1.UpdateShareMountTargetOptions)
				updateShareMountTargetOptionsModel.ShareID = core.StringPtr("testString")
				updateShareMountTargetOptionsModel.ID = core.StringPtr("testString")
				updateShareMountTargetOptionsModel.ShareMountTargetPatch = shareMountTargetPatchModelAsPatch
				updateShareMountTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateShareMountTarget(updateShareMountTargetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListShareSnapshots(listShareSnapshotsOptions *ListShareSnapshotsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listShareSnapshotsPath := "/shares/testString/snapshots"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareSnapshotsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["backup_policy_plan.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListShareSnapshots with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListShareSnapshotsOptions model
				listShareSnapshotsOptionsModel := new(vpcv1.ListShareSnapshotsOptions)
				listShareSnapshotsOptionsModel.ShareID = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.Name = core.StringPtr("my-name")
				listShareSnapshotsOptionsModel.Start = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareSnapshotsOptionsModel.Sort = core.StringPtr("name")
				listShareSnapshotsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListShareSnapshots(listShareSnapshotsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListShareSnapshots(listShareSnapshotsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListShareSnapshots(listShareSnapshotsOptions *ListShareSnapshotsOptions)`, func() {
		version := "2024-06-23"
		listShareSnapshotsPath := "/shares/testString/snapshots"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareSnapshotsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["backup_policy_plan.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "snapshots": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "fingerprint": "7abc3aef-c2bc-4f65-a296-2928e534d498", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "minimum_size": 10, "name": "my-share-snapshot", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share_snapshot", "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListShareSnapshots successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListShareSnapshotsOptions model
				listShareSnapshotsOptionsModel := new(vpcv1.ListShareSnapshotsOptions)
				listShareSnapshotsOptionsModel.ShareID = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.Name = core.StringPtr("my-name")
				listShareSnapshotsOptionsModel.Start = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareSnapshotsOptionsModel.Sort = core.StringPtr("name")
				listShareSnapshotsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListShareSnapshotsWithContext(ctx, listShareSnapshotsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListShareSnapshots(listShareSnapshotsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListShareSnapshotsWithContext(ctx, listShareSnapshotsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareSnapshotsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["backup_policy_plan.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "snapshots": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "fingerprint": "7abc3aef-c2bc-4f65-a296-2928e534d498", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "minimum_size": 10, "name": "my-share-snapshot", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share_snapshot", "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListShareSnapshots successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListShareSnapshots(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListShareSnapshotsOptions model
				listShareSnapshotsOptionsModel := new(vpcv1.ListShareSnapshotsOptions)
				listShareSnapshotsOptionsModel.ShareID = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.Name = core.StringPtr("my-name")
				listShareSnapshotsOptionsModel.Start = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareSnapshotsOptionsModel.Sort = core.StringPtr("name")
				listShareSnapshotsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListShareSnapshots(listShareSnapshotsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListShareSnapshots with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListShareSnapshotsOptions model
				listShareSnapshotsOptionsModel := new(vpcv1.ListShareSnapshotsOptions)
				listShareSnapshotsOptionsModel.ShareID = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.Name = core.StringPtr("my-name")
				listShareSnapshotsOptionsModel.Start = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareSnapshotsOptionsModel.Sort = core.StringPtr("name")
				listShareSnapshotsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListShareSnapshots(listShareSnapshotsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListShareSnapshotsOptions model with no property values
				listShareSnapshotsOptionsModelNew := new(vpcv1.ListShareSnapshotsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListShareSnapshots(listShareSnapshotsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListShareSnapshots successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListShareSnapshotsOptions model
				listShareSnapshotsOptionsModel := new(vpcv1.ListShareSnapshotsOptions)
				listShareSnapshotsOptionsModel.ShareID = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.Name = core.StringPtr("my-name")
				listShareSnapshotsOptionsModel.Start = core.StringPtr("testString")
				listShareSnapshotsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listShareSnapshotsOptionsModel.Sort = core.StringPtr("name")
				listShareSnapshotsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListShareSnapshots(listShareSnapshotsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ShareSnapshotCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ShareSnapshotCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ShareSnapshotCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listShareSnapshotsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"captured_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4","fingerprint":"7abc3aef-c2bc-4f65-a296-2928e534d498","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4","id":"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","minimum_size":10,"name":"my-share-snapshot","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share_snapshot","status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"Message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["UserTags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"captured_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4","fingerprint":"7abc3aef-c2bc-4f65-a296-2928e534d498","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4","id":"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","minimum_size":10,"name":"my-share-snapshot","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share_snapshot","status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"Message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["UserTags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use ShareSnapshotsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listShareSnapshotsOptionsModel := &vpcv1.ListShareSnapshotsOptions{
					ShareID:            core.StringPtr("testString"),
					BackupPolicyPlanID: core.StringPtr("testString"),
					Name:               core.StringPtr("my-name"),
					Limit:              core.Int64Ptr(int64(10)),
					Sort:               core.StringPtr("name"),
				}

				pager, err := vpcService.NewShareSnapshotsPager(listShareSnapshotsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.ShareSnapshot
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use ShareSnapshotsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listShareSnapshotsOptionsModel := &vpcv1.ListShareSnapshotsOptions{
					ShareID:            core.StringPtr("testString"),
					BackupPolicyPlanID: core.StringPtr("testString"),
					Name:               core.StringPtr("my-name"),
					Limit:              core.Int64Ptr(int64(10)),
					Sort:               core.StringPtr("name"),
				}

				pager, err := vpcService.NewShareSnapshotsPager(listShareSnapshotsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateShareSnapshot(createShareSnapshotOptions *CreateShareSnapshotOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createShareSnapshotPath := "/shares/testString/snapshots"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createShareSnapshotPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateShareSnapshot with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateShareSnapshotOptions model
				createShareSnapshotOptionsModel := new(vpcv1.CreateShareSnapshotOptions)
				createShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				createShareSnapshotOptionsModel.Name = core.StringPtr("my-share-snapshot")
				createShareSnapshotOptionsModel.UserTags = []string{"testString"}
				createShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateShareSnapshot(createShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateShareSnapshot(createShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateShareSnapshot(createShareSnapshotOptions *CreateShareSnapshotOptions)`, func() {
		version := "2024-06-23"
		createShareSnapshotPath := "/shares/testString/snapshots"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createShareSnapshotPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "fingerprint": "7abc3aef-c2bc-4f65-a296-2928e534d498", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "minimum_size": 10, "name": "my-share-snapshot", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share_snapshot", "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateShareSnapshot successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the CreateShareSnapshotOptions model
				createShareSnapshotOptionsModel := new(vpcv1.CreateShareSnapshotOptions)
				createShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				createShareSnapshotOptionsModel.Name = core.StringPtr("my-share-snapshot")
				createShareSnapshotOptionsModel.UserTags = []string{"testString"}
				createShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateShareSnapshotWithContext(ctx, createShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateShareSnapshot(createShareSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateShareSnapshotWithContext(ctx, createShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createShareSnapshotPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "fingerprint": "7abc3aef-c2bc-4f65-a296-2928e534d498", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "minimum_size": 10, "name": "my-share-snapshot", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share_snapshot", "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateShareSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateShareSnapshot(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the CreateShareSnapshotOptions model
				createShareSnapshotOptionsModel := new(vpcv1.CreateShareSnapshotOptions)
				createShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				createShareSnapshotOptionsModel.Name = core.StringPtr("my-share-snapshot")
				createShareSnapshotOptionsModel.UserTags = []string{"testString"}
				createShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateShareSnapshot(createShareSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateShareSnapshot with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateShareSnapshotOptions model
				createShareSnapshotOptionsModel := new(vpcv1.CreateShareSnapshotOptions)
				createShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				createShareSnapshotOptionsModel.Name = core.StringPtr("my-share-snapshot")
				createShareSnapshotOptionsModel.UserTags = []string{"testString"}
				createShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateShareSnapshot(createShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateShareSnapshotOptions model with no property values
				createShareSnapshotOptionsModelNew := new(vpcv1.CreateShareSnapshotOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateShareSnapshot(createShareSnapshotOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateShareSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateShareSnapshotOptions model
				createShareSnapshotOptionsModel := new(vpcv1.CreateShareSnapshotOptions)
				createShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				createShareSnapshotOptionsModel.Name = core.StringPtr("my-share-snapshot")
				createShareSnapshotOptionsModel.UserTags = []string{"testString"}
				createShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateShareSnapshot(createShareSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteShareSnapshot(deleteShareSnapshotOptions *DeleteShareSnapshotOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deleteShareSnapshotPath := "/shares/testString/snapshots/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteShareSnapshotPath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeleteShareSnapshot with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteShareSnapshotOptions model
				deleteShareSnapshotOptionsModel := new(vpcv1.DeleteShareSnapshotOptions)
				deleteShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				deleteShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				deleteShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeleteShareSnapshot(deleteShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeleteShareSnapshot(deleteShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteShareSnapshot(deleteShareSnapshotOptions *DeleteShareSnapshotOptions)`, func() {
		version := "2024-06-23"
		deleteShareSnapshotPath := "/shares/testString/snapshots/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteShareSnapshotPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "fingerprint": "7abc3aef-c2bc-4f65-a296-2928e534d498", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "minimum_size": 10, "name": "my-share-snapshot", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share_snapshot", "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke DeleteShareSnapshot successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeleteShareSnapshotOptions model
				deleteShareSnapshotOptionsModel := new(vpcv1.DeleteShareSnapshotOptions)
				deleteShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				deleteShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				deleteShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeleteShareSnapshotWithContext(ctx, deleteShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeleteShareSnapshot(deleteShareSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeleteShareSnapshotWithContext(ctx, deleteShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteShareSnapshotPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "fingerprint": "7abc3aef-c2bc-4f65-a296-2928e534d498", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "minimum_size": 10, "name": "my-share-snapshot", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share_snapshot", "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke DeleteShareSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeleteShareSnapshot(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeleteShareSnapshotOptions model
				deleteShareSnapshotOptionsModel := new(vpcv1.DeleteShareSnapshotOptions)
				deleteShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				deleteShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				deleteShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeleteShareSnapshot(deleteShareSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeleteShareSnapshot with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteShareSnapshotOptions model
				deleteShareSnapshotOptionsModel := new(vpcv1.DeleteShareSnapshotOptions)
				deleteShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				deleteShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				deleteShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeleteShareSnapshot(deleteShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeleteShareSnapshotOptions model with no property values
				deleteShareSnapshotOptionsModelNew := new(vpcv1.DeleteShareSnapshotOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeleteShareSnapshot(deleteShareSnapshotOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteShareSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteShareSnapshotOptions model
				deleteShareSnapshotOptionsModel := new(vpcv1.DeleteShareSnapshotOptions)
				deleteShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				deleteShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				deleteShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeleteShareSnapshot(deleteShareSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetShareSnapshot(getShareSnapshotOptions *GetShareSnapshotOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getShareSnapshotPath := "/shares/testString/snapshots/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareSnapshotPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetShareSnapshot with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareSnapshotOptions model
				getShareSnapshotOptionsModel := new(vpcv1.GetShareSnapshotOptions)
				getShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				getShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				getShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetShareSnapshot(getShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetShareSnapshot(getShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetShareSnapshot(getShareSnapshotOptions *GetShareSnapshotOptions)`, func() {
		version := "2024-06-23"
		getShareSnapshotPath := "/shares/testString/snapshots/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareSnapshotPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "fingerprint": "7abc3aef-c2bc-4f65-a296-2928e534d498", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "minimum_size": 10, "name": "my-share-snapshot", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share_snapshot", "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetShareSnapshot successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetShareSnapshotOptions model
				getShareSnapshotOptionsModel := new(vpcv1.GetShareSnapshotOptions)
				getShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				getShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				getShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetShareSnapshotWithContext(ctx, getShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetShareSnapshot(getShareSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetShareSnapshotWithContext(ctx, getShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareSnapshotPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "fingerprint": "7abc3aef-c2bc-4f65-a296-2928e534d498", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "minimum_size": 10, "name": "my-share-snapshot", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share_snapshot", "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetShareSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetShareSnapshot(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetShareSnapshotOptions model
				getShareSnapshotOptionsModel := new(vpcv1.GetShareSnapshotOptions)
				getShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				getShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				getShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetShareSnapshot(getShareSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetShareSnapshot with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareSnapshotOptions model
				getShareSnapshotOptionsModel := new(vpcv1.GetShareSnapshotOptions)
				getShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				getShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				getShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetShareSnapshot(getShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetShareSnapshotOptions model with no property values
				getShareSnapshotOptionsModelNew := new(vpcv1.GetShareSnapshotOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetShareSnapshot(getShareSnapshotOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetShareSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareSnapshotOptions model
				getShareSnapshotOptionsModel := new(vpcv1.GetShareSnapshotOptions)
				getShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				getShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				getShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetShareSnapshot(getShareSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateShareSnapshot(updateShareSnapshotOptions *UpdateShareSnapshotOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateShareSnapshotPath := "/shares/testString/snapshots/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateShareSnapshotPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/96d225c4-56bd-43d9-98fc-d7148e5c5028")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateShareSnapshot with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ShareSnapshotPatch model
				shareSnapshotPatchModel := new(vpcv1.ShareSnapshotPatch)
				shareSnapshotPatchModel.Name = core.StringPtr("my-share-snapshot")
				shareSnapshotPatchModel.UserTags = []string{"testString"}
				shareSnapshotPatchModelAsPatch, asPatchErr := shareSnapshotPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareSnapshotOptions model
				updateShareSnapshotOptionsModel := new(vpcv1.UpdateShareSnapshotOptions)
				updateShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				updateShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				updateShareSnapshotOptionsModel.ShareSnapshotPatch = shareSnapshotPatchModelAsPatch
				updateShareSnapshotOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				updateShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateShareSnapshot(updateShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateShareSnapshot(updateShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateShareSnapshot(updateShareSnapshotOptions *UpdateShareSnapshotOptions)`, func() {
		version := "2024-06-23"
		updateShareSnapshotPath := "/shares/testString/snapshots/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateShareSnapshotPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/96d225c4-56bd-43d9-98fc-d7148e5c5028")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "fingerprint": "7abc3aef-c2bc-4f65-a296-2928e534d498", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "minimum_size": 10, "name": "my-share-snapshot", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share_snapshot", "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateShareSnapshot successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ShareSnapshotPatch model
				shareSnapshotPatchModel := new(vpcv1.ShareSnapshotPatch)
				shareSnapshotPatchModel.Name = core.StringPtr("my-share-snapshot")
				shareSnapshotPatchModel.UserTags = []string{"testString"}
				shareSnapshotPatchModelAsPatch, asPatchErr := shareSnapshotPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareSnapshotOptions model
				updateShareSnapshotOptionsModel := new(vpcv1.UpdateShareSnapshotOptions)
				updateShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				updateShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				updateShareSnapshotOptionsModel.ShareSnapshotPatch = shareSnapshotPatchModelAsPatch
				updateShareSnapshotOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				updateShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateShareSnapshotWithContext(ctx, updateShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateShareSnapshot(updateShareSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateShareSnapshotWithContext(ctx, updateShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateShareSnapshotPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/96d225c4-56bd-43d9-98fc-d7148e5c5028")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "fingerprint": "7abc3aef-c2bc-4f65-a296-2928e534d498", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "id": "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "minimum_size": 10, "name": "my-share-snapshot", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share_snapshot", "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["UserTags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateShareSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateShareSnapshot(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ShareSnapshotPatch model
				shareSnapshotPatchModel := new(vpcv1.ShareSnapshotPatch)
				shareSnapshotPatchModel.Name = core.StringPtr("my-share-snapshot")
				shareSnapshotPatchModel.UserTags = []string{"testString"}
				shareSnapshotPatchModelAsPatch, asPatchErr := shareSnapshotPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareSnapshotOptions model
				updateShareSnapshotOptionsModel := new(vpcv1.UpdateShareSnapshotOptions)
				updateShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				updateShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				updateShareSnapshotOptionsModel.ShareSnapshotPatch = shareSnapshotPatchModelAsPatch
				updateShareSnapshotOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				updateShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateShareSnapshot(updateShareSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateShareSnapshot with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ShareSnapshotPatch model
				shareSnapshotPatchModel := new(vpcv1.ShareSnapshotPatch)
				shareSnapshotPatchModel.Name = core.StringPtr("my-share-snapshot")
				shareSnapshotPatchModel.UserTags = []string{"testString"}
				shareSnapshotPatchModelAsPatch, asPatchErr := shareSnapshotPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareSnapshotOptions model
				updateShareSnapshotOptionsModel := new(vpcv1.UpdateShareSnapshotOptions)
				updateShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				updateShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				updateShareSnapshotOptionsModel.ShareSnapshotPatch = shareSnapshotPatchModelAsPatch
				updateShareSnapshotOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				updateShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateShareSnapshot(updateShareSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateShareSnapshotOptions model with no property values
				updateShareSnapshotOptionsModelNew := new(vpcv1.UpdateShareSnapshotOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateShareSnapshot(updateShareSnapshotOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateShareSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ShareSnapshotPatch model
				shareSnapshotPatchModel := new(vpcv1.ShareSnapshotPatch)
				shareSnapshotPatchModel.Name = core.StringPtr("my-share-snapshot")
				shareSnapshotPatchModel.UserTags = []string{"testString"}
				shareSnapshotPatchModelAsPatch, asPatchErr := shareSnapshotPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateShareSnapshotOptions model
				updateShareSnapshotOptionsModel := new(vpcv1.UpdateShareSnapshotOptions)
				updateShareSnapshotOptionsModel.ShareID = core.StringPtr("testString")
				updateShareSnapshotOptionsModel.ID = core.StringPtr("testString")
				updateShareSnapshotOptionsModel.ShareSnapshotPatch = shareSnapshotPatchModelAsPatch
				updateShareSnapshotOptionsModel.IfMatch = core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				updateShareSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateShareSnapshot(updateShareSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteShareSource(deleteShareSourceOptions *DeleteShareSourceOptions)`, func() {
		version := "2024-06-23"
		deleteShareSourcePath := "/shares/testString/source"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteShareSourcePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteShareSource successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteShareSource(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteShareSourceOptions model
				deleteShareSourceOptionsModel := new(vpcv1.DeleteShareSourceOptions)
				deleteShareSourceOptionsModel.ShareID = core.StringPtr("testString")
				deleteShareSourceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteShareSource(deleteShareSourceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteShareSource with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteShareSourceOptions model
				deleteShareSourceOptionsModel := new(vpcv1.DeleteShareSourceOptions)
				deleteShareSourceOptionsModel.ShareID = core.StringPtr("testString")
				deleteShareSourceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteShareSource(deleteShareSourceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteShareSourceOptions model with no property values
				deleteShareSourceOptionsModelNew := new(vpcv1.DeleteShareSourceOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteShareSource(deleteShareSourceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetShareSource(getShareSourceOptions *GetShareSourceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getShareSourcePath := "/shares/testString/source"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareSourcePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetShareSource with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareSourceOptions model
				getShareSourceOptionsModel := new(vpcv1.GetShareSourceOptions)
				getShareSourceOptionsModel.ShareID = core.StringPtr("testString")
				getShareSourceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetShareSource(getShareSourceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetShareSource(getShareSourceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetShareSource(getShareSourceOptions *GetShareSourceOptions)`, func() {
		version := "2024-06-23"
		getShareSourcePath := "/shares/testString/source"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareSourcePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}`)
				}))
			})
			It(`Invoke GetShareSource successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetShareSourceOptions model
				getShareSourceOptionsModel := new(vpcv1.GetShareSourceOptions)
				getShareSourceOptionsModel.ShareID = core.StringPtr("testString")
				getShareSourceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetShareSourceWithContext(ctx, getShareSourceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetShareSource(getShareSourceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetShareSourceWithContext(ctx, getShareSourceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getShareSourcePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}`)
				}))
			})
			It(`Invoke GetShareSource successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetShareSource(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetShareSourceOptions model
				getShareSourceOptionsModel := new(vpcv1.GetShareSourceOptions)
				getShareSourceOptionsModel.ShareID = core.StringPtr("testString")
				getShareSourceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetShareSource(getShareSourceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetShareSource with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareSourceOptions model
				getShareSourceOptionsModel := new(vpcv1.GetShareSourceOptions)
				getShareSourceOptionsModel.ShareID = core.StringPtr("testString")
				getShareSourceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetShareSource(getShareSourceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetShareSourceOptions model with no property values
				getShareSourceOptionsModelNew := new(vpcv1.GetShareSourceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetShareSource(getShareSourceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetShareSource successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetShareSourceOptions model
				getShareSourceOptionsModel := new(vpcv1.GetShareSourceOptions)
				getShareSourceOptionsModel.ShareID = core.StringPtr("testString")
				getShareSourceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetShareSource(getShareSourceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSnapshotConsistencyGroups(listSnapshotConsistencyGroupsOptions *ListSnapshotConsistencyGroupsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listSnapshotConsistencyGroupsPath := "/snapshot_consistency_groups"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotConsistencyGroupsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["backup_policy_plan.id"]).To(Equal([]string{"testString"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListSnapshotConsistencyGroups with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSnapshotConsistencyGroupsOptions model
				listSnapshotConsistencyGroupsOptionsModel := new(vpcv1.ListSnapshotConsistencyGroupsOptions)
				listSnapshotConsistencyGroupsOptionsModel.Start = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotConsistencyGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Name = core.StringPtr("my-name")
				listSnapshotConsistencyGroupsOptionsModel.Sort = core.StringPtr("name")
				listSnapshotConsistencyGroupsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListSnapshotConsistencyGroups(listSnapshotConsistencyGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListSnapshotConsistencyGroups(listSnapshotConsistencyGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSnapshotConsistencyGroups(listSnapshotConsistencyGroupsOptions *ListSnapshotConsistencyGroupsOptions)`, func() {
		version := "2024-06-23"
		listSnapshotConsistencyGroupsPath := "/snapshot_consistency_groups"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotConsistencyGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["backup_policy_plan.id"]).To(Equal([]string{"testString"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "snapshot_consistency_groups": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["ServiceTags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListSnapshotConsistencyGroups successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListSnapshotConsistencyGroupsOptions model
				listSnapshotConsistencyGroupsOptionsModel := new(vpcv1.ListSnapshotConsistencyGroupsOptions)
				listSnapshotConsistencyGroupsOptionsModel.Start = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotConsistencyGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Name = core.StringPtr("my-name")
				listSnapshotConsistencyGroupsOptionsModel.Sort = core.StringPtr("name")
				listSnapshotConsistencyGroupsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListSnapshotConsistencyGroupsWithContext(ctx, listSnapshotConsistencyGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListSnapshotConsistencyGroups(listSnapshotConsistencyGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListSnapshotConsistencyGroupsWithContext(ctx, listSnapshotConsistencyGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotConsistencyGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["backup_policy_plan.id"]).To(Equal([]string{"testString"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "snapshot_consistency_groups": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["ServiceTags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListSnapshotConsistencyGroups successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListSnapshotConsistencyGroups(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListSnapshotConsistencyGroupsOptions model
				listSnapshotConsistencyGroupsOptionsModel := new(vpcv1.ListSnapshotConsistencyGroupsOptions)
				listSnapshotConsistencyGroupsOptionsModel.Start = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotConsistencyGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Name = core.StringPtr("my-name")
				listSnapshotConsistencyGroupsOptionsModel.Sort = core.StringPtr("name")
				listSnapshotConsistencyGroupsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListSnapshotConsistencyGroups(listSnapshotConsistencyGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListSnapshotConsistencyGroups with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSnapshotConsistencyGroupsOptions model
				listSnapshotConsistencyGroupsOptionsModel := new(vpcv1.ListSnapshotConsistencyGroupsOptions)
				listSnapshotConsistencyGroupsOptionsModel.Start = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotConsistencyGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Name = core.StringPtr("my-name")
				listSnapshotConsistencyGroupsOptionsModel.Sort = core.StringPtr("name")
				listSnapshotConsistencyGroupsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListSnapshotConsistencyGroups(listSnapshotConsistencyGroupsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListSnapshotConsistencyGroups successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSnapshotConsistencyGroupsOptions model
				listSnapshotConsistencyGroupsOptionsModel := new(vpcv1.ListSnapshotConsistencyGroupsOptions)
				listSnapshotConsistencyGroupsOptionsModel.Start = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotConsistencyGroupsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Name = core.StringPtr("my-name")
				listSnapshotConsistencyGroupsOptionsModel.Sort = core.StringPtr("name")
				listSnapshotConsistencyGroupsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listSnapshotConsistencyGroupsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListSnapshotConsistencyGroups(listSnapshotConsistencyGroupsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.SnapshotConsistencyGroupCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.SnapshotConsistencyGroupCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.SnapshotConsistencyGroupCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotConsistencyGroupsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"snapshot_consistency_groups":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263","delete_snapshots_on_delete":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r006-fa329f6b-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","name":"my-snapshot-consistency-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot_consistency_group","service_tags":["ServiceTags"],"snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r006-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"snapshot_consistency_groups":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263","delete_snapshots_on_delete":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r006-fa329f6b-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","name":"my-snapshot-consistency-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot_consistency_group","service_tags":["ServiceTags"],"snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r006-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use SnapshotConsistencyGroupsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSnapshotConsistencyGroupsOptionsModel := &vpcv1.ListSnapshotConsistencyGroupsOptions{
					Limit:              core.Int64Ptr(int64(10)),
					ResourceGroupID:    core.StringPtr("testString"),
					Name:               core.StringPtr("my-name"),
					Sort:               core.StringPtr("name"),
					BackupPolicyPlanID: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewSnapshotConsistencyGroupsPager(listSnapshotConsistencyGroupsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.SnapshotConsistencyGroup
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use SnapshotConsistencyGroupsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSnapshotConsistencyGroupsOptionsModel := &vpcv1.ListSnapshotConsistencyGroupsOptions{
					Limit:              core.Int64Ptr(int64(10)),
					ResourceGroupID:    core.StringPtr("testString"),
					Name:               core.StringPtr("my-name"),
					Sort:               core.StringPtr("name"),
					BackupPolicyPlanID: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewSnapshotConsistencyGroupsPager(listSnapshotConsistencyGroupsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptions *CreateSnapshotConsistencyGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createSnapshotConsistencyGroupPath := "/snapshot_consistency_groups"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSnapshotConsistencyGroupPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateSnapshotConsistencyGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeIdentityByID model
				volumeIdentityModel := new(vpcv1.VolumeIdentityByID)
				volumeIdentityModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the SnapshotPrototypeSnapshotConsistencyGroupContext model
				snapshotPrototypeSnapshotConsistencyGroupContextModel := new(vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext)
				snapshotPrototypeSnapshotConsistencyGroupContextModel.Name = core.StringPtr("my-snapshot")
				snapshotPrototypeSnapshotConsistencyGroupContextModel.SourceVolume = volumeIdentityModel
				snapshotPrototypeSnapshotConsistencyGroupContextModel.UserTags = []string{"testString"}

				// Construct an instance of the SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots model
				snapshotConsistencyGroupPrototypeModel := new(vpcv1.SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots)
				snapshotConsistencyGroupPrototypeModel.DeleteSnapshotsOnDelete = core.BoolPtr(true)
				snapshotConsistencyGroupPrototypeModel.Name = core.StringPtr("my-snapshot-consistency-group")
				snapshotConsistencyGroupPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				snapshotConsistencyGroupPrototypeModel.Snapshots = []vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext{*snapshotPrototypeSnapshotConsistencyGroupContextModel}

				// Construct an instance of the CreateSnapshotConsistencyGroupOptions model
				createSnapshotConsistencyGroupOptionsModel := new(vpcv1.CreateSnapshotConsistencyGroupOptions)
				createSnapshotConsistencyGroupOptionsModel.SnapshotConsistencyGroupPrototype = snapshotConsistencyGroupPrototypeModel
				createSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptions *CreateSnapshotConsistencyGroupOptions)`, func() {
		version := "2024-06-23"
		createSnapshotConsistencyGroupPath := "/snapshot_consistency_groups"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSnapshotConsistencyGroupPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["ServiceTags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}`)
				}))
			})
			It(`Invoke CreateSnapshotConsistencyGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeIdentityByID model
				volumeIdentityModel := new(vpcv1.VolumeIdentityByID)
				volumeIdentityModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the SnapshotPrototypeSnapshotConsistencyGroupContext model
				snapshotPrototypeSnapshotConsistencyGroupContextModel := new(vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext)
				snapshotPrototypeSnapshotConsistencyGroupContextModel.Name = core.StringPtr("my-snapshot")
				snapshotPrototypeSnapshotConsistencyGroupContextModel.SourceVolume = volumeIdentityModel
				snapshotPrototypeSnapshotConsistencyGroupContextModel.UserTags = []string{"testString"}

				// Construct an instance of the SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots model
				snapshotConsistencyGroupPrototypeModel := new(vpcv1.SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots)
				snapshotConsistencyGroupPrototypeModel.DeleteSnapshotsOnDelete = core.BoolPtr(true)
				snapshotConsistencyGroupPrototypeModel.Name = core.StringPtr("my-snapshot-consistency-group")
				snapshotConsistencyGroupPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				snapshotConsistencyGroupPrototypeModel.Snapshots = []vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext{*snapshotPrototypeSnapshotConsistencyGroupContextModel}

				// Construct an instance of the CreateSnapshotConsistencyGroupOptions model
				createSnapshotConsistencyGroupOptionsModel := new(vpcv1.CreateSnapshotConsistencyGroupOptions)
				createSnapshotConsistencyGroupOptionsModel.SnapshotConsistencyGroupPrototype = snapshotConsistencyGroupPrototypeModel
				createSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateSnapshotConsistencyGroupWithContext(ctx, createSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateSnapshotConsistencyGroupWithContext(ctx, createSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSnapshotConsistencyGroupPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["ServiceTags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}`)
				}))
			})
			It(`Invoke CreateSnapshotConsistencyGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateSnapshotConsistencyGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeIdentityByID model
				volumeIdentityModel := new(vpcv1.VolumeIdentityByID)
				volumeIdentityModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the SnapshotPrototypeSnapshotConsistencyGroupContext model
				snapshotPrototypeSnapshotConsistencyGroupContextModel := new(vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext)
				snapshotPrototypeSnapshotConsistencyGroupContextModel.Name = core.StringPtr("my-snapshot")
				snapshotPrototypeSnapshotConsistencyGroupContextModel.SourceVolume = volumeIdentityModel
				snapshotPrototypeSnapshotConsistencyGroupContextModel.UserTags = []string{"testString"}

				// Construct an instance of the SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots model
				snapshotConsistencyGroupPrototypeModel := new(vpcv1.SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots)
				snapshotConsistencyGroupPrototypeModel.DeleteSnapshotsOnDelete = core.BoolPtr(true)
				snapshotConsistencyGroupPrototypeModel.Name = core.StringPtr("my-snapshot-consistency-group")
				snapshotConsistencyGroupPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				snapshotConsistencyGroupPrototypeModel.Snapshots = []vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext{*snapshotPrototypeSnapshotConsistencyGroupContextModel}

				// Construct an instance of the CreateSnapshotConsistencyGroupOptions model
				createSnapshotConsistencyGroupOptionsModel := new(vpcv1.CreateSnapshotConsistencyGroupOptions)
				createSnapshotConsistencyGroupOptionsModel.SnapshotConsistencyGroupPrototype = snapshotConsistencyGroupPrototypeModel
				createSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateSnapshotConsistencyGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeIdentityByID model
				volumeIdentityModel := new(vpcv1.VolumeIdentityByID)
				volumeIdentityModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the SnapshotPrototypeSnapshotConsistencyGroupContext model
				snapshotPrototypeSnapshotConsistencyGroupContextModel := new(vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext)
				snapshotPrototypeSnapshotConsistencyGroupContextModel.Name = core.StringPtr("my-snapshot")
				snapshotPrototypeSnapshotConsistencyGroupContextModel.SourceVolume = volumeIdentityModel
				snapshotPrototypeSnapshotConsistencyGroupContextModel.UserTags = []string{"testString"}

				// Construct an instance of the SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots model
				snapshotConsistencyGroupPrototypeModel := new(vpcv1.SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots)
				snapshotConsistencyGroupPrototypeModel.DeleteSnapshotsOnDelete = core.BoolPtr(true)
				snapshotConsistencyGroupPrototypeModel.Name = core.StringPtr("my-snapshot-consistency-group")
				snapshotConsistencyGroupPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				snapshotConsistencyGroupPrototypeModel.Snapshots = []vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext{*snapshotPrototypeSnapshotConsistencyGroupContextModel}

				// Construct an instance of the CreateSnapshotConsistencyGroupOptions model
				createSnapshotConsistencyGroupOptionsModel := new(vpcv1.CreateSnapshotConsistencyGroupOptions)
				createSnapshotConsistencyGroupOptionsModel.SnapshotConsistencyGroupPrototype = snapshotConsistencyGroupPrototypeModel
				createSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateSnapshotConsistencyGroupOptions model with no property values
				createSnapshotConsistencyGroupOptionsModelNew := new(vpcv1.CreateSnapshotConsistencyGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateSnapshotConsistencyGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeIdentityByID model
				volumeIdentityModel := new(vpcv1.VolumeIdentityByID)
				volumeIdentityModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the SnapshotPrototypeSnapshotConsistencyGroupContext model
				snapshotPrototypeSnapshotConsistencyGroupContextModel := new(vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext)
				snapshotPrototypeSnapshotConsistencyGroupContextModel.Name = core.StringPtr("my-snapshot")
				snapshotPrototypeSnapshotConsistencyGroupContextModel.SourceVolume = volumeIdentityModel
				snapshotPrototypeSnapshotConsistencyGroupContextModel.UserTags = []string{"testString"}

				// Construct an instance of the SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots model
				snapshotConsistencyGroupPrototypeModel := new(vpcv1.SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots)
				snapshotConsistencyGroupPrototypeModel.DeleteSnapshotsOnDelete = core.BoolPtr(true)
				snapshotConsistencyGroupPrototypeModel.Name = core.StringPtr("my-snapshot-consistency-group")
				snapshotConsistencyGroupPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				snapshotConsistencyGroupPrototypeModel.Snapshots = []vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext{*snapshotPrototypeSnapshotConsistencyGroupContextModel}

				// Construct an instance of the CreateSnapshotConsistencyGroupOptions model
				createSnapshotConsistencyGroupOptionsModel := new(vpcv1.CreateSnapshotConsistencyGroupOptions)
				createSnapshotConsistencyGroupOptionsModel.SnapshotConsistencyGroupPrototype = snapshotConsistencyGroupPrototypeModel
				createSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptions *DeleteSnapshotConsistencyGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deleteSnapshotConsistencyGroupPath := "/snapshot_consistency_groups/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteSnapshotConsistencyGroupPath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeleteSnapshotConsistencyGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteSnapshotConsistencyGroupOptions model
				deleteSnapshotConsistencyGroupOptionsModel := new(vpcv1.DeleteSnapshotConsistencyGroupOptions)
				deleteSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				deleteSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptions *DeleteSnapshotConsistencyGroupOptions)`, func() {
		version := "2024-06-23"
		deleteSnapshotConsistencyGroupPath := "/snapshot_consistency_groups/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteSnapshotConsistencyGroupPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["ServiceTags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}`)
				}))
			})
			It(`Invoke DeleteSnapshotConsistencyGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeleteSnapshotConsistencyGroupOptions model
				deleteSnapshotConsistencyGroupOptionsModel := new(vpcv1.DeleteSnapshotConsistencyGroupOptions)
				deleteSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				deleteSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeleteSnapshotConsistencyGroupWithContext(ctx, deleteSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeleteSnapshotConsistencyGroupWithContext(ctx, deleteSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteSnapshotConsistencyGroupPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["ServiceTags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}`)
				}))
			})
			It(`Invoke DeleteSnapshotConsistencyGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeleteSnapshotConsistencyGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeleteSnapshotConsistencyGroupOptions model
				deleteSnapshotConsistencyGroupOptionsModel := new(vpcv1.DeleteSnapshotConsistencyGroupOptions)
				deleteSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				deleteSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeleteSnapshotConsistencyGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteSnapshotConsistencyGroupOptions model
				deleteSnapshotConsistencyGroupOptionsModel := new(vpcv1.DeleteSnapshotConsistencyGroupOptions)
				deleteSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				deleteSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeleteSnapshotConsistencyGroupOptions model with no property values
				deleteSnapshotConsistencyGroupOptionsModelNew := new(vpcv1.DeleteSnapshotConsistencyGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteSnapshotConsistencyGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteSnapshotConsistencyGroupOptions model
				deleteSnapshotConsistencyGroupOptionsModel := new(vpcv1.DeleteSnapshotConsistencyGroupOptions)
				deleteSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				deleteSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptions *GetSnapshotConsistencyGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getSnapshotConsistencyGroupPath := "/snapshot_consistency_groups/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSnapshotConsistencyGroupPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetSnapshotConsistencyGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSnapshotConsistencyGroupOptions model
				getSnapshotConsistencyGroupOptionsModel := new(vpcv1.GetSnapshotConsistencyGroupOptions)
				getSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				getSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptions *GetSnapshotConsistencyGroupOptions)`, func() {
		version := "2024-06-23"
		getSnapshotConsistencyGroupPath := "/snapshot_consistency_groups/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSnapshotConsistencyGroupPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["ServiceTags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}`)
				}))
			})
			It(`Invoke GetSnapshotConsistencyGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetSnapshotConsistencyGroupOptions model
				getSnapshotConsistencyGroupOptionsModel := new(vpcv1.GetSnapshotConsistencyGroupOptions)
				getSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				getSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetSnapshotConsistencyGroupWithContext(ctx, getSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetSnapshotConsistencyGroupWithContext(ctx, getSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSnapshotConsistencyGroupPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["ServiceTags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}`)
				}))
			})
			It(`Invoke GetSnapshotConsistencyGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetSnapshotConsistencyGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetSnapshotConsistencyGroupOptions model
				getSnapshotConsistencyGroupOptionsModel := new(vpcv1.GetSnapshotConsistencyGroupOptions)
				getSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				getSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetSnapshotConsistencyGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSnapshotConsistencyGroupOptions model
				getSnapshotConsistencyGroupOptionsModel := new(vpcv1.GetSnapshotConsistencyGroupOptions)
				getSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				getSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetSnapshotConsistencyGroupOptions model with no property values
				getSnapshotConsistencyGroupOptionsModelNew := new(vpcv1.GetSnapshotConsistencyGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetSnapshotConsistencyGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSnapshotConsistencyGroupOptions model
				getSnapshotConsistencyGroupOptionsModel := new(vpcv1.GetSnapshotConsistencyGroupOptions)
				getSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				getSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptions *UpdateSnapshotConsistencyGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateSnapshotConsistencyGroupPath := "/snapshot_consistency_groups/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSnapshotConsistencyGroupPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateSnapshotConsistencyGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SnapshotConsistencyGroupPatch model
				snapshotConsistencyGroupPatchModel := new(vpcv1.SnapshotConsistencyGroupPatch)
				snapshotConsistencyGroupPatchModel.DeleteSnapshotsOnDelete = core.BoolPtr(false)
				snapshotConsistencyGroupPatchModel.Name = core.StringPtr("my-snapshot-consistency-group")
				snapshotConsistencyGroupPatchModelAsPatch, asPatchErr := snapshotConsistencyGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSnapshotConsistencyGroupOptions model
				updateSnapshotConsistencyGroupOptionsModel := new(vpcv1.UpdateSnapshotConsistencyGroupOptions)
				updateSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				updateSnapshotConsistencyGroupOptionsModel.SnapshotConsistencyGroupPatch = snapshotConsistencyGroupPatchModelAsPatch
				updateSnapshotConsistencyGroupOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptions *UpdateSnapshotConsistencyGroupOptions)`, func() {
		version := "2024-06-23"
		updateSnapshotConsistencyGroupPath := "/snapshot_consistency_groups/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSnapshotConsistencyGroupPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["ServiceTags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}`)
				}))
			})
			It(`Invoke UpdateSnapshotConsistencyGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the SnapshotConsistencyGroupPatch model
				snapshotConsistencyGroupPatchModel := new(vpcv1.SnapshotConsistencyGroupPatch)
				snapshotConsistencyGroupPatchModel.DeleteSnapshotsOnDelete = core.BoolPtr(false)
				snapshotConsistencyGroupPatchModel.Name = core.StringPtr("my-snapshot-consistency-group")
				snapshotConsistencyGroupPatchModelAsPatch, asPatchErr := snapshotConsistencyGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSnapshotConsistencyGroupOptions model
				updateSnapshotConsistencyGroupOptionsModel := new(vpcv1.UpdateSnapshotConsistencyGroupOptions)
				updateSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				updateSnapshotConsistencyGroupOptionsModel.SnapshotConsistencyGroupPatch = snapshotConsistencyGroupPatchModelAsPatch
				updateSnapshotConsistencyGroupOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateSnapshotConsistencyGroupWithContext(ctx, updateSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateSnapshotConsistencyGroupWithContext(ctx, updateSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSnapshotConsistencyGroupPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["ServiceTags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}`)
				}))
			})
			It(`Invoke UpdateSnapshotConsistencyGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateSnapshotConsistencyGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the SnapshotConsistencyGroupPatch model
				snapshotConsistencyGroupPatchModel := new(vpcv1.SnapshotConsistencyGroupPatch)
				snapshotConsistencyGroupPatchModel.DeleteSnapshotsOnDelete = core.BoolPtr(false)
				snapshotConsistencyGroupPatchModel.Name = core.StringPtr("my-snapshot-consistency-group")
				snapshotConsistencyGroupPatchModelAsPatch, asPatchErr := snapshotConsistencyGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSnapshotConsistencyGroupOptions model
				updateSnapshotConsistencyGroupOptionsModel := new(vpcv1.UpdateSnapshotConsistencyGroupOptions)
				updateSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				updateSnapshotConsistencyGroupOptionsModel.SnapshotConsistencyGroupPatch = snapshotConsistencyGroupPatchModelAsPatch
				updateSnapshotConsistencyGroupOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateSnapshotConsistencyGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SnapshotConsistencyGroupPatch model
				snapshotConsistencyGroupPatchModel := new(vpcv1.SnapshotConsistencyGroupPatch)
				snapshotConsistencyGroupPatchModel.DeleteSnapshotsOnDelete = core.BoolPtr(false)
				snapshotConsistencyGroupPatchModel.Name = core.StringPtr("my-snapshot-consistency-group")
				snapshotConsistencyGroupPatchModelAsPatch, asPatchErr := snapshotConsistencyGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSnapshotConsistencyGroupOptions model
				updateSnapshotConsistencyGroupOptionsModel := new(vpcv1.UpdateSnapshotConsistencyGroupOptions)
				updateSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				updateSnapshotConsistencyGroupOptionsModel.SnapshotConsistencyGroupPatch = snapshotConsistencyGroupPatchModelAsPatch
				updateSnapshotConsistencyGroupOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateSnapshotConsistencyGroupOptions model with no property values
				updateSnapshotConsistencyGroupOptionsModelNew := new(vpcv1.UpdateSnapshotConsistencyGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateSnapshotConsistencyGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SnapshotConsistencyGroupPatch model
				snapshotConsistencyGroupPatchModel := new(vpcv1.SnapshotConsistencyGroupPatch)
				snapshotConsistencyGroupPatchModel.DeleteSnapshotsOnDelete = core.BoolPtr(false)
				snapshotConsistencyGroupPatchModel.Name = core.StringPtr("my-snapshot-consistency-group")
				snapshotConsistencyGroupPatchModelAsPatch, asPatchErr := snapshotConsistencyGroupPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSnapshotConsistencyGroupOptions model
				updateSnapshotConsistencyGroupOptionsModel := new(vpcv1.UpdateSnapshotConsistencyGroupOptions)
				updateSnapshotConsistencyGroupOptionsModel.ID = core.StringPtr("testString")
				updateSnapshotConsistencyGroupOptionsModel.SnapshotConsistencyGroupPatch = snapshotConsistencyGroupPatchModelAsPatch
				updateSnapshotConsistencyGroupOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateSnapshotConsistencyGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteSnapshots(deleteSnapshotsOptions *DeleteSnapshotsOptions)`, func() {
		version := "2024-06-23"
		deleteSnapshotsPath := "/snapshots"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteSnapshotsPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["source_volume.id"]).To(Equal([]string{"testString"}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteSnapshots successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteSnapshots(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteSnapshotsOptions model
				deleteSnapshotsOptionsModel := new(vpcv1.DeleteSnapshotsOptions)
				deleteSnapshotsOptionsModel.SourceVolumeID = core.StringPtr("testString")
				deleteSnapshotsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteSnapshots(deleteSnapshotsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteSnapshots with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteSnapshotsOptions model
				deleteSnapshotsOptionsModel := new(vpcv1.DeleteSnapshotsOptions)
				deleteSnapshotsOptionsModel.SourceVolumeID = core.StringPtr("testString")
				deleteSnapshotsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteSnapshots(deleteSnapshotsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteSnapshotsOptions model with no property values
				deleteSnapshotsOptionsModelNew := new(vpcv1.DeleteSnapshotsOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteSnapshots(deleteSnapshotsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSnapshots(listSnapshotsOptions *ListSnapshotsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listSnapshotsPath := "/snapshots"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["tag"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["source_volume.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["source_volume.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}))
					Expect(req.URL.Query()["source_image.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["source_image.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["backup_policy_plan.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["copies[].id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["copies[].name"]).To(Equal([]string{"my-snapshot-copy"}))
					Expect(req.URL.Query()["copies[].crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"}))
					Expect(req.URL.Query()["copies[].remote.region.name"]).To(Equal([]string{"us-south"}))
					Expect(req.URL.Query()["source_snapshot.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["source_snapshot.remote.region.name"]).To(Equal([]string{"us-south"}))
					Expect(req.URL.Query()["source_volume.remote.region.name"]).To(Equal([]string{"us-east"}))
					Expect(req.URL.Query()["source_image.remote.region.name"]).To(Equal([]string{"us-south"}))
					Expect(req.URL.Query()["clones[].zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["snapshot_consistency_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["snapshot_consistency_group.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListSnapshots with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSnapshotsOptions model
				listSnapshotsOptionsModel := new(vpcv1.ListSnapshotsOptions)
				listSnapshotsOptionsModel.Start = core.StringPtr("testString")
				listSnapshotsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotsOptionsModel.Tag = core.StringPtr("testString")
				listSnapshotsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSnapshotsOptionsModel.Name = core.StringPtr("my-name")
				listSnapshotsOptionsModel.SourceVolumeID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceVolumeCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
				listSnapshotsOptionsModel.SourceImageID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceImageCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")
				listSnapshotsOptionsModel.Sort = core.StringPtr("name")
				listSnapshotsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listSnapshotsOptionsModel.CopiesID = core.StringPtr("testString")
				listSnapshotsOptionsModel.CopiesName = core.StringPtr("my-snapshot-copy")
				listSnapshotsOptionsModel.CopiesCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")
				listSnapshotsOptionsModel.CopiesRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.SourceSnapshotID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceSnapshotRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.SourceVolumeRemoteRegionName = core.StringPtr("us-east")
				listSnapshotsOptionsModel.SourceImageRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.ClonesZoneName = core.StringPtr("us-south-1")
				listSnapshotsOptionsModel.SnapshotConsistencyGroupID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SnapshotConsistencyGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263")
				listSnapshotsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListSnapshots(listSnapshotsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListSnapshots(listSnapshotsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSnapshots(listSnapshotsOptions *ListSnapshotsOptions)`, func() {
		version := "2024-06-23"
		listSnapshotsPath := "/snapshots"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["tag"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["source_volume.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["source_volume.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}))
					Expect(req.URL.Query()["source_image.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["source_image.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["backup_policy_plan.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["copies[].id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["copies[].name"]).To(Equal([]string{"my-snapshot-copy"}))
					Expect(req.URL.Query()["copies[].crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"}))
					Expect(req.URL.Query()["copies[].remote.region.name"]).To(Equal([]string{"us-south"}))
					Expect(req.URL.Query()["source_snapshot.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["source_snapshot.remote.region.name"]).To(Equal([]string{"us-south"}))
					Expect(req.URL.Query()["source_volume.remote.region.name"]).To(Equal([]string{"us-east"}))
					Expect(req.URL.Query()["source_image.remote.region.name"]).To(Equal([]string{"us-south"}))
					Expect(req.URL.Query()["clones[].zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["snapshot_consistency_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["snapshot_consistency_group.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "snapshots": [{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["ServiceTags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "storage_generation": 1, "user_tags": ["UserTags"]}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListSnapshots successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListSnapshotsOptions model
				listSnapshotsOptionsModel := new(vpcv1.ListSnapshotsOptions)
				listSnapshotsOptionsModel.Start = core.StringPtr("testString")
				listSnapshotsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotsOptionsModel.Tag = core.StringPtr("testString")
				listSnapshotsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSnapshotsOptionsModel.Name = core.StringPtr("my-name")
				listSnapshotsOptionsModel.SourceVolumeID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceVolumeCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
				listSnapshotsOptionsModel.SourceImageID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceImageCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")
				listSnapshotsOptionsModel.Sort = core.StringPtr("name")
				listSnapshotsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listSnapshotsOptionsModel.CopiesID = core.StringPtr("testString")
				listSnapshotsOptionsModel.CopiesName = core.StringPtr("my-snapshot-copy")
				listSnapshotsOptionsModel.CopiesCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")
				listSnapshotsOptionsModel.CopiesRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.SourceSnapshotID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceSnapshotRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.SourceVolumeRemoteRegionName = core.StringPtr("us-east")
				listSnapshotsOptionsModel.SourceImageRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.ClonesZoneName = core.StringPtr("us-south-1")
				listSnapshotsOptionsModel.SnapshotConsistencyGroupID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SnapshotConsistencyGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263")
				listSnapshotsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListSnapshotsWithContext(ctx, listSnapshotsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListSnapshots(listSnapshotsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListSnapshotsWithContext(ctx, listSnapshotsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["tag"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["source_volume.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["source_volume.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}))
					Expect(req.URL.Query()["source_image.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["source_image.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["backup_policy_plan.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["copies[].id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["copies[].name"]).To(Equal([]string{"my-snapshot-copy"}))
					Expect(req.URL.Query()["copies[].crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"}))
					Expect(req.URL.Query()["copies[].remote.region.name"]).To(Equal([]string{"us-south"}))
					Expect(req.URL.Query()["source_snapshot.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["source_snapshot.remote.region.name"]).To(Equal([]string{"us-south"}))
					Expect(req.URL.Query()["source_volume.remote.region.name"]).To(Equal([]string{"us-east"}))
					Expect(req.URL.Query()["source_image.remote.region.name"]).To(Equal([]string{"us-south"}))
					Expect(req.URL.Query()["clones[].zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["snapshot_consistency_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["snapshot_consistency_group.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "snapshots": [{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["ServiceTags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "storage_generation": 1, "user_tags": ["UserTags"]}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListSnapshots successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListSnapshots(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListSnapshotsOptions model
				listSnapshotsOptionsModel := new(vpcv1.ListSnapshotsOptions)
				listSnapshotsOptionsModel.Start = core.StringPtr("testString")
				listSnapshotsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotsOptionsModel.Tag = core.StringPtr("testString")
				listSnapshotsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSnapshotsOptionsModel.Name = core.StringPtr("my-name")
				listSnapshotsOptionsModel.SourceVolumeID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceVolumeCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
				listSnapshotsOptionsModel.SourceImageID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceImageCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")
				listSnapshotsOptionsModel.Sort = core.StringPtr("name")
				listSnapshotsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listSnapshotsOptionsModel.CopiesID = core.StringPtr("testString")
				listSnapshotsOptionsModel.CopiesName = core.StringPtr("my-snapshot-copy")
				listSnapshotsOptionsModel.CopiesCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")
				listSnapshotsOptionsModel.CopiesRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.SourceSnapshotID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceSnapshotRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.SourceVolumeRemoteRegionName = core.StringPtr("us-east")
				listSnapshotsOptionsModel.SourceImageRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.ClonesZoneName = core.StringPtr("us-south-1")
				listSnapshotsOptionsModel.SnapshotConsistencyGroupID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SnapshotConsistencyGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263")
				listSnapshotsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListSnapshots(listSnapshotsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListSnapshots with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSnapshotsOptions model
				listSnapshotsOptionsModel := new(vpcv1.ListSnapshotsOptions)
				listSnapshotsOptionsModel.Start = core.StringPtr("testString")
				listSnapshotsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotsOptionsModel.Tag = core.StringPtr("testString")
				listSnapshotsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSnapshotsOptionsModel.Name = core.StringPtr("my-name")
				listSnapshotsOptionsModel.SourceVolumeID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceVolumeCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
				listSnapshotsOptionsModel.SourceImageID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceImageCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")
				listSnapshotsOptionsModel.Sort = core.StringPtr("name")
				listSnapshotsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listSnapshotsOptionsModel.CopiesID = core.StringPtr("testString")
				listSnapshotsOptionsModel.CopiesName = core.StringPtr("my-snapshot-copy")
				listSnapshotsOptionsModel.CopiesCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")
				listSnapshotsOptionsModel.CopiesRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.SourceSnapshotID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceSnapshotRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.SourceVolumeRemoteRegionName = core.StringPtr("us-east")
				listSnapshotsOptionsModel.SourceImageRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.ClonesZoneName = core.StringPtr("us-south-1")
				listSnapshotsOptionsModel.SnapshotConsistencyGroupID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SnapshotConsistencyGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263")
				listSnapshotsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListSnapshots(listSnapshotsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListSnapshots successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSnapshotsOptions model
				listSnapshotsOptionsModel := new(vpcv1.ListSnapshotsOptions)
				listSnapshotsOptionsModel.Start = core.StringPtr("testString")
				listSnapshotsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotsOptionsModel.Tag = core.StringPtr("testString")
				listSnapshotsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSnapshotsOptionsModel.Name = core.StringPtr("my-name")
				listSnapshotsOptionsModel.SourceVolumeID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceVolumeCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
				listSnapshotsOptionsModel.SourceImageID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceImageCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")
				listSnapshotsOptionsModel.Sort = core.StringPtr("name")
				listSnapshotsOptionsModel.BackupPolicyPlanID = core.StringPtr("testString")
				listSnapshotsOptionsModel.CopiesID = core.StringPtr("testString")
				listSnapshotsOptionsModel.CopiesName = core.StringPtr("my-snapshot-copy")
				listSnapshotsOptionsModel.CopiesCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")
				listSnapshotsOptionsModel.CopiesRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.SourceSnapshotID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SourceSnapshotRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.SourceVolumeRemoteRegionName = core.StringPtr("us-east")
				listSnapshotsOptionsModel.SourceImageRemoteRegionName = core.StringPtr("us-south")
				listSnapshotsOptionsModel.ClonesZoneName = core.StringPtr("us-south-1")
				listSnapshotsOptionsModel.SnapshotConsistencyGroupID = core.StringPtr("testString")
				listSnapshotsOptionsModel.SnapshotConsistencyGroupCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263")
				listSnapshotsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListSnapshots(listSnapshotsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.SnapshotCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.SnapshotCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.SnapshotCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"snapshots":[{"allowed_use":{"api_version":"2024-06-23","bare_metal_server":"enable_secure_boot == true","instance":"gpu.count > 0 && enable_secure_boot == true"},"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r006-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263","deletable":false,"encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r006-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"progress":55,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["ServiceTags"],"size":1,"snapshot_consistency_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r006-fa329f6b-0e36-433f-a3bb-0df632e79263","name":"my-snapshot-consistency-group","resource_type":"snapshot_consistency_group"},"source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r006-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"storage_generation":1,"user_tags":["UserTags"]}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"snapshots":[{"allowed_use":{"api_version":"2024-06-23","bare_metal_server":"enable_secure_boot == true","instance":"gpu.count > 0 && enable_secure_boot == true"},"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r006-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263","deletable":false,"encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r006-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"progress":55,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["ServiceTags"],"size":1,"snapshot_consistency_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r006-fa329f6b-0e36-433f-a3bb-0df632e79263","name":"my-snapshot-consistency-group","resource_type":"snapshot_consistency_group"},"source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r006-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"storage_generation":1,"user_tags":["UserTags"]}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use SnapshotsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSnapshotsOptionsModel := &vpcv1.ListSnapshotsOptions{
					Limit:                          core.Int64Ptr(int64(10)),
					Tag:                            core.StringPtr("testString"),
					ResourceGroupID:                core.StringPtr("testString"),
					Name:                           core.StringPtr("my-name"),
					SourceVolumeID:                 core.StringPtr("testString"),
					SourceVolumeCRN:                core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"),
					SourceImageID:                  core.StringPtr("testString"),
					SourceImageCRN:                 core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"),
					Sort:                           core.StringPtr("name"),
					BackupPolicyPlanID:             core.StringPtr("testString"),
					CopiesID:                       core.StringPtr("testString"),
					CopiesName:                     core.StringPtr("my-snapshot-copy"),
					CopiesCRN:                      core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"),
					CopiesRemoteRegionName:         core.StringPtr("us-south"),
					SourceSnapshotID:               core.StringPtr("testString"),
					SourceSnapshotRemoteRegionName: core.StringPtr("us-south"),
					SourceVolumeRemoteRegionName:   core.StringPtr("us-east"),
					SourceImageRemoteRegionName:    core.StringPtr("us-south"),
					ClonesZoneName:                 core.StringPtr("us-south-1"),
					SnapshotConsistencyGroupID:     core.StringPtr("testString"),
					SnapshotConsistencyGroupCRN:    core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263"),
				}

				pager, err := vpcService.NewSnapshotsPager(listSnapshotsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.Snapshot
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use SnapshotsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSnapshotsOptionsModel := &vpcv1.ListSnapshotsOptions{
					Limit:                          core.Int64Ptr(int64(10)),
					Tag:                            core.StringPtr("testString"),
					ResourceGroupID:                core.StringPtr("testString"),
					Name:                           core.StringPtr("my-name"),
					SourceVolumeID:                 core.StringPtr("testString"),
					SourceVolumeCRN:                core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"),
					SourceImageID:                  core.StringPtr("testString"),
					SourceImageCRN:                 core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"),
					Sort:                           core.StringPtr("name"),
					BackupPolicyPlanID:             core.StringPtr("testString"),
					CopiesID:                       core.StringPtr("testString"),
					CopiesName:                     core.StringPtr("my-snapshot-copy"),
					CopiesCRN:                      core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"),
					CopiesRemoteRegionName:         core.StringPtr("us-south"),
					SourceSnapshotID:               core.StringPtr("testString"),
					SourceSnapshotRemoteRegionName: core.StringPtr("us-south"),
					SourceVolumeRemoteRegionName:   core.StringPtr("us-east"),
					SourceImageRemoteRegionName:    core.StringPtr("us-south"),
					ClonesZoneName:                 core.StringPtr("us-south-1"),
					SnapshotConsistencyGroupID:     core.StringPtr("testString"),
					SnapshotConsistencyGroupCRN:    core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263"),
				}

				pager, err := vpcService.NewSnapshotsPager(listSnapshotsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateSnapshot(createSnapshotOptions *CreateSnapshotOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createSnapshotPath := "/snapshots"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSnapshotPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateSnapshot with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SnapshotAllowedUsePrototype model
				snapshotAllowedUsePrototypeModel := new(vpcv1.SnapshotAllowedUsePrototype)
				snapshotAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				snapshotAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				snapshotAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SnapshotClonePrototype model
				snapshotClonePrototypeModel := new(vpcv1.SnapshotClonePrototype)
				snapshotClonePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeIdentityByID model
				volumeIdentityModel := new(vpcv1.VolumeIdentityByID)
				volumeIdentityModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the SnapshotPrototypeSnapshotBySourceVolume model
				snapshotPrototypeModel := new(vpcv1.SnapshotPrototypeSnapshotBySourceVolume)
				snapshotPrototypeModel.AllowedUse = snapshotAllowedUsePrototypeModel
				snapshotPrototypeModel.Clones = []vpcv1.SnapshotClonePrototype{*snapshotClonePrototypeModel}
				snapshotPrototypeModel.Name = core.StringPtr("my-snapshot")
				snapshotPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				snapshotPrototypeModel.UserTags = []string{}
				snapshotPrototypeModel.SourceVolume = volumeIdentityModel

				// Construct an instance of the CreateSnapshotOptions model
				createSnapshotOptionsModel := new(vpcv1.CreateSnapshotOptions)
				createSnapshotOptionsModel.SnapshotPrototype = snapshotPrototypeModel
				createSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateSnapshot(createSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateSnapshot(createSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateSnapshot(createSnapshotOptions *CreateSnapshotOptions)`, func() {
		version := "2024-06-23"
		createSnapshotPath := "/snapshots"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSnapshotPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["ServiceTags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "storage_generation": 1, "user_tags": ["UserTags"]}`)
				}))
			})
			It(`Invoke CreateSnapshot successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the SnapshotAllowedUsePrototype model
				snapshotAllowedUsePrototypeModel := new(vpcv1.SnapshotAllowedUsePrototype)
				snapshotAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				snapshotAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				snapshotAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SnapshotClonePrototype model
				snapshotClonePrototypeModel := new(vpcv1.SnapshotClonePrototype)
				snapshotClonePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeIdentityByID model
				volumeIdentityModel := new(vpcv1.VolumeIdentityByID)
				volumeIdentityModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the SnapshotPrototypeSnapshotBySourceVolume model
				snapshotPrototypeModel := new(vpcv1.SnapshotPrototypeSnapshotBySourceVolume)
				snapshotPrototypeModel.AllowedUse = snapshotAllowedUsePrototypeModel
				snapshotPrototypeModel.Clones = []vpcv1.SnapshotClonePrototype{*snapshotClonePrototypeModel}
				snapshotPrototypeModel.Name = core.StringPtr("my-snapshot")
				snapshotPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				snapshotPrototypeModel.UserTags = []string{}
				snapshotPrototypeModel.SourceVolume = volumeIdentityModel

				// Construct an instance of the CreateSnapshotOptions model
				createSnapshotOptionsModel := new(vpcv1.CreateSnapshotOptions)
				createSnapshotOptionsModel.SnapshotPrototype = snapshotPrototypeModel
				createSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateSnapshotWithContext(ctx, createSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateSnapshot(createSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateSnapshotWithContext(ctx, createSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSnapshotPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["ServiceTags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "storage_generation": 1, "user_tags": ["UserTags"]}`)
				}))
			})
			It(`Invoke CreateSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateSnapshot(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the SnapshotAllowedUsePrototype model
				snapshotAllowedUsePrototypeModel := new(vpcv1.SnapshotAllowedUsePrototype)
				snapshotAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				snapshotAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				snapshotAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SnapshotClonePrototype model
				snapshotClonePrototypeModel := new(vpcv1.SnapshotClonePrototype)
				snapshotClonePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeIdentityByID model
				volumeIdentityModel := new(vpcv1.VolumeIdentityByID)
				volumeIdentityModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the SnapshotPrototypeSnapshotBySourceVolume model
				snapshotPrototypeModel := new(vpcv1.SnapshotPrototypeSnapshotBySourceVolume)
				snapshotPrototypeModel.AllowedUse = snapshotAllowedUsePrototypeModel
				snapshotPrototypeModel.Clones = []vpcv1.SnapshotClonePrototype{*snapshotClonePrototypeModel}
				snapshotPrototypeModel.Name = core.StringPtr("my-snapshot")
				snapshotPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				snapshotPrototypeModel.UserTags = []string{}
				snapshotPrototypeModel.SourceVolume = volumeIdentityModel

				// Construct an instance of the CreateSnapshotOptions model
				createSnapshotOptionsModel := new(vpcv1.CreateSnapshotOptions)
				createSnapshotOptionsModel.SnapshotPrototype = snapshotPrototypeModel
				createSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateSnapshot(createSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateSnapshot with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SnapshotAllowedUsePrototype model
				snapshotAllowedUsePrototypeModel := new(vpcv1.SnapshotAllowedUsePrototype)
				snapshotAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				snapshotAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				snapshotAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SnapshotClonePrototype model
				snapshotClonePrototypeModel := new(vpcv1.SnapshotClonePrototype)
				snapshotClonePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeIdentityByID model
				volumeIdentityModel := new(vpcv1.VolumeIdentityByID)
				volumeIdentityModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the SnapshotPrototypeSnapshotBySourceVolume model
				snapshotPrototypeModel := new(vpcv1.SnapshotPrototypeSnapshotBySourceVolume)
				snapshotPrototypeModel.AllowedUse = snapshotAllowedUsePrototypeModel
				snapshotPrototypeModel.Clones = []vpcv1.SnapshotClonePrototype{*snapshotClonePrototypeModel}
				snapshotPrototypeModel.Name = core.StringPtr("my-snapshot")
				snapshotPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				snapshotPrototypeModel.UserTags = []string{}
				snapshotPrototypeModel.SourceVolume = volumeIdentityModel

				// Construct an instance of the CreateSnapshotOptions model
				createSnapshotOptionsModel := new(vpcv1.CreateSnapshotOptions)
				createSnapshotOptionsModel.SnapshotPrototype = snapshotPrototypeModel
				createSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateSnapshot(createSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateSnapshotOptions model with no property values
				createSnapshotOptionsModelNew := new(vpcv1.CreateSnapshotOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateSnapshot(createSnapshotOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SnapshotAllowedUsePrototype model
				snapshotAllowedUsePrototypeModel := new(vpcv1.SnapshotAllowedUsePrototype)
				snapshotAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				snapshotAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				snapshotAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SnapshotClonePrototype model
				snapshotClonePrototypeModel := new(vpcv1.SnapshotClonePrototype)
				snapshotClonePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the VolumeIdentityByID model
				volumeIdentityModel := new(vpcv1.VolumeIdentityByID)
				volumeIdentityModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

				// Construct an instance of the SnapshotPrototypeSnapshotBySourceVolume model
				snapshotPrototypeModel := new(vpcv1.SnapshotPrototypeSnapshotBySourceVolume)
				snapshotPrototypeModel.AllowedUse = snapshotAllowedUsePrototypeModel
				snapshotPrototypeModel.Clones = []vpcv1.SnapshotClonePrototype{*snapshotClonePrototypeModel}
				snapshotPrototypeModel.Name = core.StringPtr("my-snapshot")
				snapshotPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				snapshotPrototypeModel.UserTags = []string{}
				snapshotPrototypeModel.SourceVolume = volumeIdentityModel

				// Construct an instance of the CreateSnapshotOptions model
				createSnapshotOptionsModel := new(vpcv1.CreateSnapshotOptions)
				createSnapshotOptionsModel.SnapshotPrototype = snapshotPrototypeModel
				createSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateSnapshot(createSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteSnapshot(deleteSnapshotOptions *DeleteSnapshotOptions)`, func() {
		version := "2024-06-23"
		deleteSnapshotPath := "/snapshots/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteSnapshotPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteSnapshot(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteSnapshotOptions model
				deleteSnapshotOptionsModel := new(vpcv1.DeleteSnapshotOptions)
				deleteSnapshotOptionsModel.ID = core.StringPtr("testString")
				deleteSnapshotOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteSnapshot(deleteSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteSnapshot with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteSnapshotOptions model
				deleteSnapshotOptionsModel := new(vpcv1.DeleteSnapshotOptions)
				deleteSnapshotOptionsModel.ID = core.StringPtr("testString")
				deleteSnapshotOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteSnapshot(deleteSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteSnapshotOptions model with no property values
				deleteSnapshotOptionsModelNew := new(vpcv1.DeleteSnapshotOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteSnapshot(deleteSnapshotOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSnapshot(getSnapshotOptions *GetSnapshotOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getSnapshotPath := "/snapshots/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSnapshotPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetSnapshot with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSnapshotOptions model
				getSnapshotOptionsModel := new(vpcv1.GetSnapshotOptions)
				getSnapshotOptionsModel.ID = core.StringPtr("testString")
				getSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetSnapshot(getSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetSnapshot(getSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSnapshot(getSnapshotOptions *GetSnapshotOptions)`, func() {
		version := "2024-06-23"
		getSnapshotPath := "/snapshots/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSnapshotPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["ServiceTags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "storage_generation": 1, "user_tags": ["UserTags"]}`)
				}))
			})
			It(`Invoke GetSnapshot successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetSnapshotOptions model
				getSnapshotOptionsModel := new(vpcv1.GetSnapshotOptions)
				getSnapshotOptionsModel.ID = core.StringPtr("testString")
				getSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetSnapshotWithContext(ctx, getSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetSnapshot(getSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetSnapshotWithContext(ctx, getSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSnapshotPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["ServiceTags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "storage_generation": 1, "user_tags": ["UserTags"]}`)
				}))
			})
			It(`Invoke GetSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetSnapshot(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetSnapshotOptions model
				getSnapshotOptionsModel := new(vpcv1.GetSnapshotOptions)
				getSnapshotOptionsModel.ID = core.StringPtr("testString")
				getSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetSnapshot(getSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetSnapshot with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSnapshotOptions model
				getSnapshotOptionsModel := new(vpcv1.GetSnapshotOptions)
				getSnapshotOptionsModel.ID = core.StringPtr("testString")
				getSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetSnapshot(getSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetSnapshotOptions model with no property values
				getSnapshotOptionsModelNew := new(vpcv1.GetSnapshotOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetSnapshot(getSnapshotOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSnapshotOptions model
				getSnapshotOptionsModel := new(vpcv1.GetSnapshotOptions)
				getSnapshotOptionsModel.ID = core.StringPtr("testString")
				getSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetSnapshot(getSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateSnapshot(updateSnapshotOptions *UpdateSnapshotOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateSnapshotPath := "/snapshots/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSnapshotPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateSnapshot with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SnapshotAllowedUsePatch model
				snapshotAllowedUsePatchModel := new(vpcv1.SnapshotAllowedUsePatch)
				snapshotAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				snapshotAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				snapshotAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the SnapshotPatch model
				snapshotPatchModel := new(vpcv1.SnapshotPatch)
				snapshotPatchModel.AllowedUse = snapshotAllowedUsePatchModel
				snapshotPatchModel.Name = core.StringPtr("my-snapshot-updated")
				snapshotPatchModel.UserTags = []string{"testString"}
				snapshotPatchModelAsPatch, asPatchErr := snapshotPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSnapshotOptions model
				updateSnapshotOptionsModel := new(vpcv1.UpdateSnapshotOptions)
				updateSnapshotOptionsModel.ID = core.StringPtr("testString")
				updateSnapshotOptionsModel.SnapshotPatch = snapshotPatchModelAsPatch
				updateSnapshotOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateSnapshot(updateSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateSnapshot(updateSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateSnapshot(updateSnapshotOptions *UpdateSnapshotOptions)`, func() {
		version := "2024-06-23"
		updateSnapshotPath := "/snapshots/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSnapshotPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["ServiceTags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "storage_generation": 1, "user_tags": ["UserTags"]}`)
				}))
			})
			It(`Invoke UpdateSnapshot successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the SnapshotAllowedUsePatch model
				snapshotAllowedUsePatchModel := new(vpcv1.SnapshotAllowedUsePatch)
				snapshotAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				snapshotAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				snapshotAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the SnapshotPatch model
				snapshotPatchModel := new(vpcv1.SnapshotPatch)
				snapshotPatchModel.AllowedUse = snapshotAllowedUsePatchModel
				snapshotPatchModel.Name = core.StringPtr("my-snapshot-updated")
				snapshotPatchModel.UserTags = []string{"testString"}
				snapshotPatchModelAsPatch, asPatchErr := snapshotPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSnapshotOptions model
				updateSnapshotOptionsModel := new(vpcv1.UpdateSnapshotOptions)
				updateSnapshotOptionsModel.ID = core.StringPtr("testString")
				updateSnapshotOptionsModel.SnapshotPatch = snapshotPatchModelAsPatch
				updateSnapshotOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateSnapshotWithContext(ctx, updateSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateSnapshot(updateSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateSnapshotWithContext(ctx, updateSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSnapshotPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["ServiceTags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r006-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "storage_generation": 1, "user_tags": ["UserTags"]}`)
				}))
			})
			It(`Invoke UpdateSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateSnapshot(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the SnapshotAllowedUsePatch model
				snapshotAllowedUsePatchModel := new(vpcv1.SnapshotAllowedUsePatch)
				snapshotAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				snapshotAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				snapshotAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the SnapshotPatch model
				snapshotPatchModel := new(vpcv1.SnapshotPatch)
				snapshotPatchModel.AllowedUse = snapshotAllowedUsePatchModel
				snapshotPatchModel.Name = core.StringPtr("my-snapshot-updated")
				snapshotPatchModel.UserTags = []string{"testString"}
				snapshotPatchModelAsPatch, asPatchErr := snapshotPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSnapshotOptions model
				updateSnapshotOptionsModel := new(vpcv1.UpdateSnapshotOptions)
				updateSnapshotOptionsModel.ID = core.StringPtr("testString")
				updateSnapshotOptionsModel.SnapshotPatch = snapshotPatchModelAsPatch
				updateSnapshotOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateSnapshot(updateSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateSnapshot with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SnapshotAllowedUsePatch model
				snapshotAllowedUsePatchModel := new(vpcv1.SnapshotAllowedUsePatch)
				snapshotAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				snapshotAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				snapshotAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the SnapshotPatch model
				snapshotPatchModel := new(vpcv1.SnapshotPatch)
				snapshotPatchModel.AllowedUse = snapshotAllowedUsePatchModel
				snapshotPatchModel.Name = core.StringPtr("my-snapshot-updated")
				snapshotPatchModel.UserTags = []string{"testString"}
				snapshotPatchModelAsPatch, asPatchErr := snapshotPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSnapshotOptions model
				updateSnapshotOptionsModel := new(vpcv1.UpdateSnapshotOptions)
				updateSnapshotOptionsModel.ID = core.StringPtr("testString")
				updateSnapshotOptionsModel.SnapshotPatch = snapshotPatchModelAsPatch
				updateSnapshotOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateSnapshot(updateSnapshotOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateSnapshotOptions model with no property values
				updateSnapshotOptionsModelNew := new(vpcv1.UpdateSnapshotOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateSnapshot(updateSnapshotOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateSnapshot successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the SnapshotAllowedUsePatch model
				snapshotAllowedUsePatchModel := new(vpcv1.SnapshotAllowedUsePatch)
				snapshotAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				snapshotAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				snapshotAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the SnapshotPatch model
				snapshotPatchModel := new(vpcv1.SnapshotPatch)
				snapshotPatchModel.AllowedUse = snapshotAllowedUsePatchModel
				snapshotPatchModel.Name = core.StringPtr("my-snapshot-updated")
				snapshotPatchModel.UserTags = []string{"testString"}
				snapshotPatchModelAsPatch, asPatchErr := snapshotPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSnapshotOptions model
				updateSnapshotOptionsModel := new(vpcv1.UpdateSnapshotOptions)
				updateSnapshotOptionsModel.ID = core.StringPtr("testString")
				updateSnapshotOptionsModel.SnapshotPatch = snapshotPatchModelAsPatch
				updateSnapshotOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateSnapshotOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateSnapshot(updateSnapshotOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSnapshotClones(listSnapshotClonesOptions *ListSnapshotClonesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listSnapshotClonesPath := "/snapshots/testString/clones"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotClonesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListSnapshotClones with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSnapshotClonesOptions model
				listSnapshotClonesOptionsModel := new(vpcv1.ListSnapshotClonesOptions)
				listSnapshotClonesOptionsModel.ID = core.StringPtr("testString")
				listSnapshotClonesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListSnapshotClones(listSnapshotClonesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListSnapshotClones(listSnapshotClonesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSnapshotClones(listSnapshotClonesOptions *ListSnapshotClonesOptions)`, func() {
		version := "2024-06-23"
		listSnapshotClonesPath := "/snapshots/testString/clones"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotClonesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}`)
				}))
			})
			It(`Invoke ListSnapshotClones successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListSnapshotClonesOptions model
				listSnapshotClonesOptionsModel := new(vpcv1.ListSnapshotClonesOptions)
				listSnapshotClonesOptionsModel.ID = core.StringPtr("testString")
				listSnapshotClonesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListSnapshotClonesWithContext(ctx, listSnapshotClonesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListSnapshotClones(listSnapshotClonesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListSnapshotClonesWithContext(ctx, listSnapshotClonesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotClonesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}`)
				}))
			})
			It(`Invoke ListSnapshotClones successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListSnapshotClones(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListSnapshotClonesOptions model
				listSnapshotClonesOptionsModel := new(vpcv1.ListSnapshotClonesOptions)
				listSnapshotClonesOptionsModel.ID = core.StringPtr("testString")
				listSnapshotClonesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListSnapshotClones(listSnapshotClonesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListSnapshotClones with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSnapshotClonesOptions model
				listSnapshotClonesOptionsModel := new(vpcv1.ListSnapshotClonesOptions)
				listSnapshotClonesOptionsModel.ID = core.StringPtr("testString")
				listSnapshotClonesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListSnapshotClones(listSnapshotClonesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListSnapshotClonesOptions model with no property values
				listSnapshotClonesOptionsModelNew := new(vpcv1.ListSnapshotClonesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListSnapshotClones(listSnapshotClonesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListSnapshotClones successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSnapshotClonesOptions model
				listSnapshotClonesOptionsModel := new(vpcv1.ListSnapshotClonesOptions)
				listSnapshotClonesOptionsModel.ID = core.StringPtr("testString")
				listSnapshotClonesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListSnapshotClones(listSnapshotClonesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteSnapshotClone(deleteSnapshotCloneOptions *DeleteSnapshotCloneOptions)`, func() {
		version := "2024-06-23"
		deleteSnapshotClonePath := "/snapshots/testString/clones/us-south-1"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteSnapshotClonePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteSnapshotClone successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteSnapshotClone(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteSnapshotCloneOptions model
				deleteSnapshotCloneOptionsModel := new(vpcv1.DeleteSnapshotCloneOptions)
				deleteSnapshotCloneOptionsModel.ID = core.StringPtr("testString")
				deleteSnapshotCloneOptionsModel.ZoneName = core.StringPtr("us-south-1")
				deleteSnapshotCloneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteSnapshotClone(deleteSnapshotCloneOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteSnapshotClone with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteSnapshotCloneOptions model
				deleteSnapshotCloneOptionsModel := new(vpcv1.DeleteSnapshotCloneOptions)
				deleteSnapshotCloneOptionsModel.ID = core.StringPtr("testString")
				deleteSnapshotCloneOptionsModel.ZoneName = core.StringPtr("us-south-1")
				deleteSnapshotCloneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteSnapshotClone(deleteSnapshotCloneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteSnapshotCloneOptions model with no property values
				deleteSnapshotCloneOptionsModelNew := new(vpcv1.DeleteSnapshotCloneOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteSnapshotClone(deleteSnapshotCloneOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSnapshotClone(getSnapshotCloneOptions *GetSnapshotCloneOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getSnapshotClonePath := "/snapshots/testString/clones/us-south-1"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSnapshotClonePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetSnapshotClone with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSnapshotCloneOptions model
				getSnapshotCloneOptionsModel := new(vpcv1.GetSnapshotCloneOptions)
				getSnapshotCloneOptionsModel.ID = core.StringPtr("testString")
				getSnapshotCloneOptionsModel.ZoneName = core.StringPtr("us-south-1")
				getSnapshotCloneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetSnapshotClone(getSnapshotCloneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetSnapshotClone(getSnapshotCloneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSnapshotClone(getSnapshotCloneOptions *GetSnapshotCloneOptions)`, func() {
		version := "2024-06-23"
		getSnapshotClonePath := "/snapshots/testString/clones/us-south-1"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSnapshotClonePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetSnapshotClone successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetSnapshotCloneOptions model
				getSnapshotCloneOptionsModel := new(vpcv1.GetSnapshotCloneOptions)
				getSnapshotCloneOptionsModel.ID = core.StringPtr("testString")
				getSnapshotCloneOptionsModel.ZoneName = core.StringPtr("us-south-1")
				getSnapshotCloneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetSnapshotCloneWithContext(ctx, getSnapshotCloneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetSnapshotClone(getSnapshotCloneOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetSnapshotCloneWithContext(ctx, getSnapshotCloneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSnapshotClonePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetSnapshotClone successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetSnapshotClone(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetSnapshotCloneOptions model
				getSnapshotCloneOptionsModel := new(vpcv1.GetSnapshotCloneOptions)
				getSnapshotCloneOptionsModel.ID = core.StringPtr("testString")
				getSnapshotCloneOptionsModel.ZoneName = core.StringPtr("us-south-1")
				getSnapshotCloneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetSnapshotClone(getSnapshotCloneOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetSnapshotClone with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSnapshotCloneOptions model
				getSnapshotCloneOptionsModel := new(vpcv1.GetSnapshotCloneOptions)
				getSnapshotCloneOptionsModel.ID = core.StringPtr("testString")
				getSnapshotCloneOptionsModel.ZoneName = core.StringPtr("us-south-1")
				getSnapshotCloneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetSnapshotClone(getSnapshotCloneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetSnapshotCloneOptions model with no property values
				getSnapshotCloneOptionsModelNew := new(vpcv1.GetSnapshotCloneOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetSnapshotClone(getSnapshotCloneOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetSnapshotClone successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSnapshotCloneOptions model
				getSnapshotCloneOptionsModel := new(vpcv1.GetSnapshotCloneOptions)
				getSnapshotCloneOptionsModel.ID = core.StringPtr("testString")
				getSnapshotCloneOptionsModel.ZoneName = core.StringPtr("us-south-1")
				getSnapshotCloneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetSnapshotClone(getSnapshotCloneOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateSnapshotClone(createSnapshotCloneOptions *CreateSnapshotCloneOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createSnapshotClonePath := "/snapshots/testString/clones/us-south-1"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSnapshotClonePath))
					Expect(req.Method).To(Equal("PUT"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateSnapshotClone with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateSnapshotCloneOptions model
				createSnapshotCloneOptionsModel := new(vpcv1.CreateSnapshotCloneOptions)
				createSnapshotCloneOptionsModel.ID = core.StringPtr("testString")
				createSnapshotCloneOptionsModel.ZoneName = core.StringPtr("us-south-1")
				createSnapshotCloneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateSnapshotClone(createSnapshotCloneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateSnapshotClone(createSnapshotCloneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateSnapshotClone(createSnapshotCloneOptions *CreateSnapshotCloneOptions)`, func() {
		version := "2024-06-23"
		createSnapshotClonePath := "/snapshots/testString/clones/us-south-1"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSnapshotClonePath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateSnapshotClone successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the CreateSnapshotCloneOptions model
				createSnapshotCloneOptionsModel := new(vpcv1.CreateSnapshotCloneOptions)
				createSnapshotCloneOptionsModel.ID = core.StringPtr("testString")
				createSnapshotCloneOptionsModel.ZoneName = core.StringPtr("us-south-1")
				createSnapshotCloneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateSnapshotCloneWithContext(ctx, createSnapshotCloneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateSnapshotClone(createSnapshotCloneOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateSnapshotCloneWithContext(ctx, createSnapshotCloneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSnapshotClonePath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateSnapshotClone successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateSnapshotClone(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the CreateSnapshotCloneOptions model
				createSnapshotCloneOptionsModel := new(vpcv1.CreateSnapshotCloneOptions)
				createSnapshotCloneOptionsModel.ID = core.StringPtr("testString")
				createSnapshotCloneOptionsModel.ZoneName = core.StringPtr("us-south-1")
				createSnapshotCloneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateSnapshotClone(createSnapshotCloneOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateSnapshotClone with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateSnapshotCloneOptions model
				createSnapshotCloneOptionsModel := new(vpcv1.CreateSnapshotCloneOptions)
				createSnapshotCloneOptionsModel.ID = core.StringPtr("testString")
				createSnapshotCloneOptionsModel.ZoneName = core.StringPtr("us-south-1")
				createSnapshotCloneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateSnapshotClone(createSnapshotCloneOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateSnapshotCloneOptions model with no property values
				createSnapshotCloneOptionsModelNew := new(vpcv1.CreateSnapshotCloneOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateSnapshotClone(createSnapshotCloneOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke CreateSnapshotClone successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateSnapshotCloneOptions model
				createSnapshotCloneOptionsModel := new(vpcv1.CreateSnapshotCloneOptions)
				createSnapshotCloneOptionsModel.ID = core.StringPtr("testString")
				createSnapshotCloneOptionsModel.ZoneName = core.StringPtr("us-south-1")
				createSnapshotCloneOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateSnapshotClone(createSnapshotCloneOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSnapshotInstanceProfiles(listSnapshotInstanceProfilesOptions *ListSnapshotInstanceProfilesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listSnapshotInstanceProfilesPath := "/snapshots/testString/instance_profiles"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListSnapshotInstanceProfiles with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSnapshotInstanceProfilesOptions model
				listSnapshotInstanceProfilesOptionsModel := new(vpcv1.ListSnapshotInstanceProfilesOptions)
				listSnapshotInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listSnapshotInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listSnapshotInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListSnapshotInstanceProfiles(listSnapshotInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListSnapshotInstanceProfiles(listSnapshotInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSnapshotInstanceProfiles(listSnapshotInstanceProfilesOptions *ListSnapshotInstanceProfilesOptions)`, func() {
		version := "2024-06-23"
		listSnapshotInstanceProfilesPath := "/snapshots/testString/instance_profiles"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListSnapshotInstanceProfiles successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListSnapshotInstanceProfilesOptions model
				listSnapshotInstanceProfilesOptionsModel := new(vpcv1.ListSnapshotInstanceProfilesOptions)
				listSnapshotInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listSnapshotInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listSnapshotInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListSnapshotInstanceProfilesWithContext(ctx, listSnapshotInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListSnapshotInstanceProfiles(listSnapshotInstanceProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListSnapshotInstanceProfilesWithContext(ctx, listSnapshotInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListSnapshotInstanceProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListSnapshotInstanceProfiles(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListSnapshotInstanceProfilesOptions model
				listSnapshotInstanceProfilesOptionsModel := new(vpcv1.ListSnapshotInstanceProfilesOptions)
				listSnapshotInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listSnapshotInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listSnapshotInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListSnapshotInstanceProfiles(listSnapshotInstanceProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListSnapshotInstanceProfiles with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSnapshotInstanceProfilesOptions model
				listSnapshotInstanceProfilesOptionsModel := new(vpcv1.ListSnapshotInstanceProfilesOptions)
				listSnapshotInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listSnapshotInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listSnapshotInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListSnapshotInstanceProfiles(listSnapshotInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListSnapshotInstanceProfilesOptions model with no property values
				listSnapshotInstanceProfilesOptionsModelNew := new(vpcv1.ListSnapshotInstanceProfilesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListSnapshotInstanceProfiles(listSnapshotInstanceProfilesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListSnapshotInstanceProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSnapshotInstanceProfilesOptions model
				listSnapshotInstanceProfilesOptionsModel := new(vpcv1.ListSnapshotInstanceProfilesOptions)
				listSnapshotInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listSnapshotInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listSnapshotInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSnapshotInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListSnapshotInstanceProfiles(listSnapshotInstanceProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.SnapshotInstanceProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.SnapshotInstanceProfileCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.SnapshotInstanceProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSnapshotInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use SnapshotInstanceProfilesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSnapshotInstanceProfilesOptionsModel := &vpcv1.ListSnapshotInstanceProfilesOptions{
					ID:    core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewSnapshotInstanceProfilesPager(listSnapshotInstanceProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.InstanceProfileReference
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use SnapshotInstanceProfilesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSnapshotInstanceProfilesOptionsModel := &vpcv1.ListSnapshotInstanceProfilesOptions{
					ID:    core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewSnapshotInstanceProfilesPager(listSnapshotInstanceProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`ListSubnets(listSubnetsOptions *ListSubnetsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listSubnetsPath := "/subnets"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSubnetsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					Expect(req.URL.Query()["routing_table.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["routing_table.name"]).To(Equal([]string{"my-routing-table"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListSubnets with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSubnetsOptions model
				listSubnetsOptionsModel := new(vpcv1.ListSubnetsOptions)
				listSubnetsOptionsModel.Start = core.StringPtr("testString")
				listSubnetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSubnetsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSubnetsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listSubnetsOptionsModel.VPCID = core.StringPtr("testString")
				listSubnetsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listSubnetsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listSubnetsOptionsModel.RoutingTableID = core.StringPtr("testString")
				listSubnetsOptionsModel.RoutingTableName = core.StringPtr("my-routing-table")
				listSubnetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListSubnets(listSubnetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListSubnets(listSubnetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSubnets(listSubnetsOptions *ListSubnetsOptions)`, func() {
		version := "2024-06-23"
		listSubnetsPath := "/subnets"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSubnetsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					Expect(req.URL.Query()["routing_table.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["routing_table.name"]).To(Equal([]string{"my-routing-table"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "subnet", "routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListSubnets successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListSubnetsOptions model
				listSubnetsOptionsModel := new(vpcv1.ListSubnetsOptions)
				listSubnetsOptionsModel.Start = core.StringPtr("testString")
				listSubnetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSubnetsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSubnetsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listSubnetsOptionsModel.VPCID = core.StringPtr("testString")
				listSubnetsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listSubnetsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listSubnetsOptionsModel.RoutingTableID = core.StringPtr("testString")
				listSubnetsOptionsModel.RoutingTableName = core.StringPtr("my-routing-table")
				listSubnetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListSubnetsWithContext(ctx, listSubnetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListSubnets(listSubnetsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListSubnetsWithContext(ctx, listSubnetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSubnetsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["vpc.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					Expect(req.URL.Query()["routing_table.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["routing_table.name"]).To(Equal([]string{"my-routing-table"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "subnet", "routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListSubnets successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListSubnets(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListSubnetsOptions model
				listSubnetsOptionsModel := new(vpcv1.ListSubnetsOptions)
				listSubnetsOptionsModel.Start = core.StringPtr("testString")
				listSubnetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSubnetsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSubnetsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listSubnetsOptionsModel.VPCID = core.StringPtr("testString")
				listSubnetsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listSubnetsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listSubnetsOptionsModel.RoutingTableID = core.StringPtr("testString")
				listSubnetsOptionsModel.RoutingTableName = core.StringPtr("my-routing-table")
				listSubnetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListSubnets(listSubnetsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListSubnets with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSubnetsOptions model
				listSubnetsOptionsModel := new(vpcv1.ListSubnetsOptions)
				listSubnetsOptionsModel.Start = core.StringPtr("testString")
				listSubnetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSubnetsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSubnetsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listSubnetsOptionsModel.VPCID = core.StringPtr("testString")
				listSubnetsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listSubnetsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listSubnetsOptionsModel.RoutingTableID = core.StringPtr("testString")
				listSubnetsOptionsModel.RoutingTableName = core.StringPtr("my-routing-table")
				listSubnetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListSubnets(listSubnetsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListSubnets successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSubnetsOptions model
				listSubnetsOptionsModel := new(vpcv1.ListSubnetsOptions)
				listSubnetsOptionsModel.Start = core.StringPtr("testString")
				listSubnetsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSubnetsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listSubnetsOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listSubnetsOptionsModel.VPCID = core.StringPtr("testString")
				listSubnetsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listSubnetsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listSubnetsOptionsModel.RoutingTableID = core.StringPtr("testString")
				listSubnetsOptionsModel.RoutingTableName = core.StringPtr("my-routing-table")
				listSubnetsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListSubnets(listSubnetsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.SubnetCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.SubnetCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.SubnetCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSubnetsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"subnets":[{"available_ipv4_address_count":15,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","ip_version":"ipv4","ipv4_cidr_block":"10.0.0.0/24","name":"my-subnet","network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"public_gateway":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_type":"public_gateway"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"subnet","routing_table":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840","id":"r006-6885e83f-03b2-4603-8a86-db2a0f55c840","name":"my-routing-table-1","resource_type":"routing_table"},"status":"available","total_ipv4_address_count":256,"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"subnets":[{"available_ipv4_address_count":15,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","ip_version":"ipv4","ipv4_cidr_block":"10.0.0.0/24","name":"my-subnet","network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"public_gateway":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_type":"public_gateway"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"subnet","routing_table":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840","id":"r006-6885e83f-03b2-4603-8a86-db2a0f55c840","name":"my-routing-table-1","resource_type":"routing_table"},"status":"available","total_ipv4_address_count":256,"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use SubnetsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSubnetsOptionsModel := &vpcv1.ListSubnetsOptions{
					Limit:            core.Int64Ptr(int64(10)),
					ResourceGroupID:  core.StringPtr("testString"),
					ZoneName:         core.StringPtr("us-south-1"),
					VPCID:            core.StringPtr("testString"),
					VPCCRN:           core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:          core.StringPtr("my-vpc"),
					RoutingTableID:   core.StringPtr("testString"),
					RoutingTableName: core.StringPtr("my-routing-table"),
				}

				pager, err := vpcService.NewSubnetsPager(listSubnetsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.Subnet
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use SubnetsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSubnetsOptionsModel := &vpcv1.ListSubnetsOptions{
					Limit:            core.Int64Ptr(int64(10)),
					ResourceGroupID:  core.StringPtr("testString"),
					ZoneName:         core.StringPtr("us-south-1"),
					VPCID:            core.StringPtr("testString"),
					VPCCRN:           core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:          core.StringPtr("my-vpc"),
					RoutingTableID:   core.StringPtr("testString"),
					RoutingTableName: core.StringPtr("my-routing-table"),
				}

				pager, err := vpcService.NewSubnetsPager(listSubnetsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateSubnet(createSubnetOptions *CreateSubnetOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createSubnetPath := "/subnets"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSubnetPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateSubnet with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityByID model
				publicGatewayIdentityModel := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByID)
				publicGatewayIdentityModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SubnetPrototypeSubnetByTotalCount model
				subnetPrototypeModel := new(vpcv1.SubnetPrototypeSubnetByTotalCount)
				subnetPrototypeModel.IPVersion = core.StringPtr("ipv4")
				subnetPrototypeModel.Name = core.StringPtr("my-subnet")
				subnetPrototypeModel.NetworkACL = networkACLIdentityModel
				subnetPrototypeModel.PublicGateway = publicGatewayIdentityModel
				subnetPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				subnetPrototypeModel.RoutingTable = routingTableIdentityModel
				subnetPrototypeModel.VPC = vpcIdentityModel
				subnetPrototypeModel.TotalIpv4AddressCount = core.Int64Ptr(int64(256))
				subnetPrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateSubnetOptions model
				createSubnetOptionsModel := new(vpcv1.CreateSubnetOptions)
				createSubnetOptionsModel.SubnetPrototype = subnetPrototypeModel
				createSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateSubnet(createSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateSubnet(createSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateSubnet(createSubnetOptions *CreateSubnetOptions)`, func() {
		version := "2024-06-23"
		createSubnetPath := "/subnets"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSubnetPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "subnet", "routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateSubnet successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityByID model
				publicGatewayIdentityModel := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByID)
				publicGatewayIdentityModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SubnetPrototypeSubnetByTotalCount model
				subnetPrototypeModel := new(vpcv1.SubnetPrototypeSubnetByTotalCount)
				subnetPrototypeModel.IPVersion = core.StringPtr("ipv4")
				subnetPrototypeModel.Name = core.StringPtr("my-subnet")
				subnetPrototypeModel.NetworkACL = networkACLIdentityModel
				subnetPrototypeModel.PublicGateway = publicGatewayIdentityModel
				subnetPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				subnetPrototypeModel.RoutingTable = routingTableIdentityModel
				subnetPrototypeModel.VPC = vpcIdentityModel
				subnetPrototypeModel.TotalIpv4AddressCount = core.Int64Ptr(int64(256))
				subnetPrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateSubnetOptions model
				createSubnetOptionsModel := new(vpcv1.CreateSubnetOptions)
				createSubnetOptionsModel.SubnetPrototype = subnetPrototypeModel
				createSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateSubnetWithContext(ctx, createSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateSubnet(createSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateSubnetWithContext(ctx, createSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSubnetPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "subnet", "routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateSubnet(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityByID model
				publicGatewayIdentityModel := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByID)
				publicGatewayIdentityModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SubnetPrototypeSubnetByTotalCount model
				subnetPrototypeModel := new(vpcv1.SubnetPrototypeSubnetByTotalCount)
				subnetPrototypeModel.IPVersion = core.StringPtr("ipv4")
				subnetPrototypeModel.Name = core.StringPtr("my-subnet")
				subnetPrototypeModel.NetworkACL = networkACLIdentityModel
				subnetPrototypeModel.PublicGateway = publicGatewayIdentityModel
				subnetPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				subnetPrototypeModel.RoutingTable = routingTableIdentityModel
				subnetPrototypeModel.VPC = vpcIdentityModel
				subnetPrototypeModel.TotalIpv4AddressCount = core.Int64Ptr(int64(256))
				subnetPrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateSubnetOptions model
				createSubnetOptionsModel := new(vpcv1.CreateSubnetOptions)
				createSubnetOptionsModel.SubnetPrototype = subnetPrototypeModel
				createSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateSubnet(createSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateSubnet with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityByID model
				publicGatewayIdentityModel := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByID)
				publicGatewayIdentityModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SubnetPrototypeSubnetByTotalCount model
				subnetPrototypeModel := new(vpcv1.SubnetPrototypeSubnetByTotalCount)
				subnetPrototypeModel.IPVersion = core.StringPtr("ipv4")
				subnetPrototypeModel.Name = core.StringPtr("my-subnet")
				subnetPrototypeModel.NetworkACL = networkACLIdentityModel
				subnetPrototypeModel.PublicGateway = publicGatewayIdentityModel
				subnetPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				subnetPrototypeModel.RoutingTable = routingTableIdentityModel
				subnetPrototypeModel.VPC = vpcIdentityModel
				subnetPrototypeModel.TotalIpv4AddressCount = core.Int64Ptr(int64(256))
				subnetPrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateSubnetOptions model
				createSubnetOptionsModel := new(vpcv1.CreateSubnetOptions)
				createSubnetOptionsModel.SubnetPrototype = subnetPrototypeModel
				createSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateSubnet(createSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateSubnetOptions model with no property values
				createSubnetOptionsModelNew := new(vpcv1.CreateSubnetOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateSubnet(createSubnetOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityByID model
				publicGatewayIdentityModel := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByID)
				publicGatewayIdentityModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the SubnetPrototypeSubnetByTotalCount model
				subnetPrototypeModel := new(vpcv1.SubnetPrototypeSubnetByTotalCount)
				subnetPrototypeModel.IPVersion = core.StringPtr("ipv4")
				subnetPrototypeModel.Name = core.StringPtr("my-subnet")
				subnetPrototypeModel.NetworkACL = networkACLIdentityModel
				subnetPrototypeModel.PublicGateway = publicGatewayIdentityModel
				subnetPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				subnetPrototypeModel.RoutingTable = routingTableIdentityModel
				subnetPrototypeModel.VPC = vpcIdentityModel
				subnetPrototypeModel.TotalIpv4AddressCount = core.Int64Ptr(int64(256))
				subnetPrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateSubnetOptions model
				createSubnetOptionsModel := new(vpcv1.CreateSubnetOptions)
				createSubnetOptionsModel.SubnetPrototype = subnetPrototypeModel
				createSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateSubnet(createSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteSubnet(deleteSubnetOptions *DeleteSubnetOptions)`, func() {
		version := "2024-06-23"
		deleteSubnetPath := "/subnets/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteSubnetPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteSubnet(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteSubnetOptions model
				deleteSubnetOptionsModel := new(vpcv1.DeleteSubnetOptions)
				deleteSubnetOptionsModel.ID = core.StringPtr("testString")
				deleteSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteSubnet(deleteSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteSubnet with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteSubnetOptions model
				deleteSubnetOptionsModel := new(vpcv1.DeleteSubnetOptions)
				deleteSubnetOptionsModel.ID = core.StringPtr("testString")
				deleteSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteSubnet(deleteSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteSubnetOptions model with no property values
				deleteSubnetOptionsModelNew := new(vpcv1.DeleteSubnetOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteSubnet(deleteSubnetOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSubnet(getSubnetOptions *GetSubnetOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getSubnetPath := "/subnets/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetSubnet with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetOptions model
				getSubnetOptionsModel := new(vpcv1.GetSubnetOptions)
				getSubnetOptionsModel.ID = core.StringPtr("testString")
				getSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetSubnet(getSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetSubnet(getSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSubnet(getSubnetOptions *GetSubnetOptions)`, func() {
		version := "2024-06-23"
		getSubnetPath := "/subnets/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "subnet", "routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetSubnet successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetSubnetOptions model
				getSubnetOptionsModel := new(vpcv1.GetSubnetOptions)
				getSubnetOptionsModel.ID = core.StringPtr("testString")
				getSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetSubnetWithContext(ctx, getSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetSubnet(getSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetSubnetWithContext(ctx, getSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "subnet", "routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetSubnet(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetSubnetOptions model
				getSubnetOptionsModel := new(vpcv1.GetSubnetOptions)
				getSubnetOptionsModel.ID = core.StringPtr("testString")
				getSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetSubnet(getSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetSubnet with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetOptions model
				getSubnetOptionsModel := new(vpcv1.GetSubnetOptions)
				getSubnetOptionsModel.ID = core.StringPtr("testString")
				getSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetSubnet(getSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetSubnetOptions model with no property values
				getSubnetOptionsModelNew := new(vpcv1.GetSubnetOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetSubnet(getSubnetOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetOptions model
				getSubnetOptionsModel := new(vpcv1.GetSubnetOptions)
				getSubnetOptionsModel.ID = core.StringPtr("testString")
				getSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetSubnet(getSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateSubnet(updateSubnetOptions *UpdateSubnetOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateSubnetPath := "/subnets/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSubnetPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateSubnet with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the SubnetPublicGatewayPatchPublicGatewayIdentityByID model
				subnetPublicGatewayPatchModel := new(vpcv1.SubnetPublicGatewayPatchPublicGatewayIdentityByID)
				subnetPublicGatewayPatchModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the SubnetPatch model
				subnetPatchModel := new(vpcv1.SubnetPatch)
				subnetPatchModel.Name = core.StringPtr("my-subnet")
				subnetPatchModel.NetworkACL = networkACLIdentityModel
				subnetPatchModel.PublicGateway = subnetPublicGatewayPatchModel
				subnetPatchModel.RoutingTable = routingTableIdentityModel
				subnetPatchModelAsPatch, asPatchErr := subnetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSubnetOptions model
				updateSubnetOptionsModel := new(vpcv1.UpdateSubnetOptions)
				updateSubnetOptionsModel.ID = core.StringPtr("testString")
				updateSubnetOptionsModel.SubnetPatch = subnetPatchModelAsPatch
				updateSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateSubnet(updateSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateSubnet(updateSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateSubnet(updateSubnetOptions *UpdateSubnetOptions)`, func() {
		version := "2024-06-23"
		updateSubnetPath := "/subnets/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSubnetPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "subnet", "routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateSubnet successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the SubnetPublicGatewayPatchPublicGatewayIdentityByID model
				subnetPublicGatewayPatchModel := new(vpcv1.SubnetPublicGatewayPatchPublicGatewayIdentityByID)
				subnetPublicGatewayPatchModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the SubnetPatch model
				subnetPatchModel := new(vpcv1.SubnetPatch)
				subnetPatchModel.Name = core.StringPtr("my-subnet")
				subnetPatchModel.NetworkACL = networkACLIdentityModel
				subnetPatchModel.PublicGateway = subnetPublicGatewayPatchModel
				subnetPatchModel.RoutingTable = routingTableIdentityModel
				subnetPatchModelAsPatch, asPatchErr := subnetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSubnetOptions model
				updateSubnetOptionsModel := new(vpcv1.UpdateSubnetOptions)
				updateSubnetOptionsModel.ID = core.StringPtr("testString")
				updateSubnetOptionsModel.SubnetPatch = subnetPatchModelAsPatch
				updateSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateSubnetWithContext(ctx, updateSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateSubnet(updateSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateSubnetWithContext(ctx, updateSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSubnetPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "subnet", "routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateSubnet(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the SubnetPublicGatewayPatchPublicGatewayIdentityByID model
				subnetPublicGatewayPatchModel := new(vpcv1.SubnetPublicGatewayPatchPublicGatewayIdentityByID)
				subnetPublicGatewayPatchModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the SubnetPatch model
				subnetPatchModel := new(vpcv1.SubnetPatch)
				subnetPatchModel.Name = core.StringPtr("my-subnet")
				subnetPatchModel.NetworkACL = networkACLIdentityModel
				subnetPatchModel.PublicGateway = subnetPublicGatewayPatchModel
				subnetPatchModel.RoutingTable = routingTableIdentityModel
				subnetPatchModelAsPatch, asPatchErr := subnetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSubnetOptions model
				updateSubnetOptionsModel := new(vpcv1.UpdateSubnetOptions)
				updateSubnetOptionsModel.ID = core.StringPtr("testString")
				updateSubnetOptionsModel.SubnetPatch = subnetPatchModelAsPatch
				updateSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateSubnet(updateSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateSubnet with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the SubnetPublicGatewayPatchPublicGatewayIdentityByID model
				subnetPublicGatewayPatchModel := new(vpcv1.SubnetPublicGatewayPatchPublicGatewayIdentityByID)
				subnetPublicGatewayPatchModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the SubnetPatch model
				subnetPatchModel := new(vpcv1.SubnetPatch)
				subnetPatchModel.Name = core.StringPtr("my-subnet")
				subnetPatchModel.NetworkACL = networkACLIdentityModel
				subnetPatchModel.PublicGateway = subnetPublicGatewayPatchModel
				subnetPatchModel.RoutingTable = routingTableIdentityModel
				subnetPatchModelAsPatch, asPatchErr := subnetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSubnetOptions model
				updateSubnetOptionsModel := new(vpcv1.UpdateSubnetOptions)
				updateSubnetOptionsModel.ID = core.StringPtr("testString")
				updateSubnetOptionsModel.SubnetPatch = subnetPatchModelAsPatch
				updateSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateSubnet(updateSubnetOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateSubnetOptions model with no property values
				updateSubnetOptionsModelNew := new(vpcv1.UpdateSubnetOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateSubnet(updateSubnetOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateSubnet successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the SubnetPublicGatewayPatchPublicGatewayIdentityByID model
				subnetPublicGatewayPatchModel := new(vpcv1.SubnetPublicGatewayPatchPublicGatewayIdentityByID)
				subnetPublicGatewayPatchModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the SubnetPatch model
				subnetPatchModel := new(vpcv1.SubnetPatch)
				subnetPatchModel.Name = core.StringPtr("my-subnet")
				subnetPatchModel.NetworkACL = networkACLIdentityModel
				subnetPatchModel.PublicGateway = subnetPublicGatewayPatchModel
				subnetPatchModel.RoutingTable = routingTableIdentityModel
				subnetPatchModelAsPatch, asPatchErr := subnetPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSubnetOptions model
				updateSubnetOptionsModel := new(vpcv1.UpdateSubnetOptions)
				updateSubnetOptionsModel.ID = core.StringPtr("testString")
				updateSubnetOptionsModel.SubnetPatch = subnetPatchModelAsPatch
				updateSubnetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateSubnet(updateSubnetOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSubnetNetworkACL(getSubnetNetworkACLOptions *GetSubnetNetworkACLOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getSubnetNetworkACLPath := "/subnets/testString/network_acl"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetNetworkACLPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetSubnetNetworkACL with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetNetworkACLOptions model
				getSubnetNetworkACLOptionsModel := new(vpcv1.GetSubnetNetworkACLOptions)
				getSubnetNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getSubnetNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetSubnetNetworkACL(getSubnetNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetSubnetNetworkACL(getSubnetNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSubnetNetworkACL(getSubnetNetworkACLOptions *GetSubnetNetworkACLOptions)`, func() {
		version := "2024-06-23"
		getSubnetNetworkACLPath := "/subnets/testString/network_acl"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetNetworkACLPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetSubnetNetworkACL successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetSubnetNetworkACLOptions model
				getSubnetNetworkACLOptionsModel := new(vpcv1.GetSubnetNetworkACLOptions)
				getSubnetNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getSubnetNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetSubnetNetworkACLWithContext(ctx, getSubnetNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetSubnetNetworkACL(getSubnetNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetSubnetNetworkACLWithContext(ctx, getSubnetNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetNetworkACLPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetSubnetNetworkACL successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetSubnetNetworkACL(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetSubnetNetworkACLOptions model
				getSubnetNetworkACLOptionsModel := new(vpcv1.GetSubnetNetworkACLOptions)
				getSubnetNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getSubnetNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetSubnetNetworkACL(getSubnetNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetSubnetNetworkACL with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetNetworkACLOptions model
				getSubnetNetworkACLOptionsModel := new(vpcv1.GetSubnetNetworkACLOptions)
				getSubnetNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getSubnetNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetSubnetNetworkACL(getSubnetNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetSubnetNetworkACLOptions model with no property values
				getSubnetNetworkACLOptionsModelNew := new(vpcv1.GetSubnetNetworkACLOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetSubnetNetworkACL(getSubnetNetworkACLOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetSubnetNetworkACL successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetNetworkACLOptions model
				getSubnetNetworkACLOptionsModel := new(vpcv1.GetSubnetNetworkACLOptions)
				getSubnetNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getSubnetNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetSubnetNetworkACL(getSubnetNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ReplaceSubnetNetworkACL(replaceSubnetNetworkACLOptions *ReplaceSubnetNetworkACLOptions) - Operation response error`, func() {
		version := "2024-06-23"
		replaceSubnetNetworkACLPath := "/subnets/testString/network_acl"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(replaceSubnetNetworkACLPath))
					Expect(req.Method).To(Equal("PUT"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ReplaceSubnetNetworkACL with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the ReplaceSubnetNetworkACLOptions model
				replaceSubnetNetworkACLOptionsModel := new(vpcv1.ReplaceSubnetNetworkACLOptions)
				replaceSubnetNetworkACLOptionsModel.ID = core.StringPtr("testString")
				replaceSubnetNetworkACLOptionsModel.NetworkACLIdentity = networkACLIdentityModel
				replaceSubnetNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ReplaceSubnetNetworkACL(replaceSubnetNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ReplaceSubnetNetworkACL(replaceSubnetNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ReplaceSubnetNetworkACL(replaceSubnetNetworkACLOptions *ReplaceSubnetNetworkACLOptions)`, func() {
		version := "2024-06-23"
		replaceSubnetNetworkACLPath := "/subnets/testString/network_acl"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(replaceSubnetNetworkACLPath))
					Expect(req.Method).To(Equal("PUT"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke ReplaceSubnetNetworkACL successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the ReplaceSubnetNetworkACLOptions model
				replaceSubnetNetworkACLOptionsModel := new(vpcv1.ReplaceSubnetNetworkACLOptions)
				replaceSubnetNetworkACLOptionsModel.ID = core.StringPtr("testString")
				replaceSubnetNetworkACLOptionsModel.NetworkACLIdentity = networkACLIdentityModel
				replaceSubnetNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ReplaceSubnetNetworkACLWithContext(ctx, replaceSubnetNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ReplaceSubnetNetworkACL(replaceSubnetNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ReplaceSubnetNetworkACLWithContext(ctx, replaceSubnetNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(replaceSubnetNetworkACLPath))
					Expect(req.Method).To(Equal("PUT"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke ReplaceSubnetNetworkACL successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ReplaceSubnetNetworkACL(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the ReplaceSubnetNetworkACLOptions model
				replaceSubnetNetworkACLOptionsModel := new(vpcv1.ReplaceSubnetNetworkACLOptions)
				replaceSubnetNetworkACLOptionsModel.ID = core.StringPtr("testString")
				replaceSubnetNetworkACLOptionsModel.NetworkACLIdentity = networkACLIdentityModel
				replaceSubnetNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ReplaceSubnetNetworkACL(replaceSubnetNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ReplaceSubnetNetworkACL with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the ReplaceSubnetNetworkACLOptions model
				replaceSubnetNetworkACLOptionsModel := new(vpcv1.ReplaceSubnetNetworkACLOptions)
				replaceSubnetNetworkACLOptionsModel.ID = core.StringPtr("testString")
				replaceSubnetNetworkACLOptionsModel.NetworkACLIdentity = networkACLIdentityModel
				replaceSubnetNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ReplaceSubnetNetworkACL(replaceSubnetNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ReplaceSubnetNetworkACLOptions model with no property values
				replaceSubnetNetworkACLOptionsModelNew := new(vpcv1.ReplaceSubnetNetworkACLOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ReplaceSubnetNetworkACL(replaceSubnetNetworkACLOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke ReplaceSubnetNetworkACL successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

				// Construct an instance of the ReplaceSubnetNetworkACLOptions model
				replaceSubnetNetworkACLOptionsModel := new(vpcv1.ReplaceSubnetNetworkACLOptions)
				replaceSubnetNetworkACLOptionsModel.ID = core.StringPtr("testString")
				replaceSubnetNetworkACLOptionsModel.NetworkACLIdentity = networkACLIdentityModel
				replaceSubnetNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ReplaceSubnetNetworkACL(replaceSubnetNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UnsetSubnetPublicGateway(unsetSubnetPublicGatewayOptions *UnsetSubnetPublicGatewayOptions)`, func() {
		version := "2024-06-23"
		unsetSubnetPublicGatewayPath := "/subnets/testString/public_gateway"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(unsetSubnetPublicGatewayPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke UnsetSubnetPublicGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.UnsetSubnetPublicGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the UnsetSubnetPublicGatewayOptions model
				unsetSubnetPublicGatewayOptionsModel := new(vpcv1.UnsetSubnetPublicGatewayOptions)
				unsetSubnetPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				unsetSubnetPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.UnsetSubnetPublicGateway(unsetSubnetPublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke UnsetSubnetPublicGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the UnsetSubnetPublicGatewayOptions model
				unsetSubnetPublicGatewayOptionsModel := new(vpcv1.UnsetSubnetPublicGatewayOptions)
				unsetSubnetPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				unsetSubnetPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.UnsetSubnetPublicGateway(unsetSubnetPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the UnsetSubnetPublicGatewayOptions model with no property values
				unsetSubnetPublicGatewayOptionsModelNew := new(vpcv1.UnsetSubnetPublicGatewayOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.UnsetSubnetPublicGateway(unsetSubnetPublicGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSubnetPublicGateway(getSubnetPublicGatewayOptions *GetSubnetPublicGatewayOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getSubnetPublicGatewayPath := "/subnets/testString/public_gateway"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetPublicGatewayPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetSubnetPublicGateway with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetPublicGatewayOptions model
				getSubnetPublicGatewayOptionsModel := new(vpcv1.GetSubnetPublicGatewayOptions)
				getSubnetPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				getSubnetPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetSubnetPublicGateway(getSubnetPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetSubnetPublicGateway(getSubnetPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSubnetPublicGateway(getSubnetPublicGatewayOptions *GetSubnetPublicGatewayOptions)`, func() {
		version := "2024-06-23"
		getSubnetPublicGatewayPath := "/subnets/testString/public_gateway"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetPublicGatewayPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetSubnetPublicGateway successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetSubnetPublicGatewayOptions model
				getSubnetPublicGatewayOptionsModel := new(vpcv1.GetSubnetPublicGatewayOptions)
				getSubnetPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				getSubnetPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetSubnetPublicGatewayWithContext(ctx, getSubnetPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetSubnetPublicGateway(getSubnetPublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetSubnetPublicGatewayWithContext(ctx, getSubnetPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetPublicGatewayPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetSubnetPublicGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetSubnetPublicGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetSubnetPublicGatewayOptions model
				getSubnetPublicGatewayOptionsModel := new(vpcv1.GetSubnetPublicGatewayOptions)
				getSubnetPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				getSubnetPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetSubnetPublicGateway(getSubnetPublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetSubnetPublicGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetPublicGatewayOptions model
				getSubnetPublicGatewayOptionsModel := new(vpcv1.GetSubnetPublicGatewayOptions)
				getSubnetPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				getSubnetPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetSubnetPublicGateway(getSubnetPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetSubnetPublicGatewayOptions model with no property values
				getSubnetPublicGatewayOptionsModelNew := new(vpcv1.GetSubnetPublicGatewayOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetSubnetPublicGateway(getSubnetPublicGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetSubnetPublicGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetPublicGatewayOptions model
				getSubnetPublicGatewayOptionsModel := new(vpcv1.GetSubnetPublicGatewayOptions)
				getSubnetPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				getSubnetPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetSubnetPublicGateway(getSubnetPublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`SetSubnetPublicGateway(setSubnetPublicGatewayOptions *SetSubnetPublicGatewayOptions) - Operation response error`, func() {
		version := "2024-06-23"
		setSubnetPublicGatewayPath := "/subnets/testString/public_gateway"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(setSubnetPublicGatewayPath))
					Expect(req.Method).To(Equal("PUT"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke SetSubnetPublicGateway with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityByID model
				publicGatewayIdentityModel := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByID)
				publicGatewayIdentityModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the SetSubnetPublicGatewayOptions model
				setSubnetPublicGatewayOptionsModel := new(vpcv1.SetSubnetPublicGatewayOptions)
				setSubnetPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				setSubnetPublicGatewayOptionsModel.PublicGatewayIdentity = publicGatewayIdentityModel
				setSubnetPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.SetSubnetPublicGateway(setSubnetPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.SetSubnetPublicGateway(setSubnetPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`SetSubnetPublicGateway(setSubnetPublicGatewayOptions *SetSubnetPublicGatewayOptions)`, func() {
		version := "2024-06-23"
		setSubnetPublicGatewayPath := "/subnets/testString/public_gateway"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(setSubnetPublicGatewayPath))
					Expect(req.Method).To(Equal("PUT"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke SetSubnetPublicGateway successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityByID model
				publicGatewayIdentityModel := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByID)
				publicGatewayIdentityModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the SetSubnetPublicGatewayOptions model
				setSubnetPublicGatewayOptionsModel := new(vpcv1.SetSubnetPublicGatewayOptions)
				setSubnetPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				setSubnetPublicGatewayOptionsModel.PublicGatewayIdentity = publicGatewayIdentityModel
				setSubnetPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.SetSubnetPublicGatewayWithContext(ctx, setSubnetPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.SetSubnetPublicGateway(setSubnetPublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.SetSubnetPublicGatewayWithContext(ctx, setSubnetPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(setSubnetPublicGatewayPath))
					Expect(req.Method).To(Equal("PUT"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke SetSubnetPublicGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.SetSubnetPublicGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityByID model
				publicGatewayIdentityModel := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByID)
				publicGatewayIdentityModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the SetSubnetPublicGatewayOptions model
				setSubnetPublicGatewayOptionsModel := new(vpcv1.SetSubnetPublicGatewayOptions)
				setSubnetPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				setSubnetPublicGatewayOptionsModel.PublicGatewayIdentity = publicGatewayIdentityModel
				setSubnetPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.SetSubnetPublicGateway(setSubnetPublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke SetSubnetPublicGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityByID model
				publicGatewayIdentityModel := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByID)
				publicGatewayIdentityModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the SetSubnetPublicGatewayOptions model
				setSubnetPublicGatewayOptionsModel := new(vpcv1.SetSubnetPublicGatewayOptions)
				setSubnetPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				setSubnetPublicGatewayOptionsModel.PublicGatewayIdentity = publicGatewayIdentityModel
				setSubnetPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.SetSubnetPublicGateway(setSubnetPublicGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the SetSubnetPublicGatewayOptions model with no property values
				setSubnetPublicGatewayOptionsModelNew := new(vpcv1.SetSubnetPublicGatewayOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.SetSubnetPublicGateway(setSubnetPublicGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke SetSubnetPublicGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityByID model
				publicGatewayIdentityModel := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByID)
				publicGatewayIdentityModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

				// Construct an instance of the SetSubnetPublicGatewayOptions model
				setSubnetPublicGatewayOptionsModel := new(vpcv1.SetSubnetPublicGatewayOptions)
				setSubnetPublicGatewayOptionsModel.ID = core.StringPtr("testString")
				setSubnetPublicGatewayOptionsModel.PublicGatewayIdentity = publicGatewayIdentityModel
				setSubnetPublicGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.SetSubnetPublicGateway(setSubnetPublicGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSubnetRoutingTable(getSubnetRoutingTableOptions *GetSubnetRoutingTableOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getSubnetRoutingTablePath := "/subnets/testString/routing_table"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetRoutingTablePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetSubnetRoutingTable with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetRoutingTableOptions model
				getSubnetRoutingTableOptionsModel := new(vpcv1.GetSubnetRoutingTableOptions)
				getSubnetRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getSubnetRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetSubnetRoutingTable(getSubnetRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetSubnetRoutingTable(getSubnetRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSubnetRoutingTable(getSubnetRoutingTableOptions *GetSubnetRoutingTableOptions)`, func() {
		version := "2024-06-23"
		getSubnetRoutingTablePath := "/subnets/testString/routing_table"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetRoutingTablePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": false, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": true, "route_internet_ingress": true, "route_transit_gateway_ingress": true, "route_vpc_zone_ingress": false, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "name": "my-vpc-routing-table-route"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}`)
				}))
			})
			It(`Invoke GetSubnetRoutingTable successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetSubnetRoutingTableOptions model
				getSubnetRoutingTableOptionsModel := new(vpcv1.GetSubnetRoutingTableOptions)
				getSubnetRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getSubnetRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetSubnetRoutingTableWithContext(ctx, getSubnetRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetSubnetRoutingTable(getSubnetRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetSubnetRoutingTableWithContext(ctx, getSubnetRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetRoutingTablePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": false, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": true, "route_internet_ingress": true, "route_transit_gateway_ingress": true, "route_vpc_zone_ingress": false, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "name": "my-vpc-routing-table-route"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}`)
				}))
			})
			It(`Invoke GetSubnetRoutingTable successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetSubnetRoutingTable(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetSubnetRoutingTableOptions model
				getSubnetRoutingTableOptionsModel := new(vpcv1.GetSubnetRoutingTableOptions)
				getSubnetRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getSubnetRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetSubnetRoutingTable(getSubnetRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetSubnetRoutingTable with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetRoutingTableOptions model
				getSubnetRoutingTableOptionsModel := new(vpcv1.GetSubnetRoutingTableOptions)
				getSubnetRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getSubnetRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetSubnetRoutingTable(getSubnetRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetSubnetRoutingTableOptions model with no property values
				getSubnetRoutingTableOptionsModelNew := new(vpcv1.GetSubnetRoutingTableOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetSubnetRoutingTable(getSubnetRoutingTableOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetSubnetRoutingTable successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetRoutingTableOptions model
				getSubnetRoutingTableOptionsModel := new(vpcv1.GetSubnetRoutingTableOptions)
				getSubnetRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getSubnetRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetSubnetRoutingTable(getSubnetRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ReplaceSubnetRoutingTable(replaceSubnetRoutingTableOptions *ReplaceSubnetRoutingTableOptions) - Operation response error`, func() {
		version := "2024-06-23"
		replaceSubnetRoutingTablePath := "/subnets/testString/routing_table"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(replaceSubnetRoutingTablePath))
					Expect(req.Method).To(Equal("PUT"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ReplaceSubnetRoutingTable with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the ReplaceSubnetRoutingTableOptions model
				replaceSubnetRoutingTableOptionsModel := new(vpcv1.ReplaceSubnetRoutingTableOptions)
				replaceSubnetRoutingTableOptionsModel.ID = core.StringPtr("testString")
				replaceSubnetRoutingTableOptionsModel.RoutingTableIdentity = routingTableIdentityModel
				replaceSubnetRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ReplaceSubnetRoutingTable(replaceSubnetRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ReplaceSubnetRoutingTable(replaceSubnetRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ReplaceSubnetRoutingTable(replaceSubnetRoutingTableOptions *ReplaceSubnetRoutingTableOptions)`, func() {
		version := "2024-06-23"
		replaceSubnetRoutingTablePath := "/subnets/testString/routing_table"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(replaceSubnetRoutingTablePath))
					Expect(req.Method).To(Equal("PUT"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": false, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": true, "route_internet_ingress": true, "route_transit_gateway_ingress": true, "route_vpc_zone_ingress": false, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "name": "my-vpc-routing-table-route"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}`)
				}))
			})
			It(`Invoke ReplaceSubnetRoutingTable successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the ReplaceSubnetRoutingTableOptions model
				replaceSubnetRoutingTableOptionsModel := new(vpcv1.ReplaceSubnetRoutingTableOptions)
				replaceSubnetRoutingTableOptionsModel.ID = core.StringPtr("testString")
				replaceSubnetRoutingTableOptionsModel.RoutingTableIdentity = routingTableIdentityModel
				replaceSubnetRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ReplaceSubnetRoutingTableWithContext(ctx, replaceSubnetRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ReplaceSubnetRoutingTable(replaceSubnetRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ReplaceSubnetRoutingTableWithContext(ctx, replaceSubnetRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(replaceSubnetRoutingTablePath))
					Expect(req.Method).To(Equal("PUT"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": false, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": true, "route_internet_ingress": true, "route_transit_gateway_ingress": true, "route_vpc_zone_ingress": false, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "name": "my-vpc-routing-table-route"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}`)
				}))
			})
			It(`Invoke ReplaceSubnetRoutingTable successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ReplaceSubnetRoutingTable(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the ReplaceSubnetRoutingTableOptions model
				replaceSubnetRoutingTableOptionsModel := new(vpcv1.ReplaceSubnetRoutingTableOptions)
				replaceSubnetRoutingTableOptionsModel.ID = core.StringPtr("testString")
				replaceSubnetRoutingTableOptionsModel.RoutingTableIdentity = routingTableIdentityModel
				replaceSubnetRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ReplaceSubnetRoutingTable(replaceSubnetRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ReplaceSubnetRoutingTable with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the ReplaceSubnetRoutingTableOptions model
				replaceSubnetRoutingTableOptionsModel := new(vpcv1.ReplaceSubnetRoutingTableOptions)
				replaceSubnetRoutingTableOptionsModel.ID = core.StringPtr("testString")
				replaceSubnetRoutingTableOptionsModel.RoutingTableIdentity = routingTableIdentityModel
				replaceSubnetRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ReplaceSubnetRoutingTable(replaceSubnetRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ReplaceSubnetRoutingTableOptions model with no property values
				replaceSubnetRoutingTableOptionsModelNew := new(vpcv1.ReplaceSubnetRoutingTableOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ReplaceSubnetRoutingTable(replaceSubnetRoutingTableOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke ReplaceSubnetRoutingTable successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

				// Construct an instance of the ReplaceSubnetRoutingTableOptions model
				replaceSubnetRoutingTableOptionsModel := new(vpcv1.ReplaceSubnetRoutingTableOptions)
				replaceSubnetRoutingTableOptionsModel.ID = core.StringPtr("testString")
				replaceSubnetRoutingTableOptionsModel.RoutingTableIdentity = routingTableIdentityModel
				replaceSubnetRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ReplaceSubnetRoutingTable(replaceSubnetRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSubnetReservedIps(listSubnetReservedIpsOptions *ListSubnetReservedIpsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listSubnetReservedIpsPath := "/subnets/testString/reserved_ips"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSubnetReservedIpsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["target.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"}))
					Expect(req.URL.Query()["target.name"]).To(Equal([]string{"my-resource"}))
					Expect(req.URL.Query()["target.resource_type"]).To(Equal([]string{"testString"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListSubnetReservedIps with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSubnetReservedIpsOptions model
				listSubnetReservedIpsOptionsModel := new(vpcv1.ListSubnetReservedIpsOptions)
				listSubnetReservedIpsOptionsModel.SubnetID = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Start = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSubnetReservedIpsOptionsModel.Sort = core.StringPtr("name")
				listSubnetReservedIpsOptionsModel.TargetID = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
				listSubnetReservedIpsOptionsModel.TargetName = core.StringPtr("my-resource")
				listSubnetReservedIpsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListSubnetReservedIps(listSubnetReservedIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListSubnetReservedIps(listSubnetReservedIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListSubnetReservedIps(listSubnetReservedIpsOptions *ListSubnetReservedIpsOptions)`, func() {
		version := "2024-06-23"
		listSubnetReservedIpsPath := "/subnets/testString/reserved_ips"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSubnetReservedIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["target.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"}))
					Expect(req.URL.Query()["target.name"]).To(Equal([]string{"my-resource"}))
					Expect(req.URL.Query()["target.resource_type"]).To(Equal([]string{"testString"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "reserved_ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListSubnetReservedIps successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListSubnetReservedIpsOptions model
				listSubnetReservedIpsOptionsModel := new(vpcv1.ListSubnetReservedIpsOptions)
				listSubnetReservedIpsOptionsModel.SubnetID = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Start = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSubnetReservedIpsOptionsModel.Sort = core.StringPtr("name")
				listSubnetReservedIpsOptionsModel.TargetID = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
				listSubnetReservedIpsOptionsModel.TargetName = core.StringPtr("my-resource")
				listSubnetReservedIpsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListSubnetReservedIpsWithContext(ctx, listSubnetReservedIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListSubnetReservedIps(listSubnetReservedIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListSubnetReservedIpsWithContext(ctx, listSubnetReservedIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSubnetReservedIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["target.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["target.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"}))
					Expect(req.URL.Query()["target.name"]).To(Equal([]string{"my-resource"}))
					Expect(req.URL.Query()["target.resource_type"]).To(Equal([]string{"testString"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "reserved_ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListSubnetReservedIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListSubnetReservedIps(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListSubnetReservedIpsOptions model
				listSubnetReservedIpsOptionsModel := new(vpcv1.ListSubnetReservedIpsOptions)
				listSubnetReservedIpsOptionsModel.SubnetID = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Start = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSubnetReservedIpsOptionsModel.Sort = core.StringPtr("name")
				listSubnetReservedIpsOptionsModel.TargetID = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
				listSubnetReservedIpsOptionsModel.TargetName = core.StringPtr("my-resource")
				listSubnetReservedIpsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListSubnetReservedIps(listSubnetReservedIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListSubnetReservedIps with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSubnetReservedIpsOptions model
				listSubnetReservedIpsOptionsModel := new(vpcv1.ListSubnetReservedIpsOptions)
				listSubnetReservedIpsOptionsModel.SubnetID = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Start = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSubnetReservedIpsOptionsModel.Sort = core.StringPtr("name")
				listSubnetReservedIpsOptionsModel.TargetID = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
				listSubnetReservedIpsOptionsModel.TargetName = core.StringPtr("my-resource")
				listSubnetReservedIpsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListSubnetReservedIps(listSubnetReservedIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListSubnetReservedIpsOptions model with no property values
				listSubnetReservedIpsOptionsModelNew := new(vpcv1.ListSubnetReservedIpsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListSubnetReservedIps(listSubnetReservedIpsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListSubnetReservedIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListSubnetReservedIpsOptions model
				listSubnetReservedIpsOptionsModel := new(vpcv1.ListSubnetReservedIpsOptions)
				listSubnetReservedIpsOptionsModel.SubnetID = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Start = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listSubnetReservedIpsOptionsModel.Sort = core.StringPtr("name")
				listSubnetReservedIpsOptionsModel.TargetID = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
				listSubnetReservedIpsOptionsModel.TargetName = core.StringPtr("my-resource")
				listSubnetReservedIpsOptionsModel.TargetResourceType = core.StringPtr("testString")
				listSubnetReservedIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListSubnetReservedIps(listSubnetReservedIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ReservedIPCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ReservedIPCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ReservedIPCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listSubnetReservedIpsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"reserved_ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"provider","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","id":"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"reserved_ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"provider","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","id":"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use SubnetReservedIpsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSubnetReservedIpsOptionsModel := &vpcv1.ListSubnetReservedIpsOptions{
					SubnetID:           core.StringPtr("testString"),
					Limit:              core.Int64Ptr(int64(10)),
					Sort:               core.StringPtr("name"),
					TargetID:           core.StringPtr("testString"),
					TargetCRN:          core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"),
					TargetName:         core.StringPtr("my-resource"),
					TargetResourceType: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewSubnetReservedIpsPager(listSubnetReservedIpsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.ReservedIP
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use SubnetReservedIpsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listSubnetReservedIpsOptionsModel := &vpcv1.ListSubnetReservedIpsOptions{
					SubnetID:           core.StringPtr("testString"),
					Limit:              core.Int64Ptr(int64(10)),
					Sort:               core.StringPtr("name"),
					TargetID:           core.StringPtr("testString"),
					TargetCRN:          core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"),
					TargetName:         core.StringPtr("my-resource"),
					TargetResourceType: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewSubnetReservedIpsPager(listSubnetReservedIpsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateSubnetReservedIP(createSubnetReservedIPOptions *CreateSubnetReservedIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createSubnetReservedIPPath := "/subnets/testString/reserved_ips"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSubnetReservedIPPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateSubnetReservedIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID model
				reservedIPTargetPrototypeModel := new(vpcv1.ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID)
				reservedIPTargetPrototypeModel.ID = core.StringPtr("r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")

				// Construct an instance of the CreateSubnetReservedIPOptions model
				createSubnetReservedIPOptionsModel := new(vpcv1.CreateSubnetReservedIPOptions)
				createSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				createSubnetReservedIPOptionsModel.Address = core.StringPtr("192.168.3.4")
				createSubnetReservedIPOptionsModel.AutoDelete = core.BoolPtr(false)
				createSubnetReservedIPOptionsModel.Name = core.StringPtr("my-reserved-ip")
				createSubnetReservedIPOptionsModel.Target = reservedIPTargetPrototypeModel
				createSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateSubnetReservedIP(createSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateSubnetReservedIP(createSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateSubnetReservedIP(createSubnetReservedIPOptions *CreateSubnetReservedIPOptions)`, func() {
		version := "2024-06-23"
		createSubnetReservedIPPath := "/subnets/testString/reserved_ips"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSubnetReservedIPPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}`)
				}))
			})
			It(`Invoke CreateSubnetReservedIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID model
				reservedIPTargetPrototypeModel := new(vpcv1.ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID)
				reservedIPTargetPrototypeModel.ID = core.StringPtr("r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")

				// Construct an instance of the CreateSubnetReservedIPOptions model
				createSubnetReservedIPOptionsModel := new(vpcv1.CreateSubnetReservedIPOptions)
				createSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				createSubnetReservedIPOptionsModel.Address = core.StringPtr("192.168.3.4")
				createSubnetReservedIPOptionsModel.AutoDelete = core.BoolPtr(false)
				createSubnetReservedIPOptionsModel.Name = core.StringPtr("my-reserved-ip")
				createSubnetReservedIPOptionsModel.Target = reservedIPTargetPrototypeModel
				createSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateSubnetReservedIPWithContext(ctx, createSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateSubnetReservedIP(createSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateSubnetReservedIPWithContext(ctx, createSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createSubnetReservedIPPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}`)
				}))
			})
			It(`Invoke CreateSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateSubnetReservedIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID model
				reservedIPTargetPrototypeModel := new(vpcv1.ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID)
				reservedIPTargetPrototypeModel.ID = core.StringPtr("r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")

				// Construct an instance of the CreateSubnetReservedIPOptions model
				createSubnetReservedIPOptionsModel := new(vpcv1.CreateSubnetReservedIPOptions)
				createSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				createSubnetReservedIPOptionsModel.Address = core.StringPtr("192.168.3.4")
				createSubnetReservedIPOptionsModel.AutoDelete = core.BoolPtr(false)
				createSubnetReservedIPOptionsModel.Name = core.StringPtr("my-reserved-ip")
				createSubnetReservedIPOptionsModel.Target = reservedIPTargetPrototypeModel
				createSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateSubnetReservedIP(createSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateSubnetReservedIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID model
				reservedIPTargetPrototypeModel := new(vpcv1.ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID)
				reservedIPTargetPrototypeModel.ID = core.StringPtr("r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")

				// Construct an instance of the CreateSubnetReservedIPOptions model
				createSubnetReservedIPOptionsModel := new(vpcv1.CreateSubnetReservedIPOptions)
				createSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				createSubnetReservedIPOptionsModel.Address = core.StringPtr("192.168.3.4")
				createSubnetReservedIPOptionsModel.AutoDelete = core.BoolPtr(false)
				createSubnetReservedIPOptionsModel.Name = core.StringPtr("my-reserved-ip")
				createSubnetReservedIPOptionsModel.Target = reservedIPTargetPrototypeModel
				createSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateSubnetReservedIP(createSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateSubnetReservedIPOptions model with no property values
				createSubnetReservedIPOptionsModelNew := new(vpcv1.CreateSubnetReservedIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateSubnetReservedIP(createSubnetReservedIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID model
				reservedIPTargetPrototypeModel := new(vpcv1.ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID)
				reservedIPTargetPrototypeModel.ID = core.StringPtr("r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")

				// Construct an instance of the CreateSubnetReservedIPOptions model
				createSubnetReservedIPOptionsModel := new(vpcv1.CreateSubnetReservedIPOptions)
				createSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				createSubnetReservedIPOptionsModel.Address = core.StringPtr("192.168.3.4")
				createSubnetReservedIPOptionsModel.AutoDelete = core.BoolPtr(false)
				createSubnetReservedIPOptionsModel.Name = core.StringPtr("my-reserved-ip")
				createSubnetReservedIPOptionsModel.Target = reservedIPTargetPrototypeModel
				createSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateSubnetReservedIP(createSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteSubnetReservedIP(deleteSubnetReservedIPOptions *DeleteSubnetReservedIPOptions)`, func() {
		version := "2024-06-23"
		deleteSubnetReservedIPPath := "/subnets/testString/reserved_ips/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteSubnetReservedIPPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteSubnetReservedIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteSubnetReservedIPOptions model
				deleteSubnetReservedIPOptionsModel := new(vpcv1.DeleteSubnetReservedIPOptions)
				deleteSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				deleteSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				deleteSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteSubnetReservedIP(deleteSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteSubnetReservedIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteSubnetReservedIPOptions model
				deleteSubnetReservedIPOptionsModel := new(vpcv1.DeleteSubnetReservedIPOptions)
				deleteSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				deleteSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				deleteSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteSubnetReservedIP(deleteSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteSubnetReservedIPOptions model with no property values
				deleteSubnetReservedIPOptionsModelNew := new(vpcv1.DeleteSubnetReservedIPOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteSubnetReservedIP(deleteSubnetReservedIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSubnetReservedIP(getSubnetReservedIPOptions *GetSubnetReservedIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getSubnetReservedIPPath := "/subnets/testString/reserved_ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetReservedIPPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetSubnetReservedIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetReservedIPOptions model
				getSubnetReservedIPOptionsModel := new(vpcv1.GetSubnetReservedIPOptions)
				getSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				getSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				getSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetSubnetReservedIP(getSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetSubnetReservedIP(getSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetSubnetReservedIP(getSubnetReservedIPOptions *GetSubnetReservedIPOptions)`, func() {
		version := "2024-06-23"
		getSubnetReservedIPPath := "/subnets/testString/reserved_ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetReservedIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}`)
				}))
			})
			It(`Invoke GetSubnetReservedIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetSubnetReservedIPOptions model
				getSubnetReservedIPOptionsModel := new(vpcv1.GetSubnetReservedIPOptions)
				getSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				getSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				getSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetSubnetReservedIPWithContext(ctx, getSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetSubnetReservedIP(getSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetSubnetReservedIPWithContext(ctx, getSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getSubnetReservedIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}`)
				}))
			})
			It(`Invoke GetSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetSubnetReservedIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetSubnetReservedIPOptions model
				getSubnetReservedIPOptionsModel := new(vpcv1.GetSubnetReservedIPOptions)
				getSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				getSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				getSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetSubnetReservedIP(getSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetSubnetReservedIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetReservedIPOptions model
				getSubnetReservedIPOptionsModel := new(vpcv1.GetSubnetReservedIPOptions)
				getSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				getSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				getSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetSubnetReservedIP(getSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetSubnetReservedIPOptions model with no property values
				getSubnetReservedIPOptionsModelNew := new(vpcv1.GetSubnetReservedIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetSubnetReservedIP(getSubnetReservedIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetSubnetReservedIPOptions model
				getSubnetReservedIPOptionsModel := new(vpcv1.GetSubnetReservedIPOptions)
				getSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				getSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				getSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetSubnetReservedIP(getSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateSubnetReservedIP(updateSubnetReservedIPOptions *UpdateSubnetReservedIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateSubnetReservedIPPath := "/subnets/testString/reserved_ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSubnetReservedIPPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateSubnetReservedIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ReservedIPPatch model
				reservedIPPatchModel := new(vpcv1.ReservedIPPatch)
				reservedIPPatchModel.AutoDelete = core.BoolPtr(false)
				reservedIPPatchModel.Name = core.StringPtr("my-reserved-ip-updated")
				reservedIPPatchModelAsPatch, asPatchErr := reservedIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSubnetReservedIPOptions model
				updateSubnetReservedIPOptionsModel := new(vpcv1.UpdateSubnetReservedIPOptions)
				updateSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				updateSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				updateSubnetReservedIPOptionsModel.ReservedIPPatch = reservedIPPatchModelAsPatch
				updateSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateSubnetReservedIP(updateSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateSubnetReservedIP(updateSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateSubnetReservedIP(updateSubnetReservedIPOptions *UpdateSubnetReservedIPOptions)`, func() {
		version := "2024-06-23"
		updateSubnetReservedIPPath := "/subnets/testString/reserved_ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSubnetReservedIPPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}`)
				}))
			})
			It(`Invoke UpdateSubnetReservedIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ReservedIPPatch model
				reservedIPPatchModel := new(vpcv1.ReservedIPPatch)
				reservedIPPatchModel.AutoDelete = core.BoolPtr(false)
				reservedIPPatchModel.Name = core.StringPtr("my-reserved-ip-updated")
				reservedIPPatchModelAsPatch, asPatchErr := reservedIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSubnetReservedIPOptions model
				updateSubnetReservedIPOptionsModel := new(vpcv1.UpdateSubnetReservedIPOptions)
				updateSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				updateSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				updateSubnetReservedIPOptionsModel.ReservedIPPatch = reservedIPPatchModelAsPatch
				updateSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateSubnetReservedIPWithContext(ctx, updateSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateSubnetReservedIP(updateSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateSubnetReservedIPWithContext(ctx, updateSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateSubnetReservedIPPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}`)
				}))
			})
			It(`Invoke UpdateSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateSubnetReservedIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ReservedIPPatch model
				reservedIPPatchModel := new(vpcv1.ReservedIPPatch)
				reservedIPPatchModel.AutoDelete = core.BoolPtr(false)
				reservedIPPatchModel.Name = core.StringPtr("my-reserved-ip-updated")
				reservedIPPatchModelAsPatch, asPatchErr := reservedIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSubnetReservedIPOptions model
				updateSubnetReservedIPOptionsModel := new(vpcv1.UpdateSubnetReservedIPOptions)
				updateSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				updateSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				updateSubnetReservedIPOptionsModel.ReservedIPPatch = reservedIPPatchModelAsPatch
				updateSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateSubnetReservedIP(updateSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateSubnetReservedIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ReservedIPPatch model
				reservedIPPatchModel := new(vpcv1.ReservedIPPatch)
				reservedIPPatchModel.AutoDelete = core.BoolPtr(false)
				reservedIPPatchModel.Name = core.StringPtr("my-reserved-ip-updated")
				reservedIPPatchModelAsPatch, asPatchErr := reservedIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSubnetReservedIPOptions model
				updateSubnetReservedIPOptionsModel := new(vpcv1.UpdateSubnetReservedIPOptions)
				updateSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				updateSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				updateSubnetReservedIPOptionsModel.ReservedIPPatch = reservedIPPatchModelAsPatch
				updateSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateSubnetReservedIP(updateSubnetReservedIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateSubnetReservedIPOptions model with no property values
				updateSubnetReservedIPOptionsModelNew := new(vpcv1.UpdateSubnetReservedIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateSubnetReservedIP(updateSubnetReservedIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateSubnetReservedIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ReservedIPPatch model
				reservedIPPatchModel := new(vpcv1.ReservedIPPatch)
				reservedIPPatchModel.AutoDelete = core.BoolPtr(false)
				reservedIPPatchModel.Name = core.StringPtr("my-reserved-ip-updated")
				reservedIPPatchModelAsPatch, asPatchErr := reservedIPPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateSubnetReservedIPOptions model
				updateSubnetReservedIPOptionsModel := new(vpcv1.UpdateSubnetReservedIPOptions)
				updateSubnetReservedIPOptionsModel.SubnetID = core.StringPtr("testString")
				updateSubnetReservedIPOptionsModel.ID = core.StringPtr("testString")
				updateSubnetReservedIPOptionsModel.ReservedIPPatch = reservedIPPatchModelAsPatch
				updateSubnetReservedIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateSubnetReservedIP(updateSubnetReservedIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptions *ListVirtualNetworkInterfacesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVirtualNetworkInterfacesPath := "/virtual_network_interfaces"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVirtualNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVirtualNetworkInterfaces with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVirtualNetworkInterfacesOptions model
				listVirtualNetworkInterfacesOptionsModel := new(vpcv1.ListVirtualNetworkInterfacesOptions)
				listVirtualNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listVirtualNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVirtualNetworkInterfacesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVirtualNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptions *ListVirtualNetworkInterfacesOptions)`, func() {
		version := "2024-06-23"
		listVirtualNetworkInterfacesPath := "/virtual_network_interfaces"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVirtualNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132, "virtual_network_interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}`)
				}))
			})
			It(`Invoke ListVirtualNetworkInterfaces successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVirtualNetworkInterfacesOptions model
				listVirtualNetworkInterfacesOptionsModel := new(vpcv1.ListVirtualNetworkInterfacesOptions)
				listVirtualNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listVirtualNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVirtualNetworkInterfacesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVirtualNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVirtualNetworkInterfacesWithContext(ctx, listVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVirtualNetworkInterfacesWithContext(ctx, listVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVirtualNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132, "virtual_network_interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}`)
				}))
			})
			It(`Invoke ListVirtualNetworkInterfaces successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVirtualNetworkInterfaces(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVirtualNetworkInterfacesOptions model
				listVirtualNetworkInterfacesOptionsModel := new(vpcv1.ListVirtualNetworkInterfacesOptions)
				listVirtualNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listVirtualNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVirtualNetworkInterfacesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVirtualNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVirtualNetworkInterfaces with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVirtualNetworkInterfacesOptions model
				listVirtualNetworkInterfacesOptionsModel := new(vpcv1.ListVirtualNetworkInterfacesOptions)
				listVirtualNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listVirtualNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVirtualNetworkInterfacesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVirtualNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVirtualNetworkInterfaces successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVirtualNetworkInterfacesOptions model
				listVirtualNetworkInterfacesOptionsModel := new(vpcv1.ListVirtualNetworkInterfacesOptions)
				listVirtualNetworkInterfacesOptionsModel.Start = core.StringPtr("testString")
				listVirtualNetworkInterfacesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVirtualNetworkInterfacesOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVirtualNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.VirtualNetworkInterfaceCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.VirtualNetworkInterfaceCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.VirtualNetworkInterfaceCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVirtualNetworkInterfacesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"virtual_network_interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","enable_infrastructure_nat":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"protocol_state_filtering_mode":"auto","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1","id":"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"virtual_network_interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","enable_infrastructure_nat":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"protocol_state_filtering_mode":"auto","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1","id":"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VirtualNetworkInterfacesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVirtualNetworkInterfacesOptionsModel := &vpcv1.ListVirtualNetworkInterfacesOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewVirtualNetworkInterfacesPager(listVirtualNetworkInterfacesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.VirtualNetworkInterface
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VirtualNetworkInterfacesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVirtualNetworkInterfacesOptionsModel := &vpcv1.ListVirtualNetworkInterfacesOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
				}

				pager, err := vpcService.NewVirtualNetworkInterfacesPager(listVirtualNetworkInterfacesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateVirtualNetworkInterface(createVirtualNetworkInterfaceOptions *CreateVirtualNetworkInterfaceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createVirtualNetworkInterfacePath := "/virtual_network_interfaces"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVirtualNetworkInterfacePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateVirtualNetworkInterface with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID)
				virtualNetworkInterfaceIPPrototypeModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID)
				virtualNetworkInterfacePrimaryIPPrototypeModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("69e55145-cc7d-4d8e-9e1f-cc3fb60b1793")

				// Construct an instance of the CreateVirtualNetworkInterfaceOptions model
				createVirtualNetworkInterfaceOptionsModel := new(vpcv1.CreateVirtualNetworkInterfaceOptions)
				createVirtualNetworkInterfaceOptionsModel.AllowIPSpoofing = core.BoolPtr(false)
				createVirtualNetworkInterfaceOptionsModel.AutoDelete = core.BoolPtr(false)
				createVirtualNetworkInterfaceOptionsModel.EnableInfrastructureNat = core.BoolPtr(true)
				createVirtualNetworkInterfaceOptionsModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				createVirtualNetworkInterfaceOptionsModel.Name = core.StringPtr("my-virtual-network-interface")
				createVirtualNetworkInterfaceOptionsModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				createVirtualNetworkInterfaceOptionsModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				createVirtualNetworkInterfaceOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVirtualNetworkInterfaceOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createVirtualNetworkInterfaceOptionsModel.Subnet = subnetIdentityModel
				createVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateVirtualNetworkInterface(createVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateVirtualNetworkInterface(createVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateVirtualNetworkInterface(createVirtualNetworkInterfaceOptions *CreateVirtualNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		createVirtualNetworkInterfacePath := "/virtual_network_interfaces"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVirtualNetworkInterfacePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateVirtualNetworkInterface successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID)
				virtualNetworkInterfaceIPPrototypeModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID)
				virtualNetworkInterfacePrimaryIPPrototypeModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("69e55145-cc7d-4d8e-9e1f-cc3fb60b1793")

				// Construct an instance of the CreateVirtualNetworkInterfaceOptions model
				createVirtualNetworkInterfaceOptionsModel := new(vpcv1.CreateVirtualNetworkInterfaceOptions)
				createVirtualNetworkInterfaceOptionsModel.AllowIPSpoofing = core.BoolPtr(false)
				createVirtualNetworkInterfaceOptionsModel.AutoDelete = core.BoolPtr(false)
				createVirtualNetworkInterfaceOptionsModel.EnableInfrastructureNat = core.BoolPtr(true)
				createVirtualNetworkInterfaceOptionsModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				createVirtualNetworkInterfaceOptionsModel.Name = core.StringPtr("my-virtual-network-interface")
				createVirtualNetworkInterfaceOptionsModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				createVirtualNetworkInterfaceOptionsModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				createVirtualNetworkInterfaceOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVirtualNetworkInterfaceOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createVirtualNetworkInterfaceOptionsModel.Subnet = subnetIdentityModel
				createVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateVirtualNetworkInterfaceWithContext(ctx, createVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateVirtualNetworkInterface(createVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateVirtualNetworkInterfaceWithContext(ctx, createVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVirtualNetworkInterfacePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateVirtualNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateVirtualNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID)
				virtualNetworkInterfaceIPPrototypeModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID)
				virtualNetworkInterfacePrimaryIPPrototypeModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("69e55145-cc7d-4d8e-9e1f-cc3fb60b1793")

				// Construct an instance of the CreateVirtualNetworkInterfaceOptions model
				createVirtualNetworkInterfaceOptionsModel := new(vpcv1.CreateVirtualNetworkInterfaceOptions)
				createVirtualNetworkInterfaceOptionsModel.AllowIPSpoofing = core.BoolPtr(false)
				createVirtualNetworkInterfaceOptionsModel.AutoDelete = core.BoolPtr(false)
				createVirtualNetworkInterfaceOptionsModel.EnableInfrastructureNat = core.BoolPtr(true)
				createVirtualNetworkInterfaceOptionsModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				createVirtualNetworkInterfaceOptionsModel.Name = core.StringPtr("my-virtual-network-interface")
				createVirtualNetworkInterfaceOptionsModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				createVirtualNetworkInterfaceOptionsModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				createVirtualNetworkInterfaceOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVirtualNetworkInterfaceOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createVirtualNetworkInterfaceOptionsModel.Subnet = subnetIdentityModel
				createVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateVirtualNetworkInterface(createVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateVirtualNetworkInterface with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID)
				virtualNetworkInterfaceIPPrototypeModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID)
				virtualNetworkInterfacePrimaryIPPrototypeModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("69e55145-cc7d-4d8e-9e1f-cc3fb60b1793")

				// Construct an instance of the CreateVirtualNetworkInterfaceOptions model
				createVirtualNetworkInterfaceOptionsModel := new(vpcv1.CreateVirtualNetworkInterfaceOptions)
				createVirtualNetworkInterfaceOptionsModel.AllowIPSpoofing = core.BoolPtr(false)
				createVirtualNetworkInterfaceOptionsModel.AutoDelete = core.BoolPtr(false)
				createVirtualNetworkInterfaceOptionsModel.EnableInfrastructureNat = core.BoolPtr(true)
				createVirtualNetworkInterfaceOptionsModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				createVirtualNetworkInterfaceOptionsModel.Name = core.StringPtr("my-virtual-network-interface")
				createVirtualNetworkInterfaceOptionsModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				createVirtualNetworkInterfaceOptionsModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				createVirtualNetworkInterfaceOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVirtualNetworkInterfaceOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createVirtualNetworkInterfaceOptionsModel.Subnet = subnetIdentityModel
				createVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateVirtualNetworkInterface(createVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateVirtualNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID)
				virtualNetworkInterfaceIPPrototypeModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID)
				virtualNetworkInterfacePrimaryIPPrototypeModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("69e55145-cc7d-4d8e-9e1f-cc3fb60b1793")

				// Construct an instance of the CreateVirtualNetworkInterfaceOptions model
				createVirtualNetworkInterfaceOptionsModel := new(vpcv1.CreateVirtualNetworkInterfaceOptions)
				createVirtualNetworkInterfaceOptionsModel.AllowIPSpoofing = core.BoolPtr(false)
				createVirtualNetworkInterfaceOptionsModel.AutoDelete = core.BoolPtr(false)
				createVirtualNetworkInterfaceOptionsModel.EnableInfrastructureNat = core.BoolPtr(true)
				createVirtualNetworkInterfaceOptionsModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				createVirtualNetworkInterfaceOptionsModel.Name = core.StringPtr("my-virtual-network-interface")
				createVirtualNetworkInterfaceOptionsModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				createVirtualNetworkInterfaceOptionsModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				createVirtualNetworkInterfaceOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVirtualNetworkInterfaceOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createVirtualNetworkInterfaceOptionsModel.Subnet = subnetIdentityModel
				createVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateVirtualNetworkInterface(createVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptions *DeleteVirtualNetworkInterfacesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deleteVirtualNetworkInterfacesPath := "/virtual_network_interfaces/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVirtualNetworkInterfacesPath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeleteVirtualNetworkInterfaces with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVirtualNetworkInterfacesOptions model
				deleteVirtualNetworkInterfacesOptionsModel := new(vpcv1.DeleteVirtualNetworkInterfacesOptions)
				deleteVirtualNetworkInterfacesOptionsModel.ID = core.StringPtr("testString")
				deleteVirtualNetworkInterfacesOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVirtualNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptions *DeleteVirtualNetworkInterfacesOptions)`, func() {
		version := "2024-06-23"
		deleteVirtualNetworkInterfacesPath := "/virtual_network_interfaces/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVirtualNetworkInterfacesPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke DeleteVirtualNetworkInterfaces successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeleteVirtualNetworkInterfacesOptions model
				deleteVirtualNetworkInterfacesOptionsModel := new(vpcv1.DeleteVirtualNetworkInterfacesOptions)
				deleteVirtualNetworkInterfacesOptionsModel.ID = core.StringPtr("testString")
				deleteVirtualNetworkInterfacesOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVirtualNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeleteVirtualNetworkInterfacesWithContext(ctx, deleteVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeleteVirtualNetworkInterfacesWithContext(ctx, deleteVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVirtualNetworkInterfacesPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke DeleteVirtualNetworkInterfaces successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeleteVirtualNetworkInterfaces(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeleteVirtualNetworkInterfacesOptions model
				deleteVirtualNetworkInterfacesOptionsModel := new(vpcv1.DeleteVirtualNetworkInterfacesOptions)
				deleteVirtualNetworkInterfacesOptionsModel.ID = core.StringPtr("testString")
				deleteVirtualNetworkInterfacesOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVirtualNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeleteVirtualNetworkInterfaces with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVirtualNetworkInterfacesOptions model
				deleteVirtualNetworkInterfacesOptionsModel := new(vpcv1.DeleteVirtualNetworkInterfacesOptions)
				deleteVirtualNetworkInterfacesOptionsModel.ID = core.StringPtr("testString")
				deleteVirtualNetworkInterfacesOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVirtualNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeleteVirtualNetworkInterfacesOptions model with no property values
				deleteVirtualNetworkInterfacesOptionsModelNew := new(vpcv1.DeleteVirtualNetworkInterfacesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteVirtualNetworkInterfaces successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVirtualNetworkInterfacesOptions model
				deleteVirtualNetworkInterfacesOptionsModel := new(vpcv1.DeleteVirtualNetworkInterfacesOptions)
				deleteVirtualNetworkInterfacesOptionsModel.ID = core.StringPtr("testString")
				deleteVirtualNetworkInterfacesOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVirtualNetworkInterfacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVirtualNetworkInterface(getVirtualNetworkInterfaceOptions *GetVirtualNetworkInterfaceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVirtualNetworkInterfacePath := "/virtual_network_interfaces/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVirtualNetworkInterfacePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVirtualNetworkInterface with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVirtualNetworkInterfaceOptions model
				getVirtualNetworkInterfaceOptionsModel := new(vpcv1.GetVirtualNetworkInterfaceOptions)
				getVirtualNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVirtualNetworkInterface(getVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVirtualNetworkInterface(getVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVirtualNetworkInterface(getVirtualNetworkInterfaceOptions *GetVirtualNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		getVirtualNetworkInterfacePath := "/virtual_network_interfaces/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVirtualNetworkInterfacePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetVirtualNetworkInterface successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVirtualNetworkInterfaceOptions model
				getVirtualNetworkInterfaceOptionsModel := new(vpcv1.GetVirtualNetworkInterfaceOptions)
				getVirtualNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVirtualNetworkInterfaceWithContext(ctx, getVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVirtualNetworkInterface(getVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVirtualNetworkInterfaceWithContext(ctx, getVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVirtualNetworkInterfacePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetVirtualNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVirtualNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVirtualNetworkInterfaceOptions model
				getVirtualNetworkInterfaceOptionsModel := new(vpcv1.GetVirtualNetworkInterfaceOptions)
				getVirtualNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVirtualNetworkInterface(getVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVirtualNetworkInterface with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVirtualNetworkInterfaceOptions model
				getVirtualNetworkInterfaceOptionsModel := new(vpcv1.GetVirtualNetworkInterfaceOptions)
				getVirtualNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVirtualNetworkInterface(getVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVirtualNetworkInterfaceOptions model with no property values
				getVirtualNetworkInterfaceOptionsModelNew := new(vpcv1.GetVirtualNetworkInterfaceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVirtualNetworkInterface(getVirtualNetworkInterfaceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVirtualNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVirtualNetworkInterfaceOptions model
				getVirtualNetworkInterfaceOptionsModel := new(vpcv1.GetVirtualNetworkInterfaceOptions)
				getVirtualNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				getVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVirtualNetworkInterface(getVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptions *UpdateVirtualNetworkInterfaceOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateVirtualNetworkInterfacePath := "/virtual_network_interfaces/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVirtualNetworkInterfacePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateVirtualNetworkInterface with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfacePatch model
				virtualNetworkInterfacePatchModel := new(vpcv1.VirtualNetworkInterfacePatch)
				virtualNetworkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				virtualNetworkInterfacePatchModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePatchModel.EnableInfrastructureNat = core.BoolPtr(true)
				virtualNetworkInterfacePatchModel.Name = core.StringPtr("my-virtual-network-interface")
				virtualNetworkInterfacePatchModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				virtualNetworkInterfacePatchModelAsPatch, asPatchErr := virtualNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVirtualNetworkInterfaceOptions model
				updateVirtualNetworkInterfaceOptionsModel := new(vpcv1.UpdateVirtualNetworkInterfaceOptions)
				updateVirtualNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateVirtualNetworkInterfaceOptionsModel.VirtualNetworkInterfacePatch = virtualNetworkInterfacePatchModelAsPatch
				updateVirtualNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptions *UpdateVirtualNetworkInterfaceOptions)`, func() {
		version := "2024-06-23"
		updateVirtualNetworkInterfacePath := "/virtual_network_interfaces/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVirtualNetworkInterfacePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateVirtualNetworkInterface successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VirtualNetworkInterfacePatch model
				virtualNetworkInterfacePatchModel := new(vpcv1.VirtualNetworkInterfacePatch)
				virtualNetworkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				virtualNetworkInterfacePatchModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePatchModel.EnableInfrastructureNat = core.BoolPtr(true)
				virtualNetworkInterfacePatchModel.Name = core.StringPtr("my-virtual-network-interface")
				virtualNetworkInterfacePatchModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				virtualNetworkInterfacePatchModelAsPatch, asPatchErr := virtualNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVirtualNetworkInterfaceOptions model
				updateVirtualNetworkInterfaceOptionsModel := new(vpcv1.UpdateVirtualNetworkInterfaceOptions)
				updateVirtualNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateVirtualNetworkInterfaceOptionsModel.VirtualNetworkInterfacePatch = virtualNetworkInterfacePatchModelAsPatch
				updateVirtualNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateVirtualNetworkInterfaceWithContext(ctx, updateVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateVirtualNetworkInterfaceWithContext(ctx, updateVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVirtualNetworkInterfacePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "id": "r006-76083f29-e320-4c3f-a1ff-ec479f7249d1", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateVirtualNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateVirtualNetworkInterface(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VirtualNetworkInterfacePatch model
				virtualNetworkInterfacePatchModel := new(vpcv1.VirtualNetworkInterfacePatch)
				virtualNetworkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				virtualNetworkInterfacePatchModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePatchModel.EnableInfrastructureNat = core.BoolPtr(true)
				virtualNetworkInterfacePatchModel.Name = core.StringPtr("my-virtual-network-interface")
				virtualNetworkInterfacePatchModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				virtualNetworkInterfacePatchModelAsPatch, asPatchErr := virtualNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVirtualNetworkInterfaceOptions model
				updateVirtualNetworkInterfaceOptionsModel := new(vpcv1.UpdateVirtualNetworkInterfaceOptions)
				updateVirtualNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateVirtualNetworkInterfaceOptionsModel.VirtualNetworkInterfacePatch = virtualNetworkInterfacePatchModelAsPatch
				updateVirtualNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateVirtualNetworkInterface with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfacePatch model
				virtualNetworkInterfacePatchModel := new(vpcv1.VirtualNetworkInterfacePatch)
				virtualNetworkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				virtualNetworkInterfacePatchModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePatchModel.EnableInfrastructureNat = core.BoolPtr(true)
				virtualNetworkInterfacePatchModel.Name = core.StringPtr("my-virtual-network-interface")
				virtualNetworkInterfacePatchModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				virtualNetworkInterfacePatchModelAsPatch, asPatchErr := virtualNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVirtualNetworkInterfaceOptions model
				updateVirtualNetworkInterfaceOptionsModel := new(vpcv1.UpdateVirtualNetworkInterfaceOptions)
				updateVirtualNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateVirtualNetworkInterfaceOptionsModel.VirtualNetworkInterfacePatch = virtualNetworkInterfacePatchModelAsPatch
				updateVirtualNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateVirtualNetworkInterfaceOptions model with no property values
				updateVirtualNetworkInterfaceOptionsModelNew := new(vpcv1.UpdateVirtualNetworkInterfaceOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateVirtualNetworkInterface successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VirtualNetworkInterfacePatch model
				virtualNetworkInterfacePatchModel := new(vpcv1.VirtualNetworkInterfacePatch)
				virtualNetworkInterfacePatchModel.AllowIPSpoofing = core.BoolPtr(true)
				virtualNetworkInterfacePatchModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePatchModel.EnableInfrastructureNat = core.BoolPtr(true)
				virtualNetworkInterfacePatchModel.Name = core.StringPtr("my-virtual-network-interface")
				virtualNetworkInterfacePatchModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				virtualNetworkInterfacePatchModelAsPatch, asPatchErr := virtualNetworkInterfacePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVirtualNetworkInterfaceOptions model
				updateVirtualNetworkInterfaceOptionsModel := new(vpcv1.UpdateVirtualNetworkInterfaceOptions)
				updateVirtualNetworkInterfaceOptionsModel.ID = core.StringPtr("testString")
				updateVirtualNetworkInterfaceOptionsModel.VirtualNetworkInterfacePatch = virtualNetworkInterfacePatchModelAsPatch
				updateVirtualNetworkInterfaceOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVirtualNetworkInterfaceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptions *ListNetworkInterfaceFloatingIpsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listNetworkInterfaceFloatingIpsPath := "/virtual_network_interfaces/testString/floating_ips"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listNetworkInterfaceFloatingIpsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListNetworkInterfaceFloatingIps with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListNetworkInterfaceFloatingIpsOptions model
				listNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListNetworkInterfaceFloatingIpsOptions)
				listNetworkInterfaceFloatingIpsOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				listNetworkInterfaceFloatingIpsOptionsModel.Start = core.StringPtr("testString")
				listNetworkInterfaceFloatingIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkInterfaceFloatingIpsOptionsModel.Sort = core.StringPtr("name")
				listNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptions *ListNetworkInterfaceFloatingIpsOptions)`, func() {
		version := "2024-06-23"
		listNetworkInterfaceFloatingIpsPath := "/virtual_network_interfaces/testString/floating_ips"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listNetworkInterfaceFloatingIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListNetworkInterfaceFloatingIps successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListNetworkInterfaceFloatingIpsOptions model
				listNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListNetworkInterfaceFloatingIpsOptions)
				listNetworkInterfaceFloatingIpsOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				listNetworkInterfaceFloatingIpsOptionsModel.Start = core.StringPtr("testString")
				listNetworkInterfaceFloatingIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkInterfaceFloatingIpsOptionsModel.Sort = core.StringPtr("name")
				listNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListNetworkInterfaceFloatingIpsWithContext(ctx, listNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListNetworkInterfaceFloatingIpsWithContext(ctx, listNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listNetworkInterfaceFloatingIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListNetworkInterfaceFloatingIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListNetworkInterfaceFloatingIps(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListNetworkInterfaceFloatingIpsOptions model
				listNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListNetworkInterfaceFloatingIpsOptions)
				listNetworkInterfaceFloatingIpsOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				listNetworkInterfaceFloatingIpsOptionsModel.Start = core.StringPtr("testString")
				listNetworkInterfaceFloatingIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkInterfaceFloatingIpsOptionsModel.Sort = core.StringPtr("name")
				listNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListNetworkInterfaceFloatingIps with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListNetworkInterfaceFloatingIpsOptions model
				listNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListNetworkInterfaceFloatingIpsOptions)
				listNetworkInterfaceFloatingIpsOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				listNetworkInterfaceFloatingIpsOptionsModel.Start = core.StringPtr("testString")
				listNetworkInterfaceFloatingIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkInterfaceFloatingIpsOptionsModel.Sort = core.StringPtr("name")
				listNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListNetworkInterfaceFloatingIpsOptions model with no property values
				listNetworkInterfaceFloatingIpsOptionsModelNew := new(vpcv1.ListNetworkInterfaceFloatingIpsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListNetworkInterfaceFloatingIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListNetworkInterfaceFloatingIpsOptions model
				listNetworkInterfaceFloatingIpsOptionsModel := new(vpcv1.ListNetworkInterfaceFloatingIpsOptions)
				listNetworkInterfaceFloatingIpsOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				listNetworkInterfaceFloatingIpsOptionsModel.Start = core.StringPtr("testString")
				listNetworkInterfaceFloatingIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listNetworkInterfaceFloatingIpsOptionsModel.Sort = core.StringPtr("name")
				listNetworkInterfaceFloatingIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.FloatingIPCollectionVirtualNetworkInterfaceContext)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.FloatingIPCollectionVirtualNetworkInterfaceContext)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.FloatingIPCollectionVirtualNetworkInterfaceContext)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listNetworkInterfaceFloatingIpsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use NetworkInterfaceFloatingIpsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listNetworkInterfaceFloatingIpsOptionsModel := &vpcv1.ListNetworkInterfaceFloatingIpsOptions{
					VirtualNetworkInterfaceID: core.StringPtr("testString"),
					Limit:                     core.Int64Ptr(int64(10)),
					Sort:                      core.StringPtr("name"),
				}

				pager, err := vpcService.NewNetworkInterfaceFloatingIpsPager(listNetworkInterfaceFloatingIpsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.FloatingIPReference
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use NetworkInterfaceFloatingIpsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listNetworkInterfaceFloatingIpsOptionsModel := &vpcv1.ListNetworkInterfaceFloatingIpsOptions{
					VirtualNetworkInterfaceID: core.StringPtr("testString"),
					Limit:                     core.Int64Ptr(int64(10)),
					Sort:                      core.StringPtr("name"),
				}

				pager, err := vpcService.NewNetworkInterfaceFloatingIpsPager(listNetworkInterfaceFloatingIpsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`RemoveNetworkInterfaceFloatingIP(removeNetworkInterfaceFloatingIPOptions *RemoveNetworkInterfaceFloatingIPOptions)`, func() {
		version := "2024-06-23"
		removeNetworkInterfaceFloatingIPPath := "/virtual_network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(removeNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke RemoveNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.RemoveNetworkInterfaceFloatingIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the RemoveNetworkInterfaceFloatingIPOptions model
				removeNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.RemoveNetworkInterfaceFloatingIPOptions)
				removeNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				removeNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				removeNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.RemoveNetworkInterfaceFloatingIP(removeNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke RemoveNetworkInterfaceFloatingIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RemoveNetworkInterfaceFloatingIPOptions model
				removeNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.RemoveNetworkInterfaceFloatingIPOptions)
				removeNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				removeNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				removeNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.RemoveNetworkInterfaceFloatingIP(removeNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the RemoveNetworkInterfaceFloatingIPOptions model with no property values
				removeNetworkInterfaceFloatingIPOptionsModelNew := new(vpcv1.RemoveNetworkInterfaceFloatingIPOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.RemoveNetworkInterfaceFloatingIP(removeNetworkInterfaceFloatingIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetNetworkInterfaceFloatingIP(getNetworkInterfaceFloatingIPOptions *GetNetworkInterfaceFloatingIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getNetworkInterfaceFloatingIPPath := "/virtual_network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetNetworkInterfaceFloatingIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetNetworkInterfaceFloatingIPOptions model
				getNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetNetworkInterfaceFloatingIPOptions)
				getNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				getNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetNetworkInterfaceFloatingIP(getNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetNetworkInterfaceFloatingIP(getNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetNetworkInterfaceFloatingIP(getNetworkInterfaceFloatingIPOptions *GetNetworkInterfaceFloatingIPOptions)`, func() {
		version := "2024-06-23"
		getNetworkInterfaceFloatingIPPath := "/virtual_network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}`)
				}))
			})
			It(`Invoke GetNetworkInterfaceFloatingIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetNetworkInterfaceFloatingIPOptions model
				getNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetNetworkInterfaceFloatingIPOptions)
				getNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				getNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetNetworkInterfaceFloatingIPWithContext(ctx, getNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetNetworkInterfaceFloatingIP(getNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetNetworkInterfaceFloatingIPWithContext(ctx, getNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}`)
				}))
			})
			It(`Invoke GetNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetNetworkInterfaceFloatingIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetNetworkInterfaceFloatingIPOptions model
				getNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetNetworkInterfaceFloatingIPOptions)
				getNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				getNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetNetworkInterfaceFloatingIP(getNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetNetworkInterfaceFloatingIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetNetworkInterfaceFloatingIPOptions model
				getNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetNetworkInterfaceFloatingIPOptions)
				getNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				getNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetNetworkInterfaceFloatingIP(getNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetNetworkInterfaceFloatingIPOptions model with no property values
				getNetworkInterfaceFloatingIPOptionsModelNew := new(vpcv1.GetNetworkInterfaceFloatingIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetNetworkInterfaceFloatingIP(getNetworkInterfaceFloatingIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetNetworkInterfaceFloatingIPOptions model
				getNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.GetNetworkInterfaceFloatingIPOptions)
				getNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				getNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				getNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetNetworkInterfaceFloatingIP(getNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`AddNetworkInterfaceFloatingIP(addNetworkInterfaceFloatingIPOptions *AddNetworkInterfaceFloatingIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		addNetworkInterfaceFloatingIPPath := "/virtual_network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("PUT"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke AddNetworkInterfaceFloatingIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddNetworkInterfaceFloatingIPOptions model
				addNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddNetworkInterfaceFloatingIPOptions)
				addNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				addNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.AddNetworkInterfaceFloatingIP(addNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.AddNetworkInterfaceFloatingIP(addNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`AddNetworkInterfaceFloatingIP(addNetworkInterfaceFloatingIPOptions *AddNetworkInterfaceFloatingIPOptions)`, func() {
		version := "2024-06-23"
		addNetworkInterfaceFloatingIPPath := "/virtual_network_interfaces/testString/floating_ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}`)
				}))
			})
			It(`Invoke AddNetworkInterfaceFloatingIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the AddNetworkInterfaceFloatingIPOptions model
				addNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddNetworkInterfaceFloatingIPOptions)
				addNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				addNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.AddNetworkInterfaceFloatingIPWithContext(ctx, addNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.AddNetworkInterfaceFloatingIP(addNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.AddNetworkInterfaceFloatingIPWithContext(ctx, addNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addNetworkInterfaceFloatingIPPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}`)
				}))
			})
			It(`Invoke AddNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.AddNetworkInterfaceFloatingIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the AddNetworkInterfaceFloatingIPOptions model
				addNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddNetworkInterfaceFloatingIPOptions)
				addNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				addNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.AddNetworkInterfaceFloatingIP(addNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke AddNetworkInterfaceFloatingIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddNetworkInterfaceFloatingIPOptions model
				addNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddNetworkInterfaceFloatingIPOptions)
				addNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				addNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.AddNetworkInterfaceFloatingIP(addNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the AddNetworkInterfaceFloatingIPOptions model with no property values
				addNetworkInterfaceFloatingIPOptionsModelNew := new(vpcv1.AddNetworkInterfaceFloatingIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.AddNetworkInterfaceFloatingIP(addNetworkInterfaceFloatingIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke AddNetworkInterfaceFloatingIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddNetworkInterfaceFloatingIPOptions model
				addNetworkInterfaceFloatingIPOptionsModel := new(vpcv1.AddNetworkInterfaceFloatingIPOptions)
				addNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				addNetworkInterfaceFloatingIPOptionsModel.ID = core.StringPtr("testString")
				addNetworkInterfaceFloatingIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.AddNetworkInterfaceFloatingIP(addNetworkInterfaceFloatingIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptions *ListVirtualNetworkInterfaceIpsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVirtualNetworkInterfaceIpsPath := "/virtual_network_interfaces/testString/ips"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVirtualNetworkInterfaceIpsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVirtualNetworkInterfaceIps with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVirtualNetworkInterfaceIpsOptions model
				listVirtualNetworkInterfaceIpsOptionsModel := new(vpcv1.ListVirtualNetworkInterfaceIpsOptions)
				listVirtualNetworkInterfaceIpsOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				listVirtualNetworkInterfaceIpsOptionsModel.Start = core.StringPtr("testString")
				listVirtualNetworkInterfaceIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVirtualNetworkInterfaceIpsOptionsModel.Sort = core.StringPtr("name")
				listVirtualNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptions *ListVirtualNetworkInterfaceIpsOptions)`, func() {
		version := "2024-06-23"
		listVirtualNetworkInterfaceIpsPath := "/virtual_network_interfaces/testString/ips"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVirtualNetworkInterfaceIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListVirtualNetworkInterfaceIps successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVirtualNetworkInterfaceIpsOptions model
				listVirtualNetworkInterfaceIpsOptionsModel := new(vpcv1.ListVirtualNetworkInterfaceIpsOptions)
				listVirtualNetworkInterfaceIpsOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				listVirtualNetworkInterfaceIpsOptionsModel.Start = core.StringPtr("testString")
				listVirtualNetworkInterfaceIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVirtualNetworkInterfaceIpsOptionsModel.Sort = core.StringPtr("name")
				listVirtualNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVirtualNetworkInterfaceIpsWithContext(ctx, listVirtualNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVirtualNetworkInterfaceIpsWithContext(ctx, listVirtualNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVirtualNetworkInterfaceIpsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListVirtualNetworkInterfaceIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVirtualNetworkInterfaceIps(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVirtualNetworkInterfaceIpsOptions model
				listVirtualNetworkInterfaceIpsOptionsModel := new(vpcv1.ListVirtualNetworkInterfaceIpsOptions)
				listVirtualNetworkInterfaceIpsOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				listVirtualNetworkInterfaceIpsOptionsModel.Start = core.StringPtr("testString")
				listVirtualNetworkInterfaceIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVirtualNetworkInterfaceIpsOptionsModel.Sort = core.StringPtr("name")
				listVirtualNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVirtualNetworkInterfaceIps with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVirtualNetworkInterfaceIpsOptions model
				listVirtualNetworkInterfaceIpsOptionsModel := new(vpcv1.ListVirtualNetworkInterfaceIpsOptions)
				listVirtualNetworkInterfaceIpsOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				listVirtualNetworkInterfaceIpsOptionsModel.Start = core.StringPtr("testString")
				listVirtualNetworkInterfaceIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVirtualNetworkInterfaceIpsOptionsModel.Sort = core.StringPtr("name")
				listVirtualNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListVirtualNetworkInterfaceIpsOptions model with no property values
				listVirtualNetworkInterfaceIpsOptionsModelNew := new(vpcv1.ListVirtualNetworkInterfaceIpsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVirtualNetworkInterfaceIps successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVirtualNetworkInterfaceIpsOptions model
				listVirtualNetworkInterfaceIpsOptionsModel := new(vpcv1.ListVirtualNetworkInterfaceIpsOptions)
				listVirtualNetworkInterfaceIpsOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				listVirtualNetworkInterfaceIpsOptionsModel.Start = core.StringPtr("testString")
				listVirtualNetworkInterfaceIpsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVirtualNetworkInterfaceIpsOptionsModel.Sort = core.StringPtr("name")
				listVirtualNetworkInterfaceIpsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.ReservedIPCollectionVirtualNetworkInterfaceContext)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.ReservedIPCollectionVirtualNetworkInterfaceContext)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.ReservedIPCollectionVirtualNetworkInterfaceContext)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVirtualNetworkInterfaceIpsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VirtualNetworkInterfaceIpsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVirtualNetworkInterfaceIpsOptionsModel := &vpcv1.ListVirtualNetworkInterfaceIpsOptions{
					VirtualNetworkInterfaceID: core.StringPtr("testString"),
					Limit:                     core.Int64Ptr(int64(10)),
					Sort:                      core.StringPtr("name"),
				}

				pager, err := vpcService.NewVirtualNetworkInterfaceIpsPager(listVirtualNetworkInterfaceIpsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.ReservedIPReference
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VirtualNetworkInterfaceIpsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVirtualNetworkInterfaceIpsOptionsModel := &vpcv1.ListVirtualNetworkInterfaceIpsOptions{
					VirtualNetworkInterfaceID: core.StringPtr("testString"),
					Limit:                     core.Int64Ptr(int64(10)),
					Sort:                      core.StringPtr("name"),
				}

				pager, err := vpcService.NewVirtualNetworkInterfaceIpsPager(listVirtualNetworkInterfaceIpsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`RemoveVirtualNetworkInterfaceIP(removeVirtualNetworkInterfaceIPOptions *RemoveVirtualNetworkInterfaceIPOptions)`, func() {
		version := "2024-06-23"
		removeVirtualNetworkInterfaceIPPath := "/virtual_network_interfaces/testString/ips/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(removeVirtualNetworkInterfaceIPPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke RemoveVirtualNetworkInterfaceIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.RemoveVirtualNetworkInterfaceIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the RemoveVirtualNetworkInterfaceIPOptions model
				removeVirtualNetworkInterfaceIPOptionsModel := new(vpcv1.RemoveVirtualNetworkInterfaceIPOptions)
				removeVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				removeVirtualNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				removeVirtualNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.RemoveVirtualNetworkInterfaceIP(removeVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke RemoveVirtualNetworkInterfaceIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RemoveVirtualNetworkInterfaceIPOptions model
				removeVirtualNetworkInterfaceIPOptionsModel := new(vpcv1.RemoveVirtualNetworkInterfaceIPOptions)
				removeVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				removeVirtualNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				removeVirtualNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.RemoveVirtualNetworkInterfaceIP(removeVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the RemoveVirtualNetworkInterfaceIPOptions model with no property values
				removeVirtualNetworkInterfaceIPOptionsModelNew := new(vpcv1.RemoveVirtualNetworkInterfaceIPOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.RemoveVirtualNetworkInterfaceIP(removeVirtualNetworkInterfaceIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVirtualNetworkInterfaceIP(getVirtualNetworkInterfaceIPOptions *GetVirtualNetworkInterfaceIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVirtualNetworkInterfaceIPPath := "/virtual_network_interfaces/testString/ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVirtualNetworkInterfaceIPPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVirtualNetworkInterfaceIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVirtualNetworkInterfaceIPOptions model
				getVirtualNetworkInterfaceIPOptionsModel := new(vpcv1.GetVirtualNetworkInterfaceIPOptions)
				getVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				getVirtualNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getVirtualNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVirtualNetworkInterfaceIP(getVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVirtualNetworkInterfaceIP(getVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVirtualNetworkInterfaceIP(getVirtualNetworkInterfaceIPOptions *GetVirtualNetworkInterfaceIPOptions)`, func() {
		version := "2024-06-23"
		getVirtualNetworkInterfaceIPPath := "/virtual_network_interfaces/testString/ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVirtualNetworkInterfaceIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}`)
				}))
			})
			It(`Invoke GetVirtualNetworkInterfaceIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVirtualNetworkInterfaceIPOptions model
				getVirtualNetworkInterfaceIPOptionsModel := new(vpcv1.GetVirtualNetworkInterfaceIPOptions)
				getVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				getVirtualNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getVirtualNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVirtualNetworkInterfaceIPWithContext(ctx, getVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVirtualNetworkInterfaceIP(getVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVirtualNetworkInterfaceIPWithContext(ctx, getVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVirtualNetworkInterfaceIPPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}`)
				}))
			})
			It(`Invoke GetVirtualNetworkInterfaceIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVirtualNetworkInterfaceIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVirtualNetworkInterfaceIPOptions model
				getVirtualNetworkInterfaceIPOptionsModel := new(vpcv1.GetVirtualNetworkInterfaceIPOptions)
				getVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				getVirtualNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getVirtualNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVirtualNetworkInterfaceIP(getVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVirtualNetworkInterfaceIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVirtualNetworkInterfaceIPOptions model
				getVirtualNetworkInterfaceIPOptionsModel := new(vpcv1.GetVirtualNetworkInterfaceIPOptions)
				getVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				getVirtualNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getVirtualNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVirtualNetworkInterfaceIP(getVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVirtualNetworkInterfaceIPOptions model with no property values
				getVirtualNetworkInterfaceIPOptionsModelNew := new(vpcv1.GetVirtualNetworkInterfaceIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVirtualNetworkInterfaceIP(getVirtualNetworkInterfaceIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVirtualNetworkInterfaceIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVirtualNetworkInterfaceIPOptions model
				getVirtualNetworkInterfaceIPOptionsModel := new(vpcv1.GetVirtualNetworkInterfaceIPOptions)
				getVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				getVirtualNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				getVirtualNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVirtualNetworkInterfaceIP(getVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`AddVirtualNetworkInterfaceIP(addVirtualNetworkInterfaceIPOptions *AddVirtualNetworkInterfaceIPOptions) - Operation response error`, func() {
		version := "2024-06-23"
		addVirtualNetworkInterfaceIPPath := "/virtual_network_interfaces/testString/ips/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addVirtualNetworkInterfaceIPPath))
					Expect(req.Method).To(Equal("PUT"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke AddVirtualNetworkInterfaceIP with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddVirtualNetworkInterfaceIPOptions model
				addVirtualNetworkInterfaceIPOptionsModel := new(vpcv1.AddVirtualNetworkInterfaceIPOptions)
				addVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				addVirtualNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				addVirtualNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.AddVirtualNetworkInterfaceIP(addVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.AddVirtualNetworkInterfaceIP(addVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`AddVirtualNetworkInterfaceIP(addVirtualNetworkInterfaceIPOptions *AddVirtualNetworkInterfaceIPOptions)`, func() {
		version := "2024-06-23"
		addVirtualNetworkInterfaceIPPath := "/virtual_network_interfaces/testString/ips/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addVirtualNetworkInterfaceIPPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}`)
				}))
			})
			It(`Invoke AddVirtualNetworkInterfaceIP successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the AddVirtualNetworkInterfaceIPOptions model
				addVirtualNetworkInterfaceIPOptionsModel := new(vpcv1.AddVirtualNetworkInterfaceIPOptions)
				addVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				addVirtualNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				addVirtualNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.AddVirtualNetworkInterfaceIPWithContext(ctx, addVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.AddVirtualNetworkInterfaceIP(addVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.AddVirtualNetworkInterfaceIPWithContext(ctx, addVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addVirtualNetworkInterfaceIPPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}`)
				}))
			})
			It(`Invoke AddVirtualNetworkInterfaceIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.AddVirtualNetworkInterfaceIP(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the AddVirtualNetworkInterfaceIPOptions model
				addVirtualNetworkInterfaceIPOptionsModel := new(vpcv1.AddVirtualNetworkInterfaceIPOptions)
				addVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				addVirtualNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				addVirtualNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.AddVirtualNetworkInterfaceIP(addVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke AddVirtualNetworkInterfaceIP with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddVirtualNetworkInterfaceIPOptions model
				addVirtualNetworkInterfaceIPOptionsModel := new(vpcv1.AddVirtualNetworkInterfaceIPOptions)
				addVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				addVirtualNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				addVirtualNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.AddVirtualNetworkInterfaceIP(addVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the AddVirtualNetworkInterfaceIPOptions model with no property values
				addVirtualNetworkInterfaceIPOptionsModelNew := new(vpcv1.AddVirtualNetworkInterfaceIPOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.AddVirtualNetworkInterfaceIP(addVirtualNetworkInterfaceIPOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke AddVirtualNetworkInterfaceIP successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddVirtualNetworkInterfaceIPOptions model
				addVirtualNetworkInterfaceIPOptionsModel := new(vpcv1.AddVirtualNetworkInterfaceIPOptions)
				addVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID = core.StringPtr("testString")
				addVirtualNetworkInterfaceIPOptionsModel.ID = core.StringPtr("testString")
				addVirtualNetworkInterfaceIPOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.AddVirtualNetworkInterfaceIP(addVirtualNetworkInterfaceIPOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVolumeProfiles(listVolumeProfilesOptions *ListVolumeProfilesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVolumeProfilesPath := "/volume/profiles"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVolumeProfilesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVolumeProfiles with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVolumeProfilesOptions model
				listVolumeProfilesOptionsModel := new(vpcv1.ListVolumeProfilesOptions)
				listVolumeProfilesOptionsModel.Start = core.StringPtr("testString")
				listVolumeProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumeProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVolumeProfiles(listVolumeProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVolumeProfiles(listVolumeProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVolumeProfiles(listVolumeProfilesOptions *ListVolumeProfilesOptions)`, func() {
		version := "2024-06-23"
		listVolumeProfilesPath := "/volume/profiles"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVolumeProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "profiles": [{"adjustable_capacity_states": {"type": "enum", "values": ["attached"]}, "adjustable_iops_states": {"type": "enum", "values": ["attached"]}, "bandwidth": {"type": "fixed", "value": 4000}, "boot_capacity": {"type": "fixed", "value": 4800}, "capacity": {"type": "fixed", "value": 4800}, "family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "iops": {"type": "fixed", "value": 4000}, "name": "general-purpose", "storage_generation": {"type": "fixed", "value": 1}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListVolumeProfiles successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVolumeProfilesOptions model
				listVolumeProfilesOptionsModel := new(vpcv1.ListVolumeProfilesOptions)
				listVolumeProfilesOptionsModel.Start = core.StringPtr("testString")
				listVolumeProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumeProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVolumeProfilesWithContext(ctx, listVolumeProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVolumeProfiles(listVolumeProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVolumeProfilesWithContext(ctx, listVolumeProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVolumeProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "profiles": [{"adjustable_capacity_states": {"type": "enum", "values": ["attached"]}, "adjustable_iops_states": {"type": "enum", "values": ["attached"]}, "bandwidth": {"type": "fixed", "value": 4000}, "boot_capacity": {"type": "fixed", "value": 4800}, "capacity": {"type": "fixed", "value": 4800}, "family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "iops": {"type": "fixed", "value": 4000}, "name": "general-purpose", "storage_generation": {"type": "fixed", "value": 1}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListVolumeProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVolumeProfiles(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVolumeProfilesOptions model
				listVolumeProfilesOptionsModel := new(vpcv1.ListVolumeProfilesOptions)
				listVolumeProfilesOptionsModel.Start = core.StringPtr("testString")
				listVolumeProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumeProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVolumeProfiles(listVolumeProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVolumeProfiles with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVolumeProfilesOptions model
				listVolumeProfilesOptionsModel := new(vpcv1.ListVolumeProfilesOptions)
				listVolumeProfilesOptionsModel.Start = core.StringPtr("testString")
				listVolumeProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumeProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVolumeProfiles(listVolumeProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVolumeProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVolumeProfilesOptions model
				listVolumeProfilesOptionsModel := new(vpcv1.ListVolumeProfilesOptions)
				listVolumeProfilesOptionsModel.Start = core.StringPtr("testString")
				listVolumeProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumeProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVolumeProfiles(listVolumeProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.VolumeProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.VolumeProfileCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.VolumeProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVolumeProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"adjustable_capacity_states":{"type":"enum","values":["attached"]},"adjustable_iops_states":{"type":"enum","values":["attached"]},"bandwidth":{"type":"fixed","value":4000},"boot_capacity":{"type":"fixed","value":4800},"capacity":{"type":"fixed","value":4800},"family":"tiered","href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","iops":{"type":"fixed","value":4000},"name":"general-purpose","storage_generation":{"type":"fixed","value":1}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"profiles":[{"adjustable_capacity_states":{"type":"enum","values":["attached"]},"adjustable_iops_states":{"type":"enum","values":["attached"]},"bandwidth":{"type":"fixed","value":4000},"boot_capacity":{"type":"fixed","value":4800},"capacity":{"type":"fixed","value":4800},"family":"tiered","href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","iops":{"type":"fixed","value":4000},"name":"general-purpose","storage_generation":{"type":"fixed","value":1}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VolumeProfilesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVolumeProfilesOptionsModel := &vpcv1.ListVolumeProfilesOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewVolumeProfilesPager(listVolumeProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.VolumeProfile
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VolumeProfilesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVolumeProfilesOptionsModel := &vpcv1.ListVolumeProfilesOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewVolumeProfilesPager(listVolumeProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`GetVolumeProfile(getVolumeProfileOptions *GetVolumeProfileOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVolumeProfilePath := "/volume/profiles/10iops-tier"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVolumeProfilePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVolumeProfile with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVolumeProfileOptions model
				getVolumeProfileOptionsModel := new(vpcv1.GetVolumeProfileOptions)
				getVolumeProfileOptionsModel.Name = core.StringPtr("10iops-tier")
				getVolumeProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVolumeProfile(getVolumeProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVolumeProfile(getVolumeProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVolumeProfile(getVolumeProfileOptions *GetVolumeProfileOptions)`, func() {
		version := "2024-06-23"
		getVolumeProfilePath := "/volume/profiles/10iops-tier"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVolumeProfilePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"adjustable_capacity_states": {"type": "enum", "values": ["attached"]}, "adjustable_iops_states": {"type": "enum", "values": ["attached"]}, "bandwidth": {"type": "fixed", "value": 4000}, "boot_capacity": {"type": "fixed", "value": 4800}, "capacity": {"type": "fixed", "value": 4800}, "family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "iops": {"type": "fixed", "value": 4000}, "name": "general-purpose", "storage_generation": {"type": "fixed", "value": 1}}`)
				}))
			})
			It(`Invoke GetVolumeProfile successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVolumeProfileOptions model
				getVolumeProfileOptionsModel := new(vpcv1.GetVolumeProfileOptions)
				getVolumeProfileOptionsModel.Name = core.StringPtr("10iops-tier")
				getVolumeProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVolumeProfileWithContext(ctx, getVolumeProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVolumeProfile(getVolumeProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVolumeProfileWithContext(ctx, getVolumeProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVolumeProfilePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"adjustable_capacity_states": {"type": "enum", "values": ["attached"]}, "adjustable_iops_states": {"type": "enum", "values": ["attached"]}, "bandwidth": {"type": "fixed", "value": 4000}, "boot_capacity": {"type": "fixed", "value": 4800}, "capacity": {"type": "fixed", "value": 4800}, "family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "iops": {"type": "fixed", "value": 4000}, "name": "general-purpose", "storage_generation": {"type": "fixed", "value": 1}}`)
				}))
			})
			It(`Invoke GetVolumeProfile successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVolumeProfile(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVolumeProfileOptions model
				getVolumeProfileOptionsModel := new(vpcv1.GetVolumeProfileOptions)
				getVolumeProfileOptionsModel.Name = core.StringPtr("10iops-tier")
				getVolumeProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVolumeProfile(getVolumeProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVolumeProfile with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVolumeProfileOptions model
				getVolumeProfileOptionsModel := new(vpcv1.GetVolumeProfileOptions)
				getVolumeProfileOptionsModel.Name = core.StringPtr("10iops-tier")
				getVolumeProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVolumeProfile(getVolumeProfileOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVolumeProfileOptions model with no property values
				getVolumeProfileOptionsModelNew := new(vpcv1.GetVolumeProfileOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVolumeProfile(getVolumeProfileOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVolumeProfile successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVolumeProfileOptions model
				getVolumeProfileOptionsModel := new(vpcv1.GetVolumeProfileOptions)
				getVolumeProfileOptionsModel.Name = core.StringPtr("10iops-tier")
				getVolumeProfileOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVolumeProfile(getVolumeProfileOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVolumes(listVolumesOptions *ListVolumesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVolumesPath := "/volumes"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVolumesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["attachment_state"]).To(Equal([]string{"attached"}))
					Expect(req.URL.Query()["encryption"]).To(Equal([]string{"provider_managed"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["operating_system.family"]).To(Equal([]string{"Ubuntu Server"}))
					Expect(req.URL.Query()["operating_system.architecture"]).To(Equal([]string{"amd64"}))
					Expect(req.URL.Query()["tag"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVolumes with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVolumesOptions model
				listVolumesOptionsModel := new(vpcv1.ListVolumesOptions)
				listVolumesOptionsModel.Start = core.StringPtr("testString")
				listVolumesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumesOptionsModel.AttachmentState = core.StringPtr("attached")
				listVolumesOptionsModel.Encryption = core.StringPtr("provider_managed")
				listVolumesOptionsModel.Name = core.StringPtr("my-name")
				listVolumesOptionsModel.OperatingSystemFamily = core.StringPtr("Ubuntu Server")
				listVolumesOptionsModel.OperatingSystemArchitecture = core.StringPtr("amd64")
				listVolumesOptionsModel.Tag = core.StringPtr("testString")
				listVolumesOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listVolumesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVolumes(listVolumesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVolumes(listVolumesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVolumes(listVolumesOptions *ListVolumesOptions)`, func() {
		version := "2024-06-23"
		listVolumesPath := "/volumes"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVolumesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["attachment_state"]).To(Equal([]string{"attached"}))
					Expect(req.URL.Query()["encryption"]).To(Equal([]string{"provider_managed"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["operating_system.family"]).To(Equal([]string{"Ubuntu Server"}))
					Expect(req.URL.Query()["operating_system.architecture"]).To(Equal([]string{"amd64"}))
					Expect(req.URL.Query()["tag"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132, "volumes": [{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "attachment_state": "attached", "bandwidth": 100, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "storage_generation": 1, "user_tags": ["UserTags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}`)
				}))
			})
			It(`Invoke ListVolumes successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVolumesOptions model
				listVolumesOptionsModel := new(vpcv1.ListVolumesOptions)
				listVolumesOptionsModel.Start = core.StringPtr("testString")
				listVolumesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumesOptionsModel.AttachmentState = core.StringPtr("attached")
				listVolumesOptionsModel.Encryption = core.StringPtr("provider_managed")
				listVolumesOptionsModel.Name = core.StringPtr("my-name")
				listVolumesOptionsModel.OperatingSystemFamily = core.StringPtr("Ubuntu Server")
				listVolumesOptionsModel.OperatingSystemArchitecture = core.StringPtr("amd64")
				listVolumesOptionsModel.Tag = core.StringPtr("testString")
				listVolumesOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listVolumesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVolumesWithContext(ctx, listVolumesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVolumes(listVolumesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVolumesWithContext(ctx, listVolumesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVolumesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["attachment_state"]).To(Equal([]string{"attached"}))
					Expect(req.URL.Query()["encryption"]).To(Equal([]string{"provider_managed"}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["operating_system.family"]).To(Equal([]string{"Ubuntu Server"}))
					Expect(req.URL.Query()["operating_system.architecture"]).To(Equal([]string{"amd64"}))
					Expect(req.URL.Query()["tag"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132, "volumes": [{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "attachment_state": "attached", "bandwidth": 100, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "storage_generation": 1, "user_tags": ["UserTags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}`)
				}))
			})
			It(`Invoke ListVolumes successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVolumes(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVolumesOptions model
				listVolumesOptionsModel := new(vpcv1.ListVolumesOptions)
				listVolumesOptionsModel.Start = core.StringPtr("testString")
				listVolumesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumesOptionsModel.AttachmentState = core.StringPtr("attached")
				listVolumesOptionsModel.Encryption = core.StringPtr("provider_managed")
				listVolumesOptionsModel.Name = core.StringPtr("my-name")
				listVolumesOptionsModel.OperatingSystemFamily = core.StringPtr("Ubuntu Server")
				listVolumesOptionsModel.OperatingSystemArchitecture = core.StringPtr("amd64")
				listVolumesOptionsModel.Tag = core.StringPtr("testString")
				listVolumesOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listVolumesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVolumes(listVolumesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVolumes with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVolumesOptions model
				listVolumesOptionsModel := new(vpcv1.ListVolumesOptions)
				listVolumesOptionsModel.Start = core.StringPtr("testString")
				listVolumesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumesOptionsModel.AttachmentState = core.StringPtr("attached")
				listVolumesOptionsModel.Encryption = core.StringPtr("provider_managed")
				listVolumesOptionsModel.Name = core.StringPtr("my-name")
				listVolumesOptionsModel.OperatingSystemFamily = core.StringPtr("Ubuntu Server")
				listVolumesOptionsModel.OperatingSystemArchitecture = core.StringPtr("amd64")
				listVolumesOptionsModel.Tag = core.StringPtr("testString")
				listVolumesOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listVolumesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVolumes(listVolumesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVolumes successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVolumesOptions model
				listVolumesOptionsModel := new(vpcv1.ListVolumesOptions)
				listVolumesOptionsModel.Start = core.StringPtr("testString")
				listVolumesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumesOptionsModel.AttachmentState = core.StringPtr("attached")
				listVolumesOptionsModel.Encryption = core.StringPtr("provider_managed")
				listVolumesOptionsModel.Name = core.StringPtr("my-name")
				listVolumesOptionsModel.OperatingSystemFamily = core.StringPtr("Ubuntu Server")
				listVolumesOptionsModel.OperatingSystemArchitecture = core.StringPtr("amd64")
				listVolumesOptionsModel.Tag = core.StringPtr("testString")
				listVolumesOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listVolumesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVolumes(listVolumesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.VolumeCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.VolumeCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.VolumeCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVolumesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"volumes":[{"active":true,"adjustable_capacity_states":["attached"],"adjustable_iops_states":["attached"],"allowed_use":{"api_version":"2024-06-23","bare_metal_server":"enable_secure_boot == true","instance":"gpu.count > 0 && enable_secure_boot == true"},"attachment_state":"attached","bandwidth":100,"busy":true,"capacity":1000,"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"volume","source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r006-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"Message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"storage_generation":1,"user_tags":["UserTags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"ID"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"volumes":[{"active":true,"adjustable_capacity_states":["attached"],"adjustable_iops_states":["attached"],"allowed_use":{"api_version":"2024-06-23","bare_metal_server":"enable_secure_boot == true","instance":"gpu.count > 0 && enable_secure_boot == true"},"attachment_state":"attached","bandwidth":100,"busy":true,"capacity":1000,"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"volume","source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r006-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"Message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"storage_generation":1,"user_tags":["UserTags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"ID"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VolumesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVolumesOptionsModel := &vpcv1.ListVolumesOptions{
					Limit:                       core.Int64Ptr(int64(10)),
					AttachmentState:             core.StringPtr("attached"),
					Encryption:                  core.StringPtr("provider_managed"),
					Name:                        core.StringPtr("my-name"),
					OperatingSystemFamily:       core.StringPtr("Ubuntu Server"),
					OperatingSystemArchitecture: core.StringPtr("amd64"),
					Tag:                         core.StringPtr("testString"),
					ZoneName:                    core.StringPtr("us-south-1"),
				}

				pager, err := vpcService.NewVolumesPager(listVolumesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.Volume
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VolumesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVolumesOptionsModel := &vpcv1.ListVolumesOptions{
					Limit:                       core.Int64Ptr(int64(10)),
					AttachmentState:             core.StringPtr("attached"),
					Encryption:                  core.StringPtr("provider_managed"),
					Name:                        core.StringPtr("my-name"),
					OperatingSystemFamily:       core.StringPtr("Ubuntu Server"),
					OperatingSystemArchitecture: core.StringPtr("amd64"),
					Tag:                         core.StringPtr("testString"),
					ZoneName:                    core.StringPtr("us-south-1"),
				}

				pager, err := vpcService.NewVolumesPager(listVolumesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateVolume(createVolumeOptions *CreateVolumeOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createVolumePath := "/volumes"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVolumePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateVolume with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("custom")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumePrototypeVolumeByCapacity model
				volumePrototypeModel := new(vpcv1.VolumePrototypeVolumeByCapacity)
				volumePrototypeModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeModel.Name = core.StringPtr("my-volume")
				volumePrototypeModel.Profile = volumeProfileIdentityModel
				volumePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeModel.UserTags = []string{}
				volumePrototypeModel.Zone = zoneIdentityModel
				volumePrototypeModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeModel.EncryptionKey = encryptionKeyIdentityModel

				// Construct an instance of the CreateVolumeOptions model
				createVolumeOptionsModel := new(vpcv1.CreateVolumeOptions)
				createVolumeOptionsModel.VolumePrototype = volumePrototypeModel
				createVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateVolume(createVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateVolume(createVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateVolume(createVolumeOptions *CreateVolumeOptions)`, func() {
		version := "2024-06-23"
		createVolumePath := "/volumes"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVolumePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "attachment_state": "attached", "bandwidth": 100, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "storage_generation": 1, "user_tags": ["UserTags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateVolume successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("custom")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumePrototypeVolumeByCapacity model
				volumePrototypeModel := new(vpcv1.VolumePrototypeVolumeByCapacity)
				volumePrototypeModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeModel.Name = core.StringPtr("my-volume")
				volumePrototypeModel.Profile = volumeProfileIdentityModel
				volumePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeModel.UserTags = []string{}
				volumePrototypeModel.Zone = zoneIdentityModel
				volumePrototypeModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeModel.EncryptionKey = encryptionKeyIdentityModel

				// Construct an instance of the CreateVolumeOptions model
				createVolumeOptionsModel := new(vpcv1.CreateVolumeOptions)
				createVolumeOptionsModel.VolumePrototype = volumePrototypeModel
				createVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateVolumeWithContext(ctx, createVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateVolume(createVolumeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateVolumeWithContext(ctx, createVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVolumePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "attachment_state": "attached", "bandwidth": 100, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "storage_generation": 1, "user_tags": ["UserTags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateVolume successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateVolume(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("custom")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumePrototypeVolumeByCapacity model
				volumePrototypeModel := new(vpcv1.VolumePrototypeVolumeByCapacity)
				volumePrototypeModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeModel.Name = core.StringPtr("my-volume")
				volumePrototypeModel.Profile = volumeProfileIdentityModel
				volumePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeModel.UserTags = []string{}
				volumePrototypeModel.Zone = zoneIdentityModel
				volumePrototypeModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeModel.EncryptionKey = encryptionKeyIdentityModel

				// Construct an instance of the CreateVolumeOptions model
				createVolumeOptionsModel := new(vpcv1.CreateVolumeOptions)
				createVolumeOptionsModel.VolumePrototype = volumePrototypeModel
				createVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateVolume(createVolumeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateVolume with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("custom")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumePrototypeVolumeByCapacity model
				volumePrototypeModel := new(vpcv1.VolumePrototypeVolumeByCapacity)
				volumePrototypeModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeModel.Name = core.StringPtr("my-volume")
				volumePrototypeModel.Profile = volumeProfileIdentityModel
				volumePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeModel.UserTags = []string{}
				volumePrototypeModel.Zone = zoneIdentityModel
				volumePrototypeModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeModel.EncryptionKey = encryptionKeyIdentityModel

				// Construct an instance of the CreateVolumeOptions model
				createVolumeOptionsModel := new(vpcv1.CreateVolumeOptions)
				createVolumeOptionsModel.VolumePrototype = volumePrototypeModel
				createVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateVolume(createVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateVolumeOptions model with no property values
				createVolumeOptionsModelNew := new(vpcv1.CreateVolumeOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateVolume(createVolumeOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateVolume successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("custom")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

				// Construct an instance of the VolumePrototypeVolumeByCapacity model
				volumePrototypeModel := new(vpcv1.VolumePrototypeVolumeByCapacity)
				volumePrototypeModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeModel.Name = core.StringPtr("my-volume")
				volumePrototypeModel.Profile = volumeProfileIdentityModel
				volumePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeModel.UserTags = []string{}
				volumePrototypeModel.Zone = zoneIdentityModel
				volumePrototypeModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeModel.EncryptionKey = encryptionKeyIdentityModel

				// Construct an instance of the CreateVolumeOptions model
				createVolumeOptionsModel := new(vpcv1.CreateVolumeOptions)
				createVolumeOptionsModel.VolumePrototype = volumePrototypeModel
				createVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateVolume(createVolumeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteVolume(deleteVolumeOptions *DeleteVolumeOptions)`, func() {
		version := "2024-06-23"
		deleteVolumePath := "/volumes/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVolumePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteVolume successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteVolume(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteVolumeOptions model
				deleteVolumeOptionsModel := new(vpcv1.DeleteVolumeOptions)
				deleteVolumeOptionsModel.ID = core.StringPtr("testString")
				deleteVolumeOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteVolume(deleteVolumeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteVolume with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVolumeOptions model
				deleteVolumeOptionsModel := new(vpcv1.DeleteVolumeOptions)
				deleteVolumeOptionsModel.ID = core.StringPtr("testString")
				deleteVolumeOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteVolume(deleteVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteVolumeOptions model with no property values
				deleteVolumeOptionsModelNew := new(vpcv1.DeleteVolumeOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteVolume(deleteVolumeOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVolume(getVolumeOptions *GetVolumeOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVolumePath := "/volumes/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVolumePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVolume with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVolumeOptions model
				getVolumeOptionsModel := new(vpcv1.GetVolumeOptions)
				getVolumeOptionsModel.ID = core.StringPtr("testString")
				getVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVolume(getVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVolume(getVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVolume(getVolumeOptions *GetVolumeOptions)`, func() {
		version := "2024-06-23"
		getVolumePath := "/volumes/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVolumePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "attachment_state": "attached", "bandwidth": 100, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "storage_generation": 1, "user_tags": ["UserTags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetVolume successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVolumeOptions model
				getVolumeOptionsModel := new(vpcv1.GetVolumeOptions)
				getVolumeOptionsModel.ID = core.StringPtr("testString")
				getVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVolumeWithContext(ctx, getVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVolume(getVolumeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVolumeWithContext(ctx, getVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVolumePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "attachment_state": "attached", "bandwidth": 100, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "storage_generation": 1, "user_tags": ["UserTags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetVolume successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVolume(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVolumeOptions model
				getVolumeOptionsModel := new(vpcv1.GetVolumeOptions)
				getVolumeOptionsModel.ID = core.StringPtr("testString")
				getVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVolume(getVolumeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVolume with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVolumeOptions model
				getVolumeOptionsModel := new(vpcv1.GetVolumeOptions)
				getVolumeOptionsModel.ID = core.StringPtr("testString")
				getVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVolume(getVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVolumeOptions model with no property values
				getVolumeOptionsModelNew := new(vpcv1.GetVolumeOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVolume(getVolumeOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVolume successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVolumeOptions model
				getVolumeOptionsModel := new(vpcv1.GetVolumeOptions)
				getVolumeOptionsModel.ID = core.StringPtr("testString")
				getVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVolume(getVolumeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVolume(updateVolumeOptions *UpdateVolumeOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateVolumePath := "/volumes/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVolumePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateVolume with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VolumeAllowedUsePatch model
				volumeAllowedUsePatchModel := new(vpcv1.VolumeAllowedUsePatch)
				volumeAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("general-purpose")

				// Construct an instance of the VolumePatch model
				volumePatchModel := new(vpcv1.VolumePatch)
				volumePatchModel.AllowedUse = volumeAllowedUsePatchModel
				volumePatchModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePatchModel.Capacity = core.Int64Ptr(int64(100))
				volumePatchModel.Iops = core.Int64Ptr(int64(10000))
				volumePatchModel.Name = core.StringPtr("my-volume")
				volumePatchModel.Profile = volumeProfileIdentityModel
				volumePatchModel.UserTags = []string{"testString"}
				volumePatchModelAsPatch, asPatchErr := volumePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVolumeOptions model
				updateVolumeOptionsModel := new(vpcv1.UpdateVolumeOptions)
				updateVolumeOptionsModel.ID = core.StringPtr("testString")
				updateVolumeOptionsModel.VolumePatch = volumePatchModelAsPatch
				updateVolumeOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateVolume(updateVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateVolume(updateVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVolume(updateVolumeOptions *UpdateVolumeOptions)`, func() {
		version := "2024-06-23"
		updateVolumePath := "/volumes/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVolumePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "attachment_state": "attached", "bandwidth": 100, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "storage_generation": 1, "user_tags": ["UserTags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateVolume successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VolumeAllowedUsePatch model
				volumeAllowedUsePatchModel := new(vpcv1.VolumeAllowedUsePatch)
				volumeAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("general-purpose")

				// Construct an instance of the VolumePatch model
				volumePatchModel := new(vpcv1.VolumePatch)
				volumePatchModel.AllowedUse = volumeAllowedUsePatchModel
				volumePatchModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePatchModel.Capacity = core.Int64Ptr(int64(100))
				volumePatchModel.Iops = core.Int64Ptr(int64(10000))
				volumePatchModel.Name = core.StringPtr("my-volume")
				volumePatchModel.Profile = volumeProfileIdentityModel
				volumePatchModel.UserTags = []string{"testString"}
				volumePatchModelAsPatch, asPatchErr := volumePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVolumeOptions model
				updateVolumeOptionsModel := new(vpcv1.UpdateVolumeOptions)
				updateVolumeOptionsModel.ID = core.StringPtr("testString")
				updateVolumeOptionsModel.VolumePatch = volumePatchModelAsPatch
				updateVolumeOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateVolumeWithContext(ctx, updateVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateVolume(updateVolumeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateVolumeWithContext(ctx, updateVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVolumePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "allowed_use": {"api_version": "2024-06-23", "bare_metal_server": "enable_secure_boot == true", "instance": "gpu.count > 0 && enable_secure_boot == true"}, "attachment_state": "attached", "bandwidth": 100, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r006-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "Message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "storage_generation": 1, "user_tags": ["UserTags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "ID"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateVolume successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateVolume(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VolumeAllowedUsePatch model
				volumeAllowedUsePatchModel := new(vpcv1.VolumeAllowedUsePatch)
				volumeAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("general-purpose")

				// Construct an instance of the VolumePatch model
				volumePatchModel := new(vpcv1.VolumePatch)
				volumePatchModel.AllowedUse = volumeAllowedUsePatchModel
				volumePatchModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePatchModel.Capacity = core.Int64Ptr(int64(100))
				volumePatchModel.Iops = core.Int64Ptr(int64(10000))
				volumePatchModel.Name = core.StringPtr("my-volume")
				volumePatchModel.Profile = volumeProfileIdentityModel
				volumePatchModel.UserTags = []string{"testString"}
				volumePatchModelAsPatch, asPatchErr := volumePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVolumeOptions model
				updateVolumeOptionsModel := new(vpcv1.UpdateVolumeOptions)
				updateVolumeOptionsModel.ID = core.StringPtr("testString")
				updateVolumeOptionsModel.VolumePatch = volumePatchModelAsPatch
				updateVolumeOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateVolume(updateVolumeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateVolume with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VolumeAllowedUsePatch model
				volumeAllowedUsePatchModel := new(vpcv1.VolumeAllowedUsePatch)
				volumeAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("general-purpose")

				// Construct an instance of the VolumePatch model
				volumePatchModel := new(vpcv1.VolumePatch)
				volumePatchModel.AllowedUse = volumeAllowedUsePatchModel
				volumePatchModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePatchModel.Capacity = core.Int64Ptr(int64(100))
				volumePatchModel.Iops = core.Int64Ptr(int64(10000))
				volumePatchModel.Name = core.StringPtr("my-volume")
				volumePatchModel.Profile = volumeProfileIdentityModel
				volumePatchModel.UserTags = []string{"testString"}
				volumePatchModelAsPatch, asPatchErr := volumePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVolumeOptions model
				updateVolumeOptionsModel := new(vpcv1.UpdateVolumeOptions)
				updateVolumeOptionsModel.ID = core.StringPtr("testString")
				updateVolumeOptionsModel.VolumePatch = volumePatchModelAsPatch
				updateVolumeOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateVolume(updateVolumeOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateVolumeOptions model with no property values
				updateVolumeOptionsModelNew := new(vpcv1.UpdateVolumeOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateVolume(updateVolumeOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateVolume successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VolumeAllowedUsePatch model
				volumeAllowedUsePatchModel := new(vpcv1.VolumeAllowedUsePatch)
				volumeAllowedUsePatchModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePatchModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePatchModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				volumeProfileIdentityModel.Name = core.StringPtr("general-purpose")

				// Construct an instance of the VolumePatch model
				volumePatchModel := new(vpcv1.VolumePatch)
				volumePatchModel.AllowedUse = volumeAllowedUsePatchModel
				volumePatchModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePatchModel.Capacity = core.Int64Ptr(int64(100))
				volumePatchModel.Iops = core.Int64Ptr(int64(10000))
				volumePatchModel.Name = core.StringPtr("my-volume")
				volumePatchModel.Profile = volumeProfileIdentityModel
				volumePatchModel.UserTags = []string{"testString"}
				volumePatchModelAsPatch, asPatchErr := volumePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVolumeOptions model
				updateVolumeOptionsModel := new(vpcv1.UpdateVolumeOptions)
				updateVolumeOptionsModel.ID = core.StringPtr("testString")
				updateVolumeOptionsModel.VolumePatch = volumePatchModelAsPatch
				updateVolumeOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVolumeOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateVolume(updateVolumeOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVolumeInstanceProfiles(listVolumeInstanceProfilesOptions *ListVolumeInstanceProfilesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVolumeInstanceProfilesPath := "/volumes/testString/instance_profiles"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVolumeInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVolumeInstanceProfiles with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVolumeInstanceProfilesOptions model
				listVolumeInstanceProfilesOptionsModel := new(vpcv1.ListVolumeInstanceProfilesOptions)
				listVolumeInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listVolumeInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listVolumeInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumeInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVolumeInstanceProfiles(listVolumeInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVolumeInstanceProfiles(listVolumeInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVolumeInstanceProfiles(listVolumeInstanceProfilesOptions *ListVolumeInstanceProfilesOptions)`, func() {
		version := "2024-06-23"
		listVolumeInstanceProfilesPath := "/volumes/testString/instance_profiles"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVolumeInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListVolumeInstanceProfiles successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVolumeInstanceProfilesOptions model
				listVolumeInstanceProfilesOptionsModel := new(vpcv1.ListVolumeInstanceProfilesOptions)
				listVolumeInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listVolumeInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listVolumeInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumeInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVolumeInstanceProfilesWithContext(ctx, listVolumeInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVolumeInstanceProfiles(listVolumeInstanceProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVolumeInstanceProfilesWithContext(ctx, listVolumeInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVolumeInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListVolumeInstanceProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVolumeInstanceProfiles(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVolumeInstanceProfilesOptions model
				listVolumeInstanceProfilesOptionsModel := new(vpcv1.ListVolumeInstanceProfilesOptions)
				listVolumeInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listVolumeInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listVolumeInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumeInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVolumeInstanceProfiles(listVolumeInstanceProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVolumeInstanceProfiles with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVolumeInstanceProfilesOptions model
				listVolumeInstanceProfilesOptionsModel := new(vpcv1.ListVolumeInstanceProfilesOptions)
				listVolumeInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listVolumeInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listVolumeInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumeInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVolumeInstanceProfiles(listVolumeInstanceProfilesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListVolumeInstanceProfilesOptions model with no property values
				listVolumeInstanceProfilesOptionsModelNew := new(vpcv1.ListVolumeInstanceProfilesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListVolumeInstanceProfiles(listVolumeInstanceProfilesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVolumeInstanceProfiles successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVolumeInstanceProfilesOptions model
				listVolumeInstanceProfilesOptionsModel := new(vpcv1.ListVolumeInstanceProfilesOptions)
				listVolumeInstanceProfilesOptionsModel.ID = core.StringPtr("testString")
				listVolumeInstanceProfilesOptionsModel.Start = core.StringPtr("testString")
				listVolumeInstanceProfilesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVolumeInstanceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVolumeInstanceProfiles(listVolumeInstanceProfilesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.VolumeInstanceProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.VolumeInstanceProfileCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.VolumeInstanceProfileCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVolumeInstanceProfilesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VolumeInstanceProfilesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVolumeInstanceProfilesOptionsModel := &vpcv1.ListVolumeInstanceProfilesOptions{
					ID:    core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewVolumeInstanceProfilesPager(listVolumeInstanceProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.InstanceProfileReference
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VolumeInstanceProfilesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVolumeInstanceProfilesOptionsModel := &vpcv1.ListVolumeInstanceProfilesOptions{
					ID:    core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewVolumeInstanceProfilesPager(listVolumeInstanceProfilesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`ListVpcs(listVpcsOptions *ListVpcsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVpcsPath := "/vpcs"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVpcsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// TODO: Add check for classic_access query parameter
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVpcs with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVpcsOptions model
				listVpcsOptionsModel := new(vpcv1.ListVpcsOptions)
				listVpcsOptionsModel.Start = core.StringPtr("testString")
				listVpcsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVpcsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVpcsOptionsModel.ClassicAccess = core.BoolPtr(true)
				listVpcsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVpcs(listVpcsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVpcs(listVpcsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVpcs(listVpcsOptions *ListVpcsOptions)`, func() {
		version := "2024-06-23"
		listVpcsPath := "/vpcs"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVpcsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// TODO: Add check for classic_access query parameter
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132, "vpcs": [{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "dns": {"enable_hub": false, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "public_address_ranges": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "name": "my-public-address-range", "resource_type": "public_address_range"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}]}`)
				}))
			})
			It(`Invoke ListVpcs successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVpcsOptions model
				listVpcsOptionsModel := new(vpcv1.ListVpcsOptions)
				listVpcsOptionsModel.Start = core.StringPtr("testString")
				listVpcsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVpcsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVpcsOptionsModel.ClassicAccess = core.BoolPtr(true)
				listVpcsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVpcsWithContext(ctx, listVpcsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVpcs(listVpcsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVpcsWithContext(ctx, listVpcsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVpcsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					// TODO: Add check for classic_access query parameter
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132, "vpcs": [{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "dns": {"enable_hub": false, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "public_address_ranges": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "name": "my-public-address-range", "resource_type": "public_address_range"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}]}`)
				}))
			})
			It(`Invoke ListVpcs successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVpcs(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVpcsOptions model
				listVpcsOptionsModel := new(vpcv1.ListVpcsOptions)
				listVpcsOptionsModel.Start = core.StringPtr("testString")
				listVpcsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVpcsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVpcsOptionsModel.ClassicAccess = core.BoolPtr(true)
				listVpcsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVpcs(listVpcsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVpcs with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVpcsOptions model
				listVpcsOptionsModel := new(vpcv1.ListVpcsOptions)
				listVpcsOptionsModel.Start = core.StringPtr("testString")
				listVpcsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVpcsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVpcsOptionsModel.ClassicAccess = core.BoolPtr(true)
				listVpcsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVpcs(listVpcsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVpcs successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVpcsOptions model
				listVpcsOptionsModel := new(vpcv1.ListVpcsOptions)
				listVpcsOptionsModel.Start = core.StringPtr("testString")
				listVpcsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVpcsOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVpcsOptionsModel.ClassicAccess = core.BoolPtr(true)
				listVpcsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVpcs(listVpcsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.VPCCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.VPCCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.VPCCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVpcsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpcs":[{"classic_access":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","cse_source_ips":[{"ip":{"address":"192.168.3.4"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"default_network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"default_routing_table":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840","id":"r006-6885e83f-03b2-4603-8a86-db2a0f55c840","name":"my-routing-table-1","resource_type":"routing_table"},"default_security_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"},"dns":{"enable_hub":false,"resolution_binding_count":0,"resolver":{"servers":[{"address":"192.168.3.4","zone_affinity":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"type":"delegated","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"vpc"}}},"health_reasons":[{"code":"dns_resolution_binding_failed","message":"The VPC specified in the DNS resolution binding has been disconnected.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","public_address_ranges":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a","id":"r006-a4841334-b584-4293-938e-3bc63b4a5b6a","name":"my-public-address-range","resource_type":"public_address_range"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpc","status":"available"}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"vpcs":[{"classic_access":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","cse_source_ips":[{"ip":{"address":"192.168.3.4"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"default_network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"default_routing_table":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840","id":"r006-6885e83f-03b2-4603-8a86-db2a0f55c840","name":"my-routing-table-1","resource_type":"routing_table"},"default_security_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"},"dns":{"enable_hub":false,"resolution_binding_count":0,"resolver":{"servers":[{"address":"192.168.3.4","zone_affinity":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"type":"delegated","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"vpc"}}},"health_reasons":[{"code":"dns_resolution_binding_failed","message":"The VPC specified in the DNS resolution binding has been disconnected.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","public_address_ranges":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a","id":"r006-a4841334-b584-4293-938e-3bc63b4a5b6a","name":"my-public-address-range","resource_type":"public_address_range"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpc","status":"available"}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VpcsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVpcsOptionsModel := &vpcv1.ListVpcsOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					ClassicAccess:   core.BoolPtr(true),
				}

				pager, err := vpcService.NewVpcsPager(listVpcsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.VPC
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VpcsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVpcsOptionsModel := &vpcv1.ListVpcsOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					ClassicAccess:   core.BoolPtr(true),
				}

				pager, err := vpcService.NewVpcsPager(listVpcsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateVPC(createVPCOptions *CreateVPCOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createVPCPath := "/vpcs"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateVPC with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the DnsServerPrototype model
				dnsServerPrototypeModel := new(vpcv1.DnsServerPrototype)
				dnsServerPrototypeModel.Address = core.StringPtr("192.168.3.4")
				dnsServerPrototypeModel.ZoneAffinity = zoneIdentityModel

				// Construct an instance of the VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype model
				vpcdnsResolverPrototypeModel := new(vpcv1.VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype)
				vpcdnsResolverPrototypeModel.ManualServers = []vpcv1.DnsServerPrototype{*dnsServerPrototypeModel}
				vpcdnsResolverPrototypeModel.Type = core.StringPtr("manual")

				// Construct an instance of the VpcdnsPrototype model
				vpcdnsPrototypeModel := new(vpcv1.VpcdnsPrototype)
				vpcdnsPrototypeModel.EnableHub = core.BoolPtr(false)
				vpcdnsPrototypeModel.Resolver = vpcdnsResolverPrototypeModel

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateVPCOptions model
				createVPCOptionsModel := new(vpcv1.CreateVPCOptions)
				createVPCOptionsModel.AddressPrefixManagement = core.StringPtr("auto")
				createVPCOptionsModel.ClassicAccess = core.BoolPtr(false)
				createVPCOptionsModel.Dns = vpcdnsPrototypeModel
				createVPCOptionsModel.Name = core.StringPtr("my-vpc")
				createVPCOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateVPC(createVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateVPC(createVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateVPC(createVPCOptions *CreateVPCOptions)`, func() {
		version := "2024-06-23"
		createVPCPath := "/vpcs"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "dns": {"enable_hub": false, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "public_address_ranges": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "name": "my-public-address-range", "resource_type": "public_address_range"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}`)
				}))
			})
			It(`Invoke CreateVPC successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the DnsServerPrototype model
				dnsServerPrototypeModel := new(vpcv1.DnsServerPrototype)
				dnsServerPrototypeModel.Address = core.StringPtr("192.168.3.4")
				dnsServerPrototypeModel.ZoneAffinity = zoneIdentityModel

				// Construct an instance of the VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype model
				vpcdnsResolverPrototypeModel := new(vpcv1.VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype)
				vpcdnsResolverPrototypeModel.ManualServers = []vpcv1.DnsServerPrototype{*dnsServerPrototypeModel}
				vpcdnsResolverPrototypeModel.Type = core.StringPtr("manual")

				// Construct an instance of the VpcdnsPrototype model
				vpcdnsPrototypeModel := new(vpcv1.VpcdnsPrototype)
				vpcdnsPrototypeModel.EnableHub = core.BoolPtr(false)
				vpcdnsPrototypeModel.Resolver = vpcdnsResolverPrototypeModel

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateVPCOptions model
				createVPCOptionsModel := new(vpcv1.CreateVPCOptions)
				createVPCOptionsModel.AddressPrefixManagement = core.StringPtr("auto")
				createVPCOptionsModel.ClassicAccess = core.BoolPtr(false)
				createVPCOptionsModel.Dns = vpcdnsPrototypeModel
				createVPCOptionsModel.Name = core.StringPtr("my-vpc")
				createVPCOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateVPCWithContext(ctx, createVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateVPC(createVPCOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateVPCWithContext(ctx, createVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "dns": {"enable_hub": false, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "public_address_ranges": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "name": "my-public-address-range", "resource_type": "public_address_range"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}`)
				}))
			})
			It(`Invoke CreateVPC successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateVPC(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the DnsServerPrototype model
				dnsServerPrototypeModel := new(vpcv1.DnsServerPrototype)
				dnsServerPrototypeModel.Address = core.StringPtr("192.168.3.4")
				dnsServerPrototypeModel.ZoneAffinity = zoneIdentityModel

				// Construct an instance of the VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype model
				vpcdnsResolverPrototypeModel := new(vpcv1.VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype)
				vpcdnsResolverPrototypeModel.ManualServers = []vpcv1.DnsServerPrototype{*dnsServerPrototypeModel}
				vpcdnsResolverPrototypeModel.Type = core.StringPtr("manual")

				// Construct an instance of the VpcdnsPrototype model
				vpcdnsPrototypeModel := new(vpcv1.VpcdnsPrototype)
				vpcdnsPrototypeModel.EnableHub = core.BoolPtr(false)
				vpcdnsPrototypeModel.Resolver = vpcdnsResolverPrototypeModel

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateVPCOptions model
				createVPCOptionsModel := new(vpcv1.CreateVPCOptions)
				createVPCOptionsModel.AddressPrefixManagement = core.StringPtr("auto")
				createVPCOptionsModel.ClassicAccess = core.BoolPtr(false)
				createVPCOptionsModel.Dns = vpcdnsPrototypeModel
				createVPCOptionsModel.Name = core.StringPtr("my-vpc")
				createVPCOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateVPC(createVPCOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateVPC with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the DnsServerPrototype model
				dnsServerPrototypeModel := new(vpcv1.DnsServerPrototype)
				dnsServerPrototypeModel.Address = core.StringPtr("192.168.3.4")
				dnsServerPrototypeModel.ZoneAffinity = zoneIdentityModel

				// Construct an instance of the VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype model
				vpcdnsResolverPrototypeModel := new(vpcv1.VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype)
				vpcdnsResolverPrototypeModel.ManualServers = []vpcv1.DnsServerPrototype{*dnsServerPrototypeModel}
				vpcdnsResolverPrototypeModel.Type = core.StringPtr("manual")

				// Construct an instance of the VpcdnsPrototype model
				vpcdnsPrototypeModel := new(vpcv1.VpcdnsPrototype)
				vpcdnsPrototypeModel.EnableHub = core.BoolPtr(false)
				vpcdnsPrototypeModel.Resolver = vpcdnsResolverPrototypeModel

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateVPCOptions model
				createVPCOptionsModel := new(vpcv1.CreateVPCOptions)
				createVPCOptionsModel.AddressPrefixManagement = core.StringPtr("auto")
				createVPCOptionsModel.ClassicAccess = core.BoolPtr(false)
				createVPCOptionsModel.Dns = vpcdnsPrototypeModel
				createVPCOptionsModel.Name = core.StringPtr("my-vpc")
				createVPCOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateVPC(createVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateVPC successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the DnsServerPrototype model
				dnsServerPrototypeModel := new(vpcv1.DnsServerPrototype)
				dnsServerPrototypeModel.Address = core.StringPtr("192.168.3.4")
				dnsServerPrototypeModel.ZoneAffinity = zoneIdentityModel

				// Construct an instance of the VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype model
				vpcdnsResolverPrototypeModel := new(vpcv1.VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype)
				vpcdnsResolverPrototypeModel.ManualServers = []vpcv1.DnsServerPrototype{*dnsServerPrototypeModel}
				vpcdnsResolverPrototypeModel.Type = core.StringPtr("manual")

				// Construct an instance of the VpcdnsPrototype model
				vpcdnsPrototypeModel := new(vpcv1.VpcdnsPrototype)
				vpcdnsPrototypeModel.EnableHub = core.BoolPtr(false)
				vpcdnsPrototypeModel.Resolver = vpcdnsResolverPrototypeModel

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateVPCOptions model
				createVPCOptionsModel := new(vpcv1.CreateVPCOptions)
				createVPCOptionsModel.AddressPrefixManagement = core.StringPtr("auto")
				createVPCOptionsModel.ClassicAccess = core.BoolPtr(false)
				createVPCOptionsModel.Dns = vpcdnsPrototypeModel
				createVPCOptionsModel.Name = core.StringPtr("my-vpc")
				createVPCOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateVPC(createVPCOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteVPC(deleteVPCOptions *DeleteVPCOptions)`, func() {
		version := "2024-06-23"
		deleteVPCPath := "/vpcs/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVPCPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteVPC successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteVPC(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteVPCOptions model
				deleteVPCOptionsModel := new(vpcv1.DeleteVPCOptions)
				deleteVPCOptionsModel.ID = core.StringPtr("testString")
				deleteVPCOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteVPC(deleteVPCOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteVPC with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVPCOptions model
				deleteVPCOptionsModel := new(vpcv1.DeleteVPCOptions)
				deleteVPCOptionsModel.ID = core.StringPtr("testString")
				deleteVPCOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteVPC(deleteVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteVPCOptions model with no property values
				deleteVPCOptionsModelNew := new(vpcv1.DeleteVPCOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteVPC(deleteVPCOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPC(getVPCOptions *GetVPCOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPCPath := "/vpcs/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPC with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCOptions model
				getVPCOptionsModel := new(vpcv1.GetVPCOptions)
				getVPCOptionsModel.ID = core.StringPtr("testString")
				getVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPC(getVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPC(getVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPC(getVPCOptions *GetVPCOptions)`, func() {
		version := "2024-06-23"
		getVPCPath := "/vpcs/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "dns": {"enable_hub": false, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "public_address_ranges": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "name": "my-public-address-range", "resource_type": "public_address_range"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}`)
				}))
			})
			It(`Invoke GetVPC successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPCOptions model
				getVPCOptionsModel := new(vpcv1.GetVPCOptions)
				getVPCOptionsModel.ID = core.StringPtr("testString")
				getVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPCWithContext(ctx, getVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPC(getVPCOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPCWithContext(ctx, getVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "dns": {"enable_hub": false, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "public_address_ranges": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "name": "my-public-address-range", "resource_type": "public_address_range"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}`)
				}))
			})
			It(`Invoke GetVPC successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPC(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPCOptions model
				getVPCOptionsModel := new(vpcv1.GetVPCOptions)
				getVPCOptionsModel.ID = core.StringPtr("testString")
				getVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPC(getVPCOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPC with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCOptions model
				getVPCOptionsModel := new(vpcv1.GetVPCOptions)
				getVPCOptionsModel.ID = core.StringPtr("testString")
				getVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPC(getVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPCOptions model with no property values
				getVPCOptionsModelNew := new(vpcv1.GetVPCOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPC(getVPCOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPC successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCOptions model
				getVPCOptionsModel := new(vpcv1.GetVPCOptions)
				getVPCOptionsModel.ID = core.StringPtr("testString")
				getVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPC(getVPCOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPC(updateVPCOptions *UpdateVPCOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateVPCPath := "/vpcs/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateVPC with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the DnsServerPrototype model
				dnsServerPrototypeModel := new(vpcv1.DnsServerPrototype)
				dnsServerPrototypeModel.Address = core.StringPtr("192.168.3.4")
				dnsServerPrototypeModel.ZoneAffinity = zoneIdentityModel

				// Construct an instance of the VpcdnsResolverVPCPatchVPCIdentityByID model
				vpcdnsResolverVPCPatchModel := new(vpcv1.VpcdnsResolverVPCPatchVPCIdentityByID)
				vpcdnsResolverVPCPatchModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VpcdnsResolverPatch model
				vpcdnsResolverPatchModel := new(vpcv1.VpcdnsResolverPatch)
				vpcdnsResolverPatchModel.ManualServers = []vpcv1.DnsServerPrototype{*dnsServerPrototypeModel}
				vpcdnsResolverPatchModel.Type = core.StringPtr("delegated")
				vpcdnsResolverPatchModel.VPC = vpcdnsResolverVPCPatchModel

				// Construct an instance of the VpcdnsPatch model
				vpcdnsPatchModel := new(vpcv1.VpcdnsPatch)
				vpcdnsPatchModel.EnableHub = core.BoolPtr(true)
				vpcdnsPatchModel.Resolver = vpcdnsResolverPatchModel

				// Construct an instance of the VPCPatch model
				vpcPatchModel := new(vpcv1.VPCPatch)
				vpcPatchModel.Dns = vpcdnsPatchModel
				vpcPatchModel.Name = core.StringPtr("my-vpc")
				vpcPatchModelAsPatch, asPatchErr := vpcPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCOptions model
				updateVPCOptionsModel := new(vpcv1.UpdateVPCOptions)
				updateVPCOptionsModel.ID = core.StringPtr("testString")
				updateVPCOptionsModel.VPCPatch = vpcPatchModelAsPatch
				updateVPCOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateVPC(updateVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateVPC(updateVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPC(updateVPCOptions *UpdateVPCOptions)`, func() {
		version := "2024-06-23"
		updateVPCPath := "/vpcs/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "dns": {"enable_hub": false, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "public_address_ranges": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "name": "my-public-address-range", "resource_type": "public_address_range"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}`)
				}))
			})
			It(`Invoke UpdateVPC successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the DnsServerPrototype model
				dnsServerPrototypeModel := new(vpcv1.DnsServerPrototype)
				dnsServerPrototypeModel.Address = core.StringPtr("192.168.3.4")
				dnsServerPrototypeModel.ZoneAffinity = zoneIdentityModel

				// Construct an instance of the VpcdnsResolverVPCPatchVPCIdentityByID model
				vpcdnsResolverVPCPatchModel := new(vpcv1.VpcdnsResolverVPCPatchVPCIdentityByID)
				vpcdnsResolverVPCPatchModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VpcdnsResolverPatch model
				vpcdnsResolverPatchModel := new(vpcv1.VpcdnsResolverPatch)
				vpcdnsResolverPatchModel.ManualServers = []vpcv1.DnsServerPrototype{*dnsServerPrototypeModel}
				vpcdnsResolverPatchModel.Type = core.StringPtr("delegated")
				vpcdnsResolverPatchModel.VPC = vpcdnsResolverVPCPatchModel

				// Construct an instance of the VpcdnsPatch model
				vpcdnsPatchModel := new(vpcv1.VpcdnsPatch)
				vpcdnsPatchModel.EnableHub = core.BoolPtr(true)
				vpcdnsPatchModel.Resolver = vpcdnsResolverPatchModel

				// Construct an instance of the VPCPatch model
				vpcPatchModel := new(vpcv1.VPCPatch)
				vpcPatchModel.Dns = vpcdnsPatchModel
				vpcPatchModel.Name = core.StringPtr("my-vpc")
				vpcPatchModelAsPatch, asPatchErr := vpcPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCOptions model
				updateVPCOptionsModel := new(vpcv1.UpdateVPCOptions)
				updateVPCOptionsModel.ID = core.StringPtr("testString")
				updateVPCOptionsModel.VPCPatch = vpcPatchModelAsPatch
				updateVPCOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateVPCWithContext(ctx, updateVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateVPC(updateVPCOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateVPCWithContext(ctx, updateVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "dns": {"enable_hub": false, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "public_address_ranges": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "id": "r006-a4841334-b584-4293-938e-3bc63b4a5b6a", "name": "my-public-address-range", "resource_type": "public_address_range"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}`)
				}))
			})
			It(`Invoke UpdateVPC successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateVPC(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the DnsServerPrototype model
				dnsServerPrototypeModel := new(vpcv1.DnsServerPrototype)
				dnsServerPrototypeModel.Address = core.StringPtr("192.168.3.4")
				dnsServerPrototypeModel.ZoneAffinity = zoneIdentityModel

				// Construct an instance of the VpcdnsResolverVPCPatchVPCIdentityByID model
				vpcdnsResolverVPCPatchModel := new(vpcv1.VpcdnsResolverVPCPatchVPCIdentityByID)
				vpcdnsResolverVPCPatchModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VpcdnsResolverPatch model
				vpcdnsResolverPatchModel := new(vpcv1.VpcdnsResolverPatch)
				vpcdnsResolverPatchModel.ManualServers = []vpcv1.DnsServerPrototype{*dnsServerPrototypeModel}
				vpcdnsResolverPatchModel.Type = core.StringPtr("delegated")
				vpcdnsResolverPatchModel.VPC = vpcdnsResolverVPCPatchModel

				// Construct an instance of the VpcdnsPatch model
				vpcdnsPatchModel := new(vpcv1.VpcdnsPatch)
				vpcdnsPatchModel.EnableHub = core.BoolPtr(true)
				vpcdnsPatchModel.Resolver = vpcdnsResolverPatchModel

				// Construct an instance of the VPCPatch model
				vpcPatchModel := new(vpcv1.VPCPatch)
				vpcPatchModel.Dns = vpcdnsPatchModel
				vpcPatchModel.Name = core.StringPtr("my-vpc")
				vpcPatchModelAsPatch, asPatchErr := vpcPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCOptions model
				updateVPCOptionsModel := new(vpcv1.UpdateVPCOptions)
				updateVPCOptionsModel.ID = core.StringPtr("testString")
				updateVPCOptionsModel.VPCPatch = vpcPatchModelAsPatch
				updateVPCOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateVPC(updateVPCOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateVPC with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the DnsServerPrototype model
				dnsServerPrototypeModel := new(vpcv1.DnsServerPrototype)
				dnsServerPrototypeModel.Address = core.StringPtr("192.168.3.4")
				dnsServerPrototypeModel.ZoneAffinity = zoneIdentityModel

				// Construct an instance of the VpcdnsResolverVPCPatchVPCIdentityByID model
				vpcdnsResolverVPCPatchModel := new(vpcv1.VpcdnsResolverVPCPatchVPCIdentityByID)
				vpcdnsResolverVPCPatchModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VpcdnsResolverPatch model
				vpcdnsResolverPatchModel := new(vpcv1.VpcdnsResolverPatch)
				vpcdnsResolverPatchModel.ManualServers = []vpcv1.DnsServerPrototype{*dnsServerPrototypeModel}
				vpcdnsResolverPatchModel.Type = core.StringPtr("delegated")
				vpcdnsResolverPatchModel.VPC = vpcdnsResolverVPCPatchModel

				// Construct an instance of the VpcdnsPatch model
				vpcdnsPatchModel := new(vpcv1.VpcdnsPatch)
				vpcdnsPatchModel.EnableHub = core.BoolPtr(true)
				vpcdnsPatchModel.Resolver = vpcdnsResolverPatchModel

				// Construct an instance of the VPCPatch model
				vpcPatchModel := new(vpcv1.VPCPatch)
				vpcPatchModel.Dns = vpcdnsPatchModel
				vpcPatchModel.Name = core.StringPtr("my-vpc")
				vpcPatchModelAsPatch, asPatchErr := vpcPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCOptions model
				updateVPCOptionsModel := new(vpcv1.UpdateVPCOptions)
				updateVPCOptionsModel.ID = core.StringPtr("testString")
				updateVPCOptionsModel.VPCPatch = vpcPatchModelAsPatch
				updateVPCOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateVPC(updateVPCOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateVPCOptions model with no property values
				updateVPCOptionsModelNew := new(vpcv1.UpdateVPCOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateVPC(updateVPCOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateVPC successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the DnsServerPrototype model
				dnsServerPrototypeModel := new(vpcv1.DnsServerPrototype)
				dnsServerPrototypeModel.Address = core.StringPtr("192.168.3.4")
				dnsServerPrototypeModel.ZoneAffinity = zoneIdentityModel

				// Construct an instance of the VpcdnsResolverVPCPatchVPCIdentityByID model
				vpcdnsResolverVPCPatchModel := new(vpcv1.VpcdnsResolverVPCPatchVPCIdentityByID)
				vpcdnsResolverVPCPatchModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the VpcdnsResolverPatch model
				vpcdnsResolverPatchModel := new(vpcv1.VpcdnsResolverPatch)
				vpcdnsResolverPatchModel.ManualServers = []vpcv1.DnsServerPrototype{*dnsServerPrototypeModel}
				vpcdnsResolverPatchModel.Type = core.StringPtr("delegated")
				vpcdnsResolverPatchModel.VPC = vpcdnsResolverVPCPatchModel

				// Construct an instance of the VpcdnsPatch model
				vpcdnsPatchModel := new(vpcv1.VpcdnsPatch)
				vpcdnsPatchModel.EnableHub = core.BoolPtr(true)
				vpcdnsPatchModel.Resolver = vpcdnsResolverPatchModel

				// Construct an instance of the VPCPatch model
				vpcPatchModel := new(vpcv1.VPCPatch)
				vpcPatchModel.Dns = vpcdnsPatchModel
				vpcPatchModel.Name = core.StringPtr("my-vpc")
				vpcPatchModelAsPatch, asPatchErr := vpcPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCOptions model
				updateVPCOptionsModel := new(vpcv1.UpdateVPCOptions)
				updateVPCOptionsModel.ID = core.StringPtr("testString")
				updateVPCOptionsModel.VPCPatch = vpcPatchModelAsPatch
				updateVPCOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPCOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateVPC(updateVPCOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCDefaultNetworkACL(getVPCDefaultNetworkACLOptions *GetVPCDefaultNetworkACLOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPCDefaultNetworkACLPath := "/vpcs/testString/default_network_acl"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCDefaultNetworkACLPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPCDefaultNetworkACL with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCDefaultNetworkACLOptions model
				getVPCDefaultNetworkACLOptionsModel := new(vpcv1.GetVPCDefaultNetworkACLOptions)
				getVPCDefaultNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPCDefaultNetworkACL(getVPCDefaultNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPCDefaultNetworkACL(getVPCDefaultNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCDefaultNetworkACL(getVPCDefaultNetworkACLOptions *GetVPCDefaultNetworkACLOptions)`, func() {
		version := "2024-06-23"
		getVPCDefaultNetworkACLPath := "/vpcs/testString/default_network_acl"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCDefaultNetworkACLPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "mnemonic-ersatz-eatery-mythology", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetVPCDefaultNetworkACL successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPCDefaultNetworkACLOptions model
				getVPCDefaultNetworkACLOptionsModel := new(vpcv1.GetVPCDefaultNetworkACLOptions)
				getVPCDefaultNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPCDefaultNetworkACLWithContext(ctx, getVPCDefaultNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPCDefaultNetworkACL(getVPCDefaultNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPCDefaultNetworkACLWithContext(ctx, getVPCDefaultNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCDefaultNetworkACLPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "mnemonic-ersatz-eatery-mythology", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-network-acl-rule"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "r006-8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-network-acl-rule", "source": "192.168.3.0/24", "protocol": "all"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetVPCDefaultNetworkACL successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPCDefaultNetworkACL(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPCDefaultNetworkACLOptions model
				getVPCDefaultNetworkACLOptionsModel := new(vpcv1.GetVPCDefaultNetworkACLOptions)
				getVPCDefaultNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPCDefaultNetworkACL(getVPCDefaultNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPCDefaultNetworkACL with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCDefaultNetworkACLOptions model
				getVPCDefaultNetworkACLOptionsModel := new(vpcv1.GetVPCDefaultNetworkACLOptions)
				getVPCDefaultNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPCDefaultNetworkACL(getVPCDefaultNetworkACLOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPCDefaultNetworkACLOptions model with no property values
				getVPCDefaultNetworkACLOptionsModelNew := new(vpcv1.GetVPCDefaultNetworkACLOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPCDefaultNetworkACL(getVPCDefaultNetworkACLOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPCDefaultNetworkACL successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCDefaultNetworkACLOptions model
				getVPCDefaultNetworkACLOptionsModel := new(vpcv1.GetVPCDefaultNetworkACLOptions)
				getVPCDefaultNetworkACLOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultNetworkACLOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPCDefaultNetworkACL(getVPCDefaultNetworkACLOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCDefaultRoutingTable(getVPCDefaultRoutingTableOptions *GetVPCDefaultRoutingTableOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPCDefaultRoutingTablePath := "/vpcs/testString/default_routing_table"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCDefaultRoutingTablePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPCDefaultRoutingTable with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCDefaultRoutingTableOptions model
				getVPCDefaultRoutingTableOptionsModel := new(vpcv1.GetVPCDefaultRoutingTableOptions)
				getVPCDefaultRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPCDefaultRoutingTable(getVPCDefaultRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPCDefaultRoutingTable(getVPCDefaultRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCDefaultRoutingTable(getVPCDefaultRoutingTableOptions *GetVPCDefaultRoutingTableOptions)`, func() {
		version := "2024-06-23"
		getVPCDefaultRoutingTablePath := "/vpcs/testString/default_routing_table"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCDefaultRoutingTablePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": false, "lifecycle_state": "stable", "name": "milled-easy-equine-machines", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": true, "route_internet_ingress": true, "route_transit_gateway_ingress": true, "route_vpc_zone_ingress": false, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "name": "my-vpc-routing-table-route"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}`)
				}))
			})
			It(`Invoke GetVPCDefaultRoutingTable successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPCDefaultRoutingTableOptions model
				getVPCDefaultRoutingTableOptionsModel := new(vpcv1.GetVPCDefaultRoutingTableOptions)
				getVPCDefaultRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPCDefaultRoutingTableWithContext(ctx, getVPCDefaultRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPCDefaultRoutingTable(getVPCDefaultRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPCDefaultRoutingTableWithContext(ctx, getVPCDefaultRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCDefaultRoutingTablePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": false, "lifecycle_state": "stable", "name": "milled-easy-equine-machines", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": true, "route_internet_ingress": true, "route_transit_gateway_ingress": true, "route_vpc_zone_ingress": false, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "name": "my-vpc-routing-table-route"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}`)
				}))
			})
			It(`Invoke GetVPCDefaultRoutingTable successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPCDefaultRoutingTable(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPCDefaultRoutingTableOptions model
				getVPCDefaultRoutingTableOptionsModel := new(vpcv1.GetVPCDefaultRoutingTableOptions)
				getVPCDefaultRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPCDefaultRoutingTable(getVPCDefaultRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPCDefaultRoutingTable with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCDefaultRoutingTableOptions model
				getVPCDefaultRoutingTableOptionsModel := new(vpcv1.GetVPCDefaultRoutingTableOptions)
				getVPCDefaultRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPCDefaultRoutingTable(getVPCDefaultRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPCDefaultRoutingTableOptions model with no property values
				getVPCDefaultRoutingTableOptionsModelNew := new(vpcv1.GetVPCDefaultRoutingTableOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPCDefaultRoutingTable(getVPCDefaultRoutingTableOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPCDefaultRoutingTable successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCDefaultRoutingTableOptions model
				getVPCDefaultRoutingTableOptionsModel := new(vpcv1.GetVPCDefaultRoutingTableOptions)
				getVPCDefaultRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPCDefaultRoutingTable(getVPCDefaultRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCDefaultSecurityGroup(getVPCDefaultSecurityGroupOptions *GetVPCDefaultSecurityGroupOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPCDefaultSecurityGroupPath := "/vpcs/testString/default_security_group"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCDefaultSecurityGroupPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPCDefaultSecurityGroup with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCDefaultSecurityGroupOptions model
				getVPCDefaultSecurityGroupOptionsModel := new(vpcv1.GetVPCDefaultSecurityGroupOptions)
				getVPCDefaultSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPCDefaultSecurityGroup(getVPCDefaultSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPCDefaultSecurityGroup(getVPCDefaultSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCDefaultSecurityGroup(getVPCDefaultSecurityGroupOptions *GetVPCDefaultSecurityGroupOptions)`, func() {
		version := "2024-06-23"
		getVPCDefaultSecurityGroupPath := "/vpcs/testString/default_security_group"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCDefaultSecurityGroupPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "observant-chip-emphatic-engraver", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetVPCDefaultSecurityGroup successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPCDefaultSecurityGroupOptions model
				getVPCDefaultSecurityGroupOptionsModel := new(vpcv1.GetVPCDefaultSecurityGroupOptions)
				getVPCDefaultSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPCDefaultSecurityGroupWithContext(ctx, getVPCDefaultSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPCDefaultSecurityGroup(getVPCDefaultSecurityGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPCDefaultSecurityGroupWithContext(ctx, getVPCDefaultSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCDefaultSecurityGroupPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "observant-chip-emphatic-engraver", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetVPCDefaultSecurityGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPCDefaultSecurityGroup(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPCDefaultSecurityGroupOptions model
				getVPCDefaultSecurityGroupOptionsModel := new(vpcv1.GetVPCDefaultSecurityGroupOptions)
				getVPCDefaultSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPCDefaultSecurityGroup(getVPCDefaultSecurityGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPCDefaultSecurityGroup with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCDefaultSecurityGroupOptions model
				getVPCDefaultSecurityGroupOptionsModel := new(vpcv1.GetVPCDefaultSecurityGroupOptions)
				getVPCDefaultSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPCDefaultSecurityGroup(getVPCDefaultSecurityGroupOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPCDefaultSecurityGroupOptions model with no property values
				getVPCDefaultSecurityGroupOptionsModelNew := new(vpcv1.GetVPCDefaultSecurityGroupOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPCDefaultSecurityGroup(getVPCDefaultSecurityGroupOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPCDefaultSecurityGroup successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCDefaultSecurityGroupOptions model
				getVPCDefaultSecurityGroupOptionsModel := new(vpcv1.GetVPCDefaultSecurityGroupOptions)
				getVPCDefaultSecurityGroupOptionsModel.ID = core.StringPtr("testString")
				getVPCDefaultSecurityGroupOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPCDefaultSecurityGroup(getVPCDefaultSecurityGroupOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPCAddressPrefixes(listVPCAddressPrefixesOptions *ListVPCAddressPrefixesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVPCAddressPrefixesPath := "/vpcs/testString/address_prefixes"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCAddressPrefixesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVPCAddressPrefixes with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCAddressPrefixesOptions model
				listVPCAddressPrefixesOptionsModel := new(vpcv1.ListVPCAddressPrefixesOptions)
				listVPCAddressPrefixesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCAddressPrefixesOptionsModel.Start = core.StringPtr("testString")
				listVPCAddressPrefixesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCAddressPrefixesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVPCAddressPrefixes(listVPCAddressPrefixesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVPCAddressPrefixes(listVPCAddressPrefixesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPCAddressPrefixes(listVPCAddressPrefixesOptions *ListVPCAddressPrefixesOptions)`, func() {
		version := "2024-06-23"
		listVPCAddressPrefixesPath := "/vpcs/testString/address_prefixes"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCAddressPrefixesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789", "id": "r006-68574057-c5e0-4675-ada4-99377d8f4789", "is_default": false, "name": "my-vpc-address-prefix-zone-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPCAddressPrefixes successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVPCAddressPrefixesOptions model
				listVPCAddressPrefixesOptionsModel := new(vpcv1.ListVPCAddressPrefixesOptions)
				listVPCAddressPrefixesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCAddressPrefixesOptionsModel.Start = core.StringPtr("testString")
				listVPCAddressPrefixesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCAddressPrefixesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVPCAddressPrefixesWithContext(ctx, listVPCAddressPrefixesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVPCAddressPrefixes(listVPCAddressPrefixesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVPCAddressPrefixesWithContext(ctx, listVPCAddressPrefixesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCAddressPrefixesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789", "id": "r006-68574057-c5e0-4675-ada4-99377d8f4789", "is_default": false, "name": "my-vpc-address-prefix-zone-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPCAddressPrefixes successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVPCAddressPrefixes(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVPCAddressPrefixesOptions model
				listVPCAddressPrefixesOptionsModel := new(vpcv1.ListVPCAddressPrefixesOptions)
				listVPCAddressPrefixesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCAddressPrefixesOptionsModel.Start = core.StringPtr("testString")
				listVPCAddressPrefixesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCAddressPrefixesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVPCAddressPrefixes(listVPCAddressPrefixesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVPCAddressPrefixes with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCAddressPrefixesOptions model
				listVPCAddressPrefixesOptionsModel := new(vpcv1.ListVPCAddressPrefixesOptions)
				listVPCAddressPrefixesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCAddressPrefixesOptionsModel.Start = core.StringPtr("testString")
				listVPCAddressPrefixesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCAddressPrefixesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVPCAddressPrefixes(listVPCAddressPrefixesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListVPCAddressPrefixesOptions model with no property values
				listVPCAddressPrefixesOptionsModelNew := new(vpcv1.ListVPCAddressPrefixesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListVPCAddressPrefixes(listVPCAddressPrefixesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVPCAddressPrefixes successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCAddressPrefixesOptions model
				listVPCAddressPrefixesOptionsModel := new(vpcv1.ListVPCAddressPrefixesOptions)
				listVPCAddressPrefixesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCAddressPrefixesOptionsModel.Start = core.StringPtr("testString")
				listVPCAddressPrefixesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCAddressPrefixesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVPCAddressPrefixes(listVPCAddressPrefixesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.AddressPrefixCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.AddressPrefixCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.AddressPrefixCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCAddressPrefixesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"address_prefixes":[{"cidr":"192.168.3.0/24","created_at":"2019-01-01T12:00:00.000Z","has_subnets":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789","id":"r006-68574057-c5e0-4675-ada4-99377d8f4789","is_default":false,"name":"my-vpc-address-prefix-zone-1","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"address_prefixes":[{"cidr":"192.168.3.0/24","created_at":"2019-01-01T12:00:00.000Z","has_subnets":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789","id":"r006-68574057-c5e0-4675-ada4-99377d8f4789","is_default":false,"name":"my-vpc-address-prefix-zone-1","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VPCAddressPrefixesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPCAddressPrefixesOptionsModel := &vpcv1.ListVPCAddressPrefixesOptions{
					VPCID: core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewVPCAddressPrefixesPager(listVPCAddressPrefixesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.AddressPrefix
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VPCAddressPrefixesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPCAddressPrefixesOptionsModel := &vpcv1.ListVPCAddressPrefixesOptions{
					VPCID: core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewVPCAddressPrefixesPager(listVPCAddressPrefixesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateVPCAddressPrefix(createVPCAddressPrefixOptions *CreateVPCAddressPrefixOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createVPCAddressPrefixPath := "/vpcs/testString/address_prefixes"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCAddressPrefixPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateVPCAddressPrefix with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the CreateVPCAddressPrefixOptions model
				createVPCAddressPrefixOptionsModel := new(vpcv1.CreateVPCAddressPrefixOptions)
				createVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				createVPCAddressPrefixOptionsModel.CIDR = core.StringPtr("10.240.0.0/18")
				createVPCAddressPrefixOptionsModel.Zone = zoneIdentityModel
				createVPCAddressPrefixOptionsModel.IsDefault = core.BoolPtr(true)
				createVPCAddressPrefixOptionsModel.Name = core.StringPtr("my-vpc-address-prefix-zone-1")
				createVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateVPCAddressPrefix(createVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateVPCAddressPrefix(createVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateVPCAddressPrefix(createVPCAddressPrefixOptions *CreateVPCAddressPrefixOptions)`, func() {
		version := "2024-06-23"
		createVPCAddressPrefixPath := "/vpcs/testString/address_prefixes"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCAddressPrefixPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789", "id": "r006-68574057-c5e0-4675-ada4-99377d8f4789", "is_default": false, "name": "my-vpc-address-prefix-zone-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateVPCAddressPrefix successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the CreateVPCAddressPrefixOptions model
				createVPCAddressPrefixOptionsModel := new(vpcv1.CreateVPCAddressPrefixOptions)
				createVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				createVPCAddressPrefixOptionsModel.CIDR = core.StringPtr("10.240.0.0/18")
				createVPCAddressPrefixOptionsModel.Zone = zoneIdentityModel
				createVPCAddressPrefixOptionsModel.IsDefault = core.BoolPtr(true)
				createVPCAddressPrefixOptionsModel.Name = core.StringPtr("my-vpc-address-prefix-zone-1")
				createVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateVPCAddressPrefixWithContext(ctx, createVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateVPCAddressPrefix(createVPCAddressPrefixOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateVPCAddressPrefixWithContext(ctx, createVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCAddressPrefixPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789", "id": "r006-68574057-c5e0-4675-ada4-99377d8f4789", "is_default": false, "name": "my-vpc-address-prefix-zone-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateVPCAddressPrefix successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateVPCAddressPrefix(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the CreateVPCAddressPrefixOptions model
				createVPCAddressPrefixOptionsModel := new(vpcv1.CreateVPCAddressPrefixOptions)
				createVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				createVPCAddressPrefixOptionsModel.CIDR = core.StringPtr("10.240.0.0/18")
				createVPCAddressPrefixOptionsModel.Zone = zoneIdentityModel
				createVPCAddressPrefixOptionsModel.IsDefault = core.BoolPtr(true)
				createVPCAddressPrefixOptionsModel.Name = core.StringPtr("my-vpc-address-prefix-zone-1")
				createVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateVPCAddressPrefix(createVPCAddressPrefixOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateVPCAddressPrefix with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the CreateVPCAddressPrefixOptions model
				createVPCAddressPrefixOptionsModel := new(vpcv1.CreateVPCAddressPrefixOptions)
				createVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				createVPCAddressPrefixOptionsModel.CIDR = core.StringPtr("10.240.0.0/18")
				createVPCAddressPrefixOptionsModel.Zone = zoneIdentityModel
				createVPCAddressPrefixOptionsModel.IsDefault = core.BoolPtr(true)
				createVPCAddressPrefixOptionsModel.Name = core.StringPtr("my-vpc-address-prefix-zone-1")
				createVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateVPCAddressPrefix(createVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateVPCAddressPrefixOptions model with no property values
				createVPCAddressPrefixOptionsModelNew := new(vpcv1.CreateVPCAddressPrefixOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateVPCAddressPrefix(createVPCAddressPrefixOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateVPCAddressPrefix successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the CreateVPCAddressPrefixOptions model
				createVPCAddressPrefixOptionsModel := new(vpcv1.CreateVPCAddressPrefixOptions)
				createVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				createVPCAddressPrefixOptionsModel.CIDR = core.StringPtr("10.240.0.0/18")
				createVPCAddressPrefixOptionsModel.Zone = zoneIdentityModel
				createVPCAddressPrefixOptionsModel.IsDefault = core.BoolPtr(true)
				createVPCAddressPrefixOptionsModel.Name = core.StringPtr("my-vpc-address-prefix-zone-1")
				createVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateVPCAddressPrefix(createVPCAddressPrefixOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteVPCAddressPrefix(deleteVPCAddressPrefixOptions *DeleteVPCAddressPrefixOptions)`, func() {
		version := "2024-06-23"
		deleteVPCAddressPrefixPath := "/vpcs/testString/address_prefixes/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVPCAddressPrefixPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteVPCAddressPrefix successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteVPCAddressPrefix(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteVPCAddressPrefixOptions model
				deleteVPCAddressPrefixOptionsModel := new(vpcv1.DeleteVPCAddressPrefixOptions)
				deleteVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				deleteVPCAddressPrefixOptionsModel.ID = core.StringPtr("testString")
				deleteVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteVPCAddressPrefix(deleteVPCAddressPrefixOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteVPCAddressPrefix with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVPCAddressPrefixOptions model
				deleteVPCAddressPrefixOptionsModel := new(vpcv1.DeleteVPCAddressPrefixOptions)
				deleteVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				deleteVPCAddressPrefixOptionsModel.ID = core.StringPtr("testString")
				deleteVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteVPCAddressPrefix(deleteVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteVPCAddressPrefixOptions model with no property values
				deleteVPCAddressPrefixOptionsModelNew := new(vpcv1.DeleteVPCAddressPrefixOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteVPCAddressPrefix(deleteVPCAddressPrefixOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCAddressPrefix(getVPCAddressPrefixOptions *GetVPCAddressPrefixOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPCAddressPrefixPath := "/vpcs/testString/address_prefixes/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCAddressPrefixPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPCAddressPrefix with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCAddressPrefixOptions model
				getVPCAddressPrefixOptionsModel := new(vpcv1.GetVPCAddressPrefixOptions)
				getVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				getVPCAddressPrefixOptionsModel.ID = core.StringPtr("testString")
				getVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPCAddressPrefix(getVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPCAddressPrefix(getVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCAddressPrefix(getVPCAddressPrefixOptions *GetVPCAddressPrefixOptions)`, func() {
		version := "2024-06-23"
		getVPCAddressPrefixPath := "/vpcs/testString/address_prefixes/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCAddressPrefixPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789", "id": "r006-68574057-c5e0-4675-ada4-99377d8f4789", "is_default": false, "name": "my-vpc-address-prefix-zone-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetVPCAddressPrefix successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPCAddressPrefixOptions model
				getVPCAddressPrefixOptionsModel := new(vpcv1.GetVPCAddressPrefixOptions)
				getVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				getVPCAddressPrefixOptionsModel.ID = core.StringPtr("testString")
				getVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPCAddressPrefixWithContext(ctx, getVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPCAddressPrefix(getVPCAddressPrefixOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPCAddressPrefixWithContext(ctx, getVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCAddressPrefixPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789", "id": "r006-68574057-c5e0-4675-ada4-99377d8f4789", "is_default": false, "name": "my-vpc-address-prefix-zone-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetVPCAddressPrefix successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPCAddressPrefix(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPCAddressPrefixOptions model
				getVPCAddressPrefixOptionsModel := new(vpcv1.GetVPCAddressPrefixOptions)
				getVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				getVPCAddressPrefixOptionsModel.ID = core.StringPtr("testString")
				getVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPCAddressPrefix(getVPCAddressPrefixOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPCAddressPrefix with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCAddressPrefixOptions model
				getVPCAddressPrefixOptionsModel := new(vpcv1.GetVPCAddressPrefixOptions)
				getVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				getVPCAddressPrefixOptionsModel.ID = core.StringPtr("testString")
				getVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPCAddressPrefix(getVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPCAddressPrefixOptions model with no property values
				getVPCAddressPrefixOptionsModelNew := new(vpcv1.GetVPCAddressPrefixOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPCAddressPrefix(getVPCAddressPrefixOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPCAddressPrefix successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCAddressPrefixOptions model
				getVPCAddressPrefixOptionsModel := new(vpcv1.GetVPCAddressPrefixOptions)
				getVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				getVPCAddressPrefixOptionsModel.ID = core.StringPtr("testString")
				getVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPCAddressPrefix(getVPCAddressPrefixOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPCAddressPrefix(updateVPCAddressPrefixOptions *UpdateVPCAddressPrefixOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateVPCAddressPrefixPath := "/vpcs/testString/address_prefixes/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCAddressPrefixPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateVPCAddressPrefix with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddressPrefixPatch model
				addressPrefixPatchModel := new(vpcv1.AddressPrefixPatch)
				addressPrefixPatchModel.IsDefault = core.BoolPtr(false)
				addressPrefixPatchModel.Name = core.StringPtr("my-vpc-address-prefix-updated")
				addressPrefixPatchModelAsPatch, asPatchErr := addressPrefixPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCAddressPrefixOptions model
				updateVPCAddressPrefixOptionsModel := new(vpcv1.UpdateVPCAddressPrefixOptions)
				updateVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCAddressPrefixOptionsModel.ID = core.StringPtr("testString")
				updateVPCAddressPrefixOptionsModel.AddressPrefixPatch = addressPrefixPatchModelAsPatch
				updateVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateVPCAddressPrefix(updateVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateVPCAddressPrefix(updateVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPCAddressPrefix(updateVPCAddressPrefixOptions *UpdateVPCAddressPrefixOptions)`, func() {
		version := "2024-06-23"
		updateVPCAddressPrefixPath := "/vpcs/testString/address_prefixes/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCAddressPrefixPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789", "id": "r006-68574057-c5e0-4675-ada4-99377d8f4789", "is_default": false, "name": "my-vpc-address-prefix-zone-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateVPCAddressPrefix successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the AddressPrefixPatch model
				addressPrefixPatchModel := new(vpcv1.AddressPrefixPatch)
				addressPrefixPatchModel.IsDefault = core.BoolPtr(false)
				addressPrefixPatchModel.Name = core.StringPtr("my-vpc-address-prefix-updated")
				addressPrefixPatchModelAsPatch, asPatchErr := addressPrefixPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCAddressPrefixOptions model
				updateVPCAddressPrefixOptionsModel := new(vpcv1.UpdateVPCAddressPrefixOptions)
				updateVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCAddressPrefixOptionsModel.ID = core.StringPtr("testString")
				updateVPCAddressPrefixOptionsModel.AddressPrefixPatch = addressPrefixPatchModelAsPatch
				updateVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateVPCAddressPrefixWithContext(ctx, updateVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateVPCAddressPrefix(updateVPCAddressPrefixOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateVPCAddressPrefixWithContext(ctx, updateVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCAddressPrefixPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789", "id": "r006-68574057-c5e0-4675-ada4-99377d8f4789", "is_default": false, "name": "my-vpc-address-prefix-zone-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateVPCAddressPrefix successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateVPCAddressPrefix(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the AddressPrefixPatch model
				addressPrefixPatchModel := new(vpcv1.AddressPrefixPatch)
				addressPrefixPatchModel.IsDefault = core.BoolPtr(false)
				addressPrefixPatchModel.Name = core.StringPtr("my-vpc-address-prefix-updated")
				addressPrefixPatchModelAsPatch, asPatchErr := addressPrefixPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCAddressPrefixOptions model
				updateVPCAddressPrefixOptionsModel := new(vpcv1.UpdateVPCAddressPrefixOptions)
				updateVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCAddressPrefixOptionsModel.ID = core.StringPtr("testString")
				updateVPCAddressPrefixOptionsModel.AddressPrefixPatch = addressPrefixPatchModelAsPatch
				updateVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateVPCAddressPrefix(updateVPCAddressPrefixOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateVPCAddressPrefix with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddressPrefixPatch model
				addressPrefixPatchModel := new(vpcv1.AddressPrefixPatch)
				addressPrefixPatchModel.IsDefault = core.BoolPtr(false)
				addressPrefixPatchModel.Name = core.StringPtr("my-vpc-address-prefix-updated")
				addressPrefixPatchModelAsPatch, asPatchErr := addressPrefixPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCAddressPrefixOptions model
				updateVPCAddressPrefixOptionsModel := new(vpcv1.UpdateVPCAddressPrefixOptions)
				updateVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCAddressPrefixOptionsModel.ID = core.StringPtr("testString")
				updateVPCAddressPrefixOptionsModel.AddressPrefixPatch = addressPrefixPatchModelAsPatch
				updateVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateVPCAddressPrefix(updateVPCAddressPrefixOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateVPCAddressPrefixOptions model with no property values
				updateVPCAddressPrefixOptionsModelNew := new(vpcv1.UpdateVPCAddressPrefixOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateVPCAddressPrefix(updateVPCAddressPrefixOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateVPCAddressPrefix successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddressPrefixPatch model
				addressPrefixPatchModel := new(vpcv1.AddressPrefixPatch)
				addressPrefixPatchModel.IsDefault = core.BoolPtr(false)
				addressPrefixPatchModel.Name = core.StringPtr("my-vpc-address-prefix-updated")
				addressPrefixPatchModelAsPatch, asPatchErr := addressPrefixPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCAddressPrefixOptions model
				updateVPCAddressPrefixOptionsModel := new(vpcv1.UpdateVPCAddressPrefixOptions)
				updateVPCAddressPrefixOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCAddressPrefixOptionsModel.ID = core.StringPtr("testString")
				updateVPCAddressPrefixOptionsModel.AddressPrefixPatch = addressPrefixPatchModelAsPatch
				updateVPCAddressPrefixOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateVPCAddressPrefix(updateVPCAddressPrefixOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPCDnsResolutionBindings(listVPCDnsResolutionBindingsOptions *ListVPCDnsResolutionBindingsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVPCDnsResolutionBindingsPath := "/vpcs/testString/dns_resolution_bindings"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCDnsResolutionBindingsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					Expect(req.URL.Query()["account.id"]).To(Equal([]string{"bb1b52262f7441a586f49068482f1e60"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVPCDnsResolutionBindings with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCDnsResolutionBindingsOptions model
				listVPCDnsResolutionBindingsOptionsModel := new(vpcv1.ListVPCDnsResolutionBindingsOptions)
				listVPCDnsResolutionBindingsOptionsModel.VPCID = core.StringPtr("testString")
				listVPCDnsResolutionBindingsOptionsModel.Sort = core.StringPtr("name")
				listVPCDnsResolutionBindingsOptionsModel.Start = core.StringPtr("testString")
				listVPCDnsResolutionBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCDnsResolutionBindingsOptionsModel.Name = core.StringPtr("my-name")
				listVPCDnsResolutionBindingsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listVPCDnsResolutionBindingsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listVPCDnsResolutionBindingsOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listVPCDnsResolutionBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVPCDnsResolutionBindings(listVPCDnsResolutionBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVPCDnsResolutionBindings(listVPCDnsResolutionBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPCDnsResolutionBindings(listVPCDnsResolutionBindingsOptions *ListVPCDnsResolutionBindingsOptions)`, func() {
		version := "2024-06-23"
		listVPCDnsResolutionBindingsPath := "/vpcs/testString/dns_resolution_bindings"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCDnsResolutionBindingsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					Expect(req.URL.Query()["account.id"]).To(Equal([]string{"bb1b52262f7441a586f49068482f1e60"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"dns_resolution_bindings": [{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPCDnsResolutionBindings successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVPCDnsResolutionBindingsOptions model
				listVPCDnsResolutionBindingsOptionsModel := new(vpcv1.ListVPCDnsResolutionBindingsOptions)
				listVPCDnsResolutionBindingsOptionsModel.VPCID = core.StringPtr("testString")
				listVPCDnsResolutionBindingsOptionsModel.Sort = core.StringPtr("name")
				listVPCDnsResolutionBindingsOptionsModel.Start = core.StringPtr("testString")
				listVPCDnsResolutionBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCDnsResolutionBindingsOptionsModel.Name = core.StringPtr("my-name")
				listVPCDnsResolutionBindingsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listVPCDnsResolutionBindingsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listVPCDnsResolutionBindingsOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listVPCDnsResolutionBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVPCDnsResolutionBindingsWithContext(ctx, listVPCDnsResolutionBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVPCDnsResolutionBindings(listVPCDnsResolutionBindingsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVPCDnsResolutionBindingsWithContext(ctx, listVPCDnsResolutionBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCDnsResolutionBindingsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["vpc.crn"]).To(Equal([]string{"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}))
					Expect(req.URL.Query()["vpc.name"]).To(Equal([]string{"my-vpc"}))
					Expect(req.URL.Query()["account.id"]).To(Equal([]string{"bb1b52262f7441a586f49068482f1e60"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"dns_resolution_bindings": [{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPCDnsResolutionBindings successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVPCDnsResolutionBindings(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVPCDnsResolutionBindingsOptions model
				listVPCDnsResolutionBindingsOptionsModel := new(vpcv1.ListVPCDnsResolutionBindingsOptions)
				listVPCDnsResolutionBindingsOptionsModel.VPCID = core.StringPtr("testString")
				listVPCDnsResolutionBindingsOptionsModel.Sort = core.StringPtr("name")
				listVPCDnsResolutionBindingsOptionsModel.Start = core.StringPtr("testString")
				listVPCDnsResolutionBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCDnsResolutionBindingsOptionsModel.Name = core.StringPtr("my-name")
				listVPCDnsResolutionBindingsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listVPCDnsResolutionBindingsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listVPCDnsResolutionBindingsOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listVPCDnsResolutionBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVPCDnsResolutionBindings(listVPCDnsResolutionBindingsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVPCDnsResolutionBindings with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCDnsResolutionBindingsOptions model
				listVPCDnsResolutionBindingsOptionsModel := new(vpcv1.ListVPCDnsResolutionBindingsOptions)
				listVPCDnsResolutionBindingsOptionsModel.VPCID = core.StringPtr("testString")
				listVPCDnsResolutionBindingsOptionsModel.Sort = core.StringPtr("name")
				listVPCDnsResolutionBindingsOptionsModel.Start = core.StringPtr("testString")
				listVPCDnsResolutionBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCDnsResolutionBindingsOptionsModel.Name = core.StringPtr("my-name")
				listVPCDnsResolutionBindingsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listVPCDnsResolutionBindingsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listVPCDnsResolutionBindingsOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listVPCDnsResolutionBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVPCDnsResolutionBindings(listVPCDnsResolutionBindingsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListVPCDnsResolutionBindingsOptions model with no property values
				listVPCDnsResolutionBindingsOptionsModelNew := new(vpcv1.ListVPCDnsResolutionBindingsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListVPCDnsResolutionBindings(listVPCDnsResolutionBindingsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVPCDnsResolutionBindings successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCDnsResolutionBindingsOptions model
				listVPCDnsResolutionBindingsOptionsModel := new(vpcv1.ListVPCDnsResolutionBindingsOptions)
				listVPCDnsResolutionBindingsOptionsModel.VPCID = core.StringPtr("testString")
				listVPCDnsResolutionBindingsOptionsModel.Sort = core.StringPtr("name")
				listVPCDnsResolutionBindingsOptionsModel.Start = core.StringPtr("testString")
				listVPCDnsResolutionBindingsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCDnsResolutionBindingsOptionsModel.Name = core.StringPtr("my-name")
				listVPCDnsResolutionBindingsOptionsModel.VPCCRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listVPCDnsResolutionBindingsOptionsModel.VPCName = core.StringPtr("my-vpc")
				listVPCDnsResolutionBindingsOptionsModel.AccountID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				listVPCDnsResolutionBindingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVPCDnsResolutionBindings(listVPCDnsResolutionBindingsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.VpcdnsResolutionBindingCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.VpcdnsResolutionBindingCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.VpcdnsResolutionBindingCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCDnsResolutionBindingsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"dns_resolution_bindings":[{"created_at":"2019-01-01T12:00:00.000Z","endpoint_gateways":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","id":"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","name":"my-endpoint-gateway","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"endpoint_gateway"}],"health_reasons":[{"code":"disconnected_from_bound_vpc","message":"The VPC specified in the DNS resolution binding has been disconnected.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1","id":"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1","lifecycle_state":"stable","name":"my-dns-resolution-binding","resource_type":"vpc_dns_resolution_binding","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"vpc"}}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"dns_resolution_bindings":[{"created_at":"2019-01-01T12:00:00.000Z","endpoint_gateways":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","id":"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0","name":"my-endpoint-gateway","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"endpoint_gateway"}],"health_reasons":[{"code":"disconnected_from_bound_vpc","message":"The VPC specified in the DNS resolution binding has been disconnected.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1","id":"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1","lifecycle_state":"stable","name":"my-dns-resolution-binding","resource_type":"vpc_dns_resolution_binding","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"vpc"}}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VPCDnsResolutionBindingsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPCDnsResolutionBindingsOptionsModel := &vpcv1.ListVPCDnsResolutionBindingsOptions{
					VPCID:     core.StringPtr("testString"),
					Sort:      core.StringPtr("name"),
					Limit:     core.Int64Ptr(int64(10)),
					Name:      core.StringPtr("my-name"),
					VPCCRN:    core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:   core.StringPtr("my-vpc"),
					AccountID: core.StringPtr("bb1b52262f7441a586f49068482f1e60"),
				}

				pager, err := vpcService.NewVPCDnsResolutionBindingsPager(listVPCDnsResolutionBindingsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.VpcdnsResolutionBinding
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VPCDnsResolutionBindingsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPCDnsResolutionBindingsOptionsModel := &vpcv1.ListVPCDnsResolutionBindingsOptions{
					VPCID:     core.StringPtr("testString"),
					Sort:      core.StringPtr("name"),
					Limit:     core.Int64Ptr(int64(10)),
					Name:      core.StringPtr("my-name"),
					VPCCRN:    core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"),
					VPCName:   core.StringPtr("my-vpc"),
					AccountID: core.StringPtr("bb1b52262f7441a586f49068482f1e60"),
				}

				pager, err := vpcService.NewVPCDnsResolutionBindingsPager(listVPCDnsResolutionBindingsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptions *CreateVPCDnsResolutionBindingOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createVPCDnsResolutionBindingPath := "/vpcs/testString/dns_resolution_bindings"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCDnsResolutionBindingPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateVPCDnsResolutionBinding with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the CreateVPCDnsResolutionBindingOptions model
				createVPCDnsResolutionBindingOptionsModel := new(vpcv1.CreateVPCDnsResolutionBindingOptions)
				createVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				createVPCDnsResolutionBindingOptionsModel.VPC = vpcIdentityModel
				createVPCDnsResolutionBindingOptionsModel.Name = core.StringPtr("my-dns-resolution-binding")
				createVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptions *CreateVPCDnsResolutionBindingOptions)`, func() {
		version := "2024-06-23"
		createVPCDnsResolutionBindingPath := "/vpcs/testString/dns_resolution_bindings"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCDnsResolutionBindingPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateVPCDnsResolutionBinding successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the CreateVPCDnsResolutionBindingOptions model
				createVPCDnsResolutionBindingOptionsModel := new(vpcv1.CreateVPCDnsResolutionBindingOptions)
				createVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				createVPCDnsResolutionBindingOptionsModel.VPC = vpcIdentityModel
				createVPCDnsResolutionBindingOptionsModel.Name = core.StringPtr("my-dns-resolution-binding")
				createVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateVPCDnsResolutionBindingWithContext(ctx, createVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateVPCDnsResolutionBindingWithContext(ctx, createVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCDnsResolutionBindingPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateVPCDnsResolutionBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateVPCDnsResolutionBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the CreateVPCDnsResolutionBindingOptions model
				createVPCDnsResolutionBindingOptionsModel := new(vpcv1.CreateVPCDnsResolutionBindingOptions)
				createVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				createVPCDnsResolutionBindingOptionsModel.VPC = vpcIdentityModel
				createVPCDnsResolutionBindingOptionsModel.Name = core.StringPtr("my-dns-resolution-binding")
				createVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateVPCDnsResolutionBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the CreateVPCDnsResolutionBindingOptions model
				createVPCDnsResolutionBindingOptionsModel := new(vpcv1.CreateVPCDnsResolutionBindingOptions)
				createVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				createVPCDnsResolutionBindingOptionsModel.VPC = vpcIdentityModel
				createVPCDnsResolutionBindingOptionsModel.Name = core.StringPtr("my-dns-resolution-binding")
				createVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateVPCDnsResolutionBindingOptions model with no property values
				createVPCDnsResolutionBindingOptionsModelNew := new(vpcv1.CreateVPCDnsResolutionBindingOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateVPCDnsResolutionBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

				// Construct an instance of the CreateVPCDnsResolutionBindingOptions model
				createVPCDnsResolutionBindingOptionsModel := new(vpcv1.CreateVPCDnsResolutionBindingOptions)
				createVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				createVPCDnsResolutionBindingOptionsModel.VPC = vpcIdentityModel
				createVPCDnsResolutionBindingOptionsModel.Name = core.StringPtr("my-dns-resolution-binding")
				createVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteVPCDnsResolutionBinding(deleteVPCDnsResolutionBindingOptions *DeleteVPCDnsResolutionBindingOptions) - Operation response error`, func() {
		version := "2024-06-23"
		deleteVPCDnsResolutionBindingPath := "/vpcs/testString/dns_resolution_bindings/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVPCDnsResolutionBindingPath))
					Expect(req.Method).To(Equal("DELETE"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke DeleteVPCDnsResolutionBinding with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVPCDnsResolutionBindingOptions model
				deleteVPCDnsResolutionBindingOptionsModel := new(vpcv1.DeleteVPCDnsResolutionBindingOptions)
				deleteVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				deleteVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				deleteVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.DeleteVPCDnsResolutionBinding(deleteVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.DeleteVPCDnsResolutionBinding(deleteVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteVPCDnsResolutionBinding(deleteVPCDnsResolutionBindingOptions *DeleteVPCDnsResolutionBindingOptions)`, func() {
		version := "2024-06-23"
		deleteVPCDnsResolutionBindingPath := "/vpcs/testString/dns_resolution_bindings/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVPCDnsResolutionBindingPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke DeleteVPCDnsResolutionBinding successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the DeleteVPCDnsResolutionBindingOptions model
				deleteVPCDnsResolutionBindingOptionsModel := new(vpcv1.DeleteVPCDnsResolutionBindingOptions)
				deleteVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				deleteVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				deleteVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.DeleteVPCDnsResolutionBindingWithContext(ctx, deleteVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.DeleteVPCDnsResolutionBinding(deleteVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.DeleteVPCDnsResolutionBindingWithContext(ctx, deleteVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVPCDnsResolutionBindingPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(202)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke DeleteVPCDnsResolutionBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.DeleteVPCDnsResolutionBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the DeleteVPCDnsResolutionBindingOptions model
				deleteVPCDnsResolutionBindingOptionsModel := new(vpcv1.DeleteVPCDnsResolutionBindingOptions)
				deleteVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				deleteVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				deleteVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.DeleteVPCDnsResolutionBinding(deleteVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke DeleteVPCDnsResolutionBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVPCDnsResolutionBindingOptions model
				deleteVPCDnsResolutionBindingOptionsModel := new(vpcv1.DeleteVPCDnsResolutionBindingOptions)
				deleteVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				deleteVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				deleteVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.DeleteVPCDnsResolutionBinding(deleteVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the DeleteVPCDnsResolutionBindingOptions model with no property values
				deleteVPCDnsResolutionBindingOptionsModelNew := new(vpcv1.DeleteVPCDnsResolutionBindingOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.DeleteVPCDnsResolutionBinding(deleteVPCDnsResolutionBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteVPCDnsResolutionBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVPCDnsResolutionBindingOptions model
				deleteVPCDnsResolutionBindingOptionsModel := new(vpcv1.DeleteVPCDnsResolutionBindingOptions)
				deleteVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				deleteVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				deleteVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.DeleteVPCDnsResolutionBinding(deleteVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCDnsResolutionBinding(getVPCDnsResolutionBindingOptions *GetVPCDnsResolutionBindingOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPCDnsResolutionBindingPath := "/vpcs/testString/dns_resolution_bindings/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCDnsResolutionBindingPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPCDnsResolutionBinding with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCDnsResolutionBindingOptions model
				getVPCDnsResolutionBindingOptionsModel := new(vpcv1.GetVPCDnsResolutionBindingOptions)
				getVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				getVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				getVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPCDnsResolutionBinding(getVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPCDnsResolutionBinding(getVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCDnsResolutionBinding(getVPCDnsResolutionBindingOptions *GetVPCDnsResolutionBindingOptions)`, func() {
		version := "2024-06-23"
		getVPCDnsResolutionBindingPath := "/vpcs/testString/dns_resolution_bindings/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCDnsResolutionBindingPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetVPCDnsResolutionBinding successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPCDnsResolutionBindingOptions model
				getVPCDnsResolutionBindingOptionsModel := new(vpcv1.GetVPCDnsResolutionBindingOptions)
				getVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				getVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				getVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPCDnsResolutionBindingWithContext(ctx, getVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPCDnsResolutionBinding(getVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPCDnsResolutionBindingWithContext(ctx, getVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCDnsResolutionBindingPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetVPCDnsResolutionBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPCDnsResolutionBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPCDnsResolutionBindingOptions model
				getVPCDnsResolutionBindingOptionsModel := new(vpcv1.GetVPCDnsResolutionBindingOptions)
				getVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				getVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				getVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPCDnsResolutionBinding(getVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPCDnsResolutionBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCDnsResolutionBindingOptions model
				getVPCDnsResolutionBindingOptionsModel := new(vpcv1.GetVPCDnsResolutionBindingOptions)
				getVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				getVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				getVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPCDnsResolutionBinding(getVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPCDnsResolutionBindingOptions model with no property values
				getVPCDnsResolutionBindingOptionsModelNew := new(vpcv1.GetVPCDnsResolutionBindingOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPCDnsResolutionBinding(getVPCDnsResolutionBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPCDnsResolutionBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCDnsResolutionBindingOptions model
				getVPCDnsResolutionBindingOptionsModel := new(vpcv1.GetVPCDnsResolutionBindingOptions)
				getVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				getVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				getVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPCDnsResolutionBinding(getVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPCDnsResolutionBinding(updateVPCDnsResolutionBindingOptions *UpdateVPCDnsResolutionBindingOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateVPCDnsResolutionBindingPath := "/vpcs/testString/dns_resolution_bindings/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCDnsResolutionBindingPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateVPCDnsResolutionBinding with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VpcdnsResolutionBindingPatch model
				vpcdnsResolutionBindingPatchModel := new(vpcv1.VpcdnsResolutionBindingPatch)
				vpcdnsResolutionBindingPatchModel.Name = core.StringPtr("my-dns-resolution-binding-updated")
				vpcdnsResolutionBindingPatchModelAsPatch, asPatchErr := vpcdnsResolutionBindingPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCDnsResolutionBindingOptions model
				updateVPCDnsResolutionBindingOptionsModel := new(vpcv1.UpdateVPCDnsResolutionBindingOptions)
				updateVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				updateVPCDnsResolutionBindingOptionsModel.VpcdnsResolutionBindingPatch = vpcdnsResolutionBindingPatchModelAsPatch
				updateVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateVPCDnsResolutionBinding(updateVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateVPCDnsResolutionBinding(updateVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPCDnsResolutionBinding(updateVPCDnsResolutionBindingOptions *UpdateVPCDnsResolutionBindingOptions)`, func() {
		version := "2024-06-23"
		updateVPCDnsResolutionBindingPath := "/vpcs/testString/dns_resolution_bindings/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCDnsResolutionBindingPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateVPCDnsResolutionBinding successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VpcdnsResolutionBindingPatch model
				vpcdnsResolutionBindingPatchModel := new(vpcv1.VpcdnsResolutionBindingPatch)
				vpcdnsResolutionBindingPatchModel.Name = core.StringPtr("my-dns-resolution-binding-updated")
				vpcdnsResolutionBindingPatchModelAsPatch, asPatchErr := vpcdnsResolutionBindingPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCDnsResolutionBindingOptions model
				updateVPCDnsResolutionBindingOptionsModel := new(vpcv1.UpdateVPCDnsResolutionBindingOptions)
				updateVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				updateVPCDnsResolutionBindingOptionsModel.VpcdnsResolutionBindingPatch = vpcdnsResolutionBindingPatchModelAsPatch
				updateVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateVPCDnsResolutionBindingWithContext(ctx, updateVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateVPCDnsResolutionBinding(updateVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateVPCDnsResolutionBindingWithContext(ctx, updateVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCDnsResolutionBindingPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "id": "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateVPCDnsResolutionBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateVPCDnsResolutionBinding(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VpcdnsResolutionBindingPatch model
				vpcdnsResolutionBindingPatchModel := new(vpcv1.VpcdnsResolutionBindingPatch)
				vpcdnsResolutionBindingPatchModel.Name = core.StringPtr("my-dns-resolution-binding-updated")
				vpcdnsResolutionBindingPatchModelAsPatch, asPatchErr := vpcdnsResolutionBindingPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCDnsResolutionBindingOptions model
				updateVPCDnsResolutionBindingOptionsModel := new(vpcv1.UpdateVPCDnsResolutionBindingOptions)
				updateVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				updateVPCDnsResolutionBindingOptionsModel.VpcdnsResolutionBindingPatch = vpcdnsResolutionBindingPatchModelAsPatch
				updateVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateVPCDnsResolutionBinding(updateVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateVPCDnsResolutionBinding with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VpcdnsResolutionBindingPatch model
				vpcdnsResolutionBindingPatchModel := new(vpcv1.VpcdnsResolutionBindingPatch)
				vpcdnsResolutionBindingPatchModel.Name = core.StringPtr("my-dns-resolution-binding-updated")
				vpcdnsResolutionBindingPatchModelAsPatch, asPatchErr := vpcdnsResolutionBindingPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCDnsResolutionBindingOptions model
				updateVPCDnsResolutionBindingOptionsModel := new(vpcv1.UpdateVPCDnsResolutionBindingOptions)
				updateVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				updateVPCDnsResolutionBindingOptionsModel.VpcdnsResolutionBindingPatch = vpcdnsResolutionBindingPatchModelAsPatch
				updateVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateVPCDnsResolutionBinding(updateVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateVPCDnsResolutionBindingOptions model with no property values
				updateVPCDnsResolutionBindingOptionsModelNew := new(vpcv1.UpdateVPCDnsResolutionBindingOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateVPCDnsResolutionBinding(updateVPCDnsResolutionBindingOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateVPCDnsResolutionBinding successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VpcdnsResolutionBindingPatch model
				vpcdnsResolutionBindingPatchModel := new(vpcv1.VpcdnsResolutionBindingPatch)
				vpcdnsResolutionBindingPatchModel.Name = core.StringPtr("my-dns-resolution-binding-updated")
				vpcdnsResolutionBindingPatchModelAsPatch, asPatchErr := vpcdnsResolutionBindingPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCDnsResolutionBindingOptions model
				updateVPCDnsResolutionBindingOptionsModel := new(vpcv1.UpdateVPCDnsResolutionBindingOptions)
				updateVPCDnsResolutionBindingOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCDnsResolutionBindingOptionsModel.ID = core.StringPtr("testString")
				updateVPCDnsResolutionBindingOptionsModel.VpcdnsResolutionBindingPatch = vpcdnsResolutionBindingPatchModelAsPatch
				updateVPCDnsResolutionBindingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateVPCDnsResolutionBinding(updateVPCDnsResolutionBindingOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPCRoutes(listVPCRoutesOptions *ListVPCRoutesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVPCRoutesPath := "/vpcs/testString/routes"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCRoutesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVPCRoutes with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCRoutesOptions model
				listVPCRoutesOptionsModel := new(vpcv1.ListVPCRoutesOptions)
				listVPCRoutesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutesOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listVPCRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVPCRoutes(listVPCRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVPCRoutes(listVPCRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPCRoutes(listVPCRoutesOptions *ListVPCRoutesOptions)`, func() {
		version := "2024-06-23"
		listVPCRoutesPath := "/vpcs/testString/routes"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCRoutesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPCRoutes successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVPCRoutesOptions model
				listVPCRoutesOptionsModel := new(vpcv1.ListVPCRoutesOptions)
				listVPCRoutesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutesOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listVPCRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVPCRoutesWithContext(ctx, listVPCRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVPCRoutes(listVPCRoutesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVPCRoutesWithContext(ctx, listVPCRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCRoutesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["zone.name"]).To(Equal([]string{"us-south-1"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPCRoutes successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVPCRoutes(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVPCRoutesOptions model
				listVPCRoutesOptionsModel := new(vpcv1.ListVPCRoutesOptions)
				listVPCRoutesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutesOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listVPCRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVPCRoutes(listVPCRoutesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVPCRoutes with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCRoutesOptions model
				listVPCRoutesOptionsModel := new(vpcv1.ListVPCRoutesOptions)
				listVPCRoutesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutesOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listVPCRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVPCRoutes(listVPCRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListVPCRoutesOptions model with no property values
				listVPCRoutesOptionsModelNew := new(vpcv1.ListVPCRoutesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListVPCRoutes(listVPCRoutesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVPCRoutes successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCRoutesOptions model
				listVPCRoutesOptionsModel := new(vpcv1.ListVPCRoutesOptions)
				listVPCRoutesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutesOptionsModel.ZoneName = core.StringPtr("us-south-1")
				listVPCRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVPCRoutes(listVPCRoutesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.RouteCollectionVPCContext)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.RouteCollectionVPCContext)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.RouteCollectionVPCContext)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCRoutesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1","id":"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1","lifecycle_state":"stable","name":"my-vpc-routing-table-route","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1","id":"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1","lifecycle_state":"stable","name":"my-vpc-routing-table-route","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VPCRoutesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPCRoutesOptionsModel := &vpcv1.ListVPCRoutesOptions{
					VPCID:    core.StringPtr("testString"),
					ZoneName: core.StringPtr("us-south-1"),
					Limit:    core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewVPCRoutesPager(listVPCRoutesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.Route
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VPCRoutesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPCRoutesOptionsModel := &vpcv1.ListVPCRoutesOptions{
					VPCID:    core.StringPtr("testString"),
					ZoneName: core.StringPtr("us-south-1"),
					Limit:    core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewVPCRoutesPager(listVPCRoutesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateVPCRoute(createVPCRouteOptions *CreateVPCRouteOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createVPCRoutePath := "/vpcs/testString/routes"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCRoutePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateVPCRoute with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the CreateVPCRouteOptions model
				createVPCRouteOptionsModel := new(vpcv1.CreateVPCRouteOptions)
				createVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRouteOptionsModel.Destination = core.StringPtr("192.168.3.0/24")
				createVPCRouteOptionsModel.Zone = zoneIdentityModel
				createVPCRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPCRouteOptionsModel.Advertise = core.BoolPtr(false)
				createVPCRouteOptionsModel.Name = core.StringPtr("my-vpc-routing-table-route")
				createVPCRouteOptionsModel.NextHop = routeNextHopPrototypeModel
				createVPCRouteOptionsModel.Priority = core.Int64Ptr(int64(1))
				createVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateVPCRoute(createVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateVPCRoute(createVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateVPCRoute(createVPCRouteOptions *CreateVPCRouteOptions)`, func() {
		version := "2024-06-23"
		createVPCRoutePath := "/vpcs/testString/routes"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCRoutePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateVPCRoute successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the CreateVPCRouteOptions model
				createVPCRouteOptionsModel := new(vpcv1.CreateVPCRouteOptions)
				createVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRouteOptionsModel.Destination = core.StringPtr("192.168.3.0/24")
				createVPCRouteOptionsModel.Zone = zoneIdentityModel
				createVPCRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPCRouteOptionsModel.Advertise = core.BoolPtr(false)
				createVPCRouteOptionsModel.Name = core.StringPtr("my-vpc-routing-table-route")
				createVPCRouteOptionsModel.NextHop = routeNextHopPrototypeModel
				createVPCRouteOptionsModel.Priority = core.Int64Ptr(int64(1))
				createVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateVPCRouteWithContext(ctx, createVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateVPCRoute(createVPCRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateVPCRouteWithContext(ctx, createVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCRoutePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateVPCRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateVPCRoute(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the CreateVPCRouteOptions model
				createVPCRouteOptionsModel := new(vpcv1.CreateVPCRouteOptions)
				createVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRouteOptionsModel.Destination = core.StringPtr("192.168.3.0/24")
				createVPCRouteOptionsModel.Zone = zoneIdentityModel
				createVPCRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPCRouteOptionsModel.Advertise = core.BoolPtr(false)
				createVPCRouteOptionsModel.Name = core.StringPtr("my-vpc-routing-table-route")
				createVPCRouteOptionsModel.NextHop = routeNextHopPrototypeModel
				createVPCRouteOptionsModel.Priority = core.Int64Ptr(int64(1))
				createVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateVPCRoute(createVPCRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateVPCRoute with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the CreateVPCRouteOptions model
				createVPCRouteOptionsModel := new(vpcv1.CreateVPCRouteOptions)
				createVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRouteOptionsModel.Destination = core.StringPtr("192.168.3.0/24")
				createVPCRouteOptionsModel.Zone = zoneIdentityModel
				createVPCRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPCRouteOptionsModel.Advertise = core.BoolPtr(false)
				createVPCRouteOptionsModel.Name = core.StringPtr("my-vpc-routing-table-route")
				createVPCRouteOptionsModel.NextHop = routeNextHopPrototypeModel
				createVPCRouteOptionsModel.Priority = core.Int64Ptr(int64(1))
				createVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateVPCRoute(createVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateVPCRouteOptions model with no property values
				createVPCRouteOptionsModelNew := new(vpcv1.CreateVPCRouteOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateVPCRoute(createVPCRouteOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateVPCRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the CreateVPCRouteOptions model
				createVPCRouteOptionsModel := new(vpcv1.CreateVPCRouteOptions)
				createVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRouteOptionsModel.Destination = core.StringPtr("192.168.3.0/24")
				createVPCRouteOptionsModel.Zone = zoneIdentityModel
				createVPCRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPCRouteOptionsModel.Advertise = core.BoolPtr(false)
				createVPCRouteOptionsModel.Name = core.StringPtr("my-vpc-routing-table-route")
				createVPCRouteOptionsModel.NextHop = routeNextHopPrototypeModel
				createVPCRouteOptionsModel.Priority = core.Int64Ptr(int64(1))
				createVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateVPCRoute(createVPCRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteVPCRoute(deleteVPCRouteOptions *DeleteVPCRouteOptions)`, func() {
		version := "2024-06-23"
		deleteVPCRoutePath := "/vpcs/testString/routes/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVPCRoutePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteVPCRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteVPCRoute(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteVPCRouteOptions model
				deleteVPCRouteOptionsModel := new(vpcv1.DeleteVPCRouteOptions)
				deleteVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				deleteVPCRouteOptionsModel.ID = core.StringPtr("testString")
				deleteVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteVPCRoute(deleteVPCRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteVPCRoute with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVPCRouteOptions model
				deleteVPCRouteOptionsModel := new(vpcv1.DeleteVPCRouteOptions)
				deleteVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				deleteVPCRouteOptionsModel.ID = core.StringPtr("testString")
				deleteVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteVPCRoute(deleteVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteVPCRouteOptions model with no property values
				deleteVPCRouteOptionsModelNew := new(vpcv1.DeleteVPCRouteOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteVPCRoute(deleteVPCRouteOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCRoute(getVPCRouteOptions *GetVPCRouteOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPCRoutePath := "/vpcs/testString/routes/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCRoutePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPCRoute with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCRouteOptions model
				getVPCRouteOptionsModel := new(vpcv1.GetVPCRouteOptions)
				getVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRouteOptionsModel.ID = core.StringPtr("testString")
				getVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPCRoute(getVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPCRoute(getVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCRoute(getVPCRouteOptions *GetVPCRouteOptions)`, func() {
		version := "2024-06-23"
		getVPCRoutePath := "/vpcs/testString/routes/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCRoutePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetVPCRoute successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPCRouteOptions model
				getVPCRouteOptionsModel := new(vpcv1.GetVPCRouteOptions)
				getVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRouteOptionsModel.ID = core.StringPtr("testString")
				getVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPCRouteWithContext(ctx, getVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPCRoute(getVPCRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPCRouteWithContext(ctx, getVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCRoutePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetVPCRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPCRoute(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPCRouteOptions model
				getVPCRouteOptionsModel := new(vpcv1.GetVPCRouteOptions)
				getVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRouteOptionsModel.ID = core.StringPtr("testString")
				getVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPCRoute(getVPCRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPCRoute with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCRouteOptions model
				getVPCRouteOptionsModel := new(vpcv1.GetVPCRouteOptions)
				getVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRouteOptionsModel.ID = core.StringPtr("testString")
				getVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPCRoute(getVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPCRouteOptions model with no property values
				getVPCRouteOptionsModelNew := new(vpcv1.GetVPCRouteOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPCRoute(getVPCRouteOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPCRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCRouteOptions model
				getVPCRouteOptionsModel := new(vpcv1.GetVPCRouteOptions)
				getVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRouteOptionsModel.ID = core.StringPtr("testString")
				getVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPCRoute(getVPCRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPCRoute(updateVPCRouteOptions *UpdateVPCRouteOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateVPCRoutePath := "/vpcs/testString/routes/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCRoutePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateVPCRoute with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPatchModel := new(vpcv1.RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPatchModel.Address = core.StringPtr("10.240.0.12")

				// Construct an instance of the RoutePatch model
				routePatchModel := new(vpcv1.RoutePatch)
				routePatchModel.Advertise = core.BoolPtr(true)
				routePatchModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePatchModel.NextHop = routeNextHopPatchModel
				routePatchModel.Priority = core.Int64Ptr(int64(1))
				routePatchModelAsPatch, asPatchErr := routePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRouteOptions model
				updateVPCRouteOptionsModel := new(vpcv1.UpdateVPCRouteOptions)
				updateVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPCRouteOptionsModel.RoutePatch = routePatchModelAsPatch
				updateVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateVPCRoute(updateVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateVPCRoute(updateVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPCRoute(updateVPCRouteOptions *UpdateVPCRouteOptions)`, func() {
		version := "2024-06-23"
		updateVPCRoutePath := "/vpcs/testString/routes/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCRoutePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateVPCRoute successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPatchModel := new(vpcv1.RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPatchModel.Address = core.StringPtr("10.240.0.12")

				// Construct an instance of the RoutePatch model
				routePatchModel := new(vpcv1.RoutePatch)
				routePatchModel.Advertise = core.BoolPtr(true)
				routePatchModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePatchModel.NextHop = routeNextHopPatchModel
				routePatchModel.Priority = core.Int64Ptr(int64(1))
				routePatchModelAsPatch, asPatchErr := routePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRouteOptions model
				updateVPCRouteOptionsModel := new(vpcv1.UpdateVPCRouteOptions)
				updateVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPCRouteOptionsModel.RoutePatch = routePatchModelAsPatch
				updateVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateVPCRouteWithContext(ctx, updateVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateVPCRoute(updateVPCRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateVPCRouteWithContext(ctx, updateVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCRoutePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateVPCRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateVPCRoute(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPatchModel := new(vpcv1.RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPatchModel.Address = core.StringPtr("10.240.0.12")

				// Construct an instance of the RoutePatch model
				routePatchModel := new(vpcv1.RoutePatch)
				routePatchModel.Advertise = core.BoolPtr(true)
				routePatchModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePatchModel.NextHop = routeNextHopPatchModel
				routePatchModel.Priority = core.Int64Ptr(int64(1))
				routePatchModelAsPatch, asPatchErr := routePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRouteOptions model
				updateVPCRouteOptionsModel := new(vpcv1.UpdateVPCRouteOptions)
				updateVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPCRouteOptionsModel.RoutePatch = routePatchModelAsPatch
				updateVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateVPCRoute(updateVPCRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateVPCRoute with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPatchModel := new(vpcv1.RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPatchModel.Address = core.StringPtr("10.240.0.12")

				// Construct an instance of the RoutePatch model
				routePatchModel := new(vpcv1.RoutePatch)
				routePatchModel.Advertise = core.BoolPtr(true)
				routePatchModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePatchModel.NextHop = routeNextHopPatchModel
				routePatchModel.Priority = core.Int64Ptr(int64(1))
				routePatchModelAsPatch, asPatchErr := routePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRouteOptions model
				updateVPCRouteOptionsModel := new(vpcv1.UpdateVPCRouteOptions)
				updateVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPCRouteOptionsModel.RoutePatch = routePatchModelAsPatch
				updateVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateVPCRoute(updateVPCRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateVPCRouteOptions model with no property values
				updateVPCRouteOptionsModelNew := new(vpcv1.UpdateVPCRouteOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateVPCRoute(updateVPCRouteOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateVPCRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPatchModel := new(vpcv1.RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPatchModel.Address = core.StringPtr("10.240.0.12")

				// Construct an instance of the RoutePatch model
				routePatchModel := new(vpcv1.RoutePatch)
				routePatchModel.Advertise = core.BoolPtr(true)
				routePatchModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePatchModel.NextHop = routeNextHopPatchModel
				routePatchModel.Priority = core.Int64Ptr(int64(1))
				routePatchModelAsPatch, asPatchErr := routePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRouteOptions model
				updateVPCRouteOptionsModel := new(vpcv1.UpdateVPCRouteOptions)
				updateVPCRouteOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPCRouteOptionsModel.RoutePatch = routePatchModelAsPatch
				updateVPCRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateVPCRoute(updateVPCRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPCRoutingTables(listVPCRoutingTablesOptions *ListVPCRoutingTablesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVPCRoutingTablesPath := "/vpcs/testString/routing_tables"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCRoutingTablesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// TODO: Add check for is_default query parameter
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVPCRoutingTables with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCRoutingTablesOptions model
				listVPCRoutingTablesOptionsModel := new(vpcv1.ListVPCRoutingTablesOptions)
				listVPCRoutingTablesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutingTablesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutingTablesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutingTablesOptionsModel.IsDefault = core.BoolPtr(true)
				listVPCRoutingTablesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVPCRoutingTables(listVPCRoutingTablesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVPCRoutingTables(listVPCRoutingTablesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPCRoutingTables(listVPCRoutingTablesOptions *ListVPCRoutingTablesOptions)`, func() {
		version := "2024-06-23"
		listVPCRoutingTablesPath := "/vpcs/testString/routing_tables"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCRoutingTablesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// TODO: Add check for is_default query parameter
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": false, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": true, "route_internet_ingress": true, "route_transit_gateway_ingress": true, "route_vpc_zone_ingress": false, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "name": "my-vpc-routing-table-route"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPCRoutingTables successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVPCRoutingTablesOptions model
				listVPCRoutingTablesOptionsModel := new(vpcv1.ListVPCRoutingTablesOptions)
				listVPCRoutingTablesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutingTablesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutingTablesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutingTablesOptionsModel.IsDefault = core.BoolPtr(true)
				listVPCRoutingTablesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVPCRoutingTablesWithContext(ctx, listVPCRoutingTablesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVPCRoutingTables(listVPCRoutingTablesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVPCRoutingTablesWithContext(ctx, listVPCRoutingTablesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCRoutingTablesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// TODO: Add check for is_default query parameter
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": false, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": true, "route_internet_ingress": true, "route_transit_gateway_ingress": true, "route_vpc_zone_ingress": false, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "name": "my-vpc-routing-table-route"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPCRoutingTables successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVPCRoutingTables(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVPCRoutingTablesOptions model
				listVPCRoutingTablesOptionsModel := new(vpcv1.ListVPCRoutingTablesOptions)
				listVPCRoutingTablesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutingTablesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutingTablesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutingTablesOptionsModel.IsDefault = core.BoolPtr(true)
				listVPCRoutingTablesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVPCRoutingTables(listVPCRoutingTablesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVPCRoutingTables with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCRoutingTablesOptions model
				listVPCRoutingTablesOptionsModel := new(vpcv1.ListVPCRoutingTablesOptions)
				listVPCRoutingTablesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutingTablesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutingTablesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutingTablesOptionsModel.IsDefault = core.BoolPtr(true)
				listVPCRoutingTablesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVPCRoutingTables(listVPCRoutingTablesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListVPCRoutingTablesOptions model with no property values
				listVPCRoutingTablesOptionsModelNew := new(vpcv1.ListVPCRoutingTablesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListVPCRoutingTables(listVPCRoutingTablesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVPCRoutingTables successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCRoutingTablesOptions model
				listVPCRoutingTablesOptionsModel := new(vpcv1.ListVPCRoutingTablesOptions)
				listVPCRoutingTablesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutingTablesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutingTablesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutingTablesOptionsModel.IsDefault = core.BoolPtr(true)
				listVPCRoutingTablesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVPCRoutingTables(listVPCRoutingTablesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.RoutingTableCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.RoutingTableCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.RoutingTableCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCRoutingTablesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"routing_tables":[{"accept_routes_from":[{"resource_type":"vpn_server"}],"advertise_routes_to":["transit_gateway"],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840","id":"r006-6885e83f-03b2-4603-8a86-db2a0f55c840","is_default":false,"lifecycle_state":"stable","name":"my-routing-table-1","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"routing_table","route_direct_link_ingress":true,"route_internet_ingress":true,"route_transit_gateway_ingress":true,"route_vpc_zone_ingress":false,"routes":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1","id":"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1","name":"my-vpc-routing-table-route"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}]}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"routing_tables":[{"accept_routes_from":[{"resource_type":"vpn_server"}],"advertise_routes_to":["transit_gateway"],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840","id":"r006-6885e83f-03b2-4603-8a86-db2a0f55c840","is_default":false,"lifecycle_state":"stable","name":"my-routing-table-1","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"routing_table","route_direct_link_ingress":true,"route_internet_ingress":true,"route_transit_gateway_ingress":true,"route_vpc_zone_ingress":false,"routes":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1","id":"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1","name":"my-vpc-routing-table-route"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}]}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VPCRoutingTablesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPCRoutingTablesOptionsModel := &vpcv1.ListVPCRoutingTablesOptions{
					VPCID:     core.StringPtr("testString"),
					Limit:     core.Int64Ptr(int64(10)),
					IsDefault: core.BoolPtr(true),
				}

				pager, err := vpcService.NewVPCRoutingTablesPager(listVPCRoutingTablesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.RoutingTable
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VPCRoutingTablesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPCRoutingTablesOptionsModel := &vpcv1.ListVPCRoutingTablesOptions{
					VPCID:     core.StringPtr("testString"),
					Limit:     core.Int64Ptr(int64(10)),
					IsDefault: core.BoolPtr(true),
				}

				pager, err := vpcService.NewVPCRoutingTablesPager(listVPCRoutingTablesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateVPCRoutingTable(createVPCRoutingTableOptions *CreateVPCRoutingTableOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createVPCRoutingTablePath := "/vpcs/testString/routing_tables"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCRoutingTablePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateVPCRoutingTable with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceFilter model
				resourceFilterModel := new(vpcv1.ResourceFilter)
				resourceFilterModel.ResourceType = core.StringPtr("vpn_server")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RoutePrototype model
				routePrototypeModel := new(vpcv1.RoutePrototype)
				routePrototypeModel.Action = core.StringPtr("deliver")
				routePrototypeModel.Advertise = core.BoolPtr(false)
				routePrototypeModel.Destination = core.StringPtr("192.168.3.0/24")
				routePrototypeModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePrototypeModel.NextHop = routeNextHopPrototypeModel
				routePrototypeModel.Priority = core.Int64Ptr(int64(1))
				routePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateVPCRoutingTableOptions model
				createVPCRoutingTableOptionsModel := new(vpcv1.CreateVPCRoutingTableOptions)
				createVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRoutingTableOptionsModel.AcceptRoutesFrom = []vpcv1.ResourceFilter{*resourceFilterModel}
				createVPCRoutingTableOptionsModel.AdvertiseRoutesTo = []string{}
				createVPCRoutingTableOptionsModel.Name = core.StringPtr("my-routing-table-1")
				createVPCRoutingTableOptionsModel.RouteDirectLinkIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteInternetIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteTransitGatewayIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteVPCZoneIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.Routes = []vpcv1.RoutePrototype{*routePrototypeModel}
				createVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateVPCRoutingTable(createVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateVPCRoutingTable(createVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateVPCRoutingTable(createVPCRoutingTableOptions *CreateVPCRoutingTableOptions)`, func() {
		version := "2024-06-23"
		createVPCRoutingTablePath := "/vpcs/testString/routing_tables"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCRoutingTablePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": false, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": true, "route_internet_ingress": true, "route_transit_gateway_ingress": true, "route_vpc_zone_ingress": false, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "name": "my-vpc-routing-table-route"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}`)
				}))
			})
			It(`Invoke CreateVPCRoutingTable successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ResourceFilter model
				resourceFilterModel := new(vpcv1.ResourceFilter)
				resourceFilterModel.ResourceType = core.StringPtr("vpn_server")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RoutePrototype model
				routePrototypeModel := new(vpcv1.RoutePrototype)
				routePrototypeModel.Action = core.StringPtr("deliver")
				routePrototypeModel.Advertise = core.BoolPtr(false)
				routePrototypeModel.Destination = core.StringPtr("192.168.3.0/24")
				routePrototypeModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePrototypeModel.NextHop = routeNextHopPrototypeModel
				routePrototypeModel.Priority = core.Int64Ptr(int64(1))
				routePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateVPCRoutingTableOptions model
				createVPCRoutingTableOptionsModel := new(vpcv1.CreateVPCRoutingTableOptions)
				createVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRoutingTableOptionsModel.AcceptRoutesFrom = []vpcv1.ResourceFilter{*resourceFilterModel}
				createVPCRoutingTableOptionsModel.AdvertiseRoutesTo = []string{}
				createVPCRoutingTableOptionsModel.Name = core.StringPtr("my-routing-table-1")
				createVPCRoutingTableOptionsModel.RouteDirectLinkIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteInternetIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteTransitGatewayIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteVPCZoneIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.Routes = []vpcv1.RoutePrototype{*routePrototypeModel}
				createVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateVPCRoutingTableWithContext(ctx, createVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateVPCRoutingTable(createVPCRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateVPCRoutingTableWithContext(ctx, createVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCRoutingTablePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": false, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": true, "route_internet_ingress": true, "route_transit_gateway_ingress": true, "route_vpc_zone_ingress": false, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "name": "my-vpc-routing-table-route"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}`)
				}))
			})
			It(`Invoke CreateVPCRoutingTable successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateVPCRoutingTable(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ResourceFilter model
				resourceFilterModel := new(vpcv1.ResourceFilter)
				resourceFilterModel.ResourceType = core.StringPtr("vpn_server")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RoutePrototype model
				routePrototypeModel := new(vpcv1.RoutePrototype)
				routePrototypeModel.Action = core.StringPtr("deliver")
				routePrototypeModel.Advertise = core.BoolPtr(false)
				routePrototypeModel.Destination = core.StringPtr("192.168.3.0/24")
				routePrototypeModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePrototypeModel.NextHop = routeNextHopPrototypeModel
				routePrototypeModel.Priority = core.Int64Ptr(int64(1))
				routePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateVPCRoutingTableOptions model
				createVPCRoutingTableOptionsModel := new(vpcv1.CreateVPCRoutingTableOptions)
				createVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRoutingTableOptionsModel.AcceptRoutesFrom = []vpcv1.ResourceFilter{*resourceFilterModel}
				createVPCRoutingTableOptionsModel.AdvertiseRoutesTo = []string{}
				createVPCRoutingTableOptionsModel.Name = core.StringPtr("my-routing-table-1")
				createVPCRoutingTableOptionsModel.RouteDirectLinkIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteInternetIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteTransitGatewayIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteVPCZoneIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.Routes = []vpcv1.RoutePrototype{*routePrototypeModel}
				createVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateVPCRoutingTable(createVPCRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateVPCRoutingTable with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceFilter model
				resourceFilterModel := new(vpcv1.ResourceFilter)
				resourceFilterModel.ResourceType = core.StringPtr("vpn_server")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RoutePrototype model
				routePrototypeModel := new(vpcv1.RoutePrototype)
				routePrototypeModel.Action = core.StringPtr("deliver")
				routePrototypeModel.Advertise = core.BoolPtr(false)
				routePrototypeModel.Destination = core.StringPtr("192.168.3.0/24")
				routePrototypeModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePrototypeModel.NextHop = routeNextHopPrototypeModel
				routePrototypeModel.Priority = core.Int64Ptr(int64(1))
				routePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateVPCRoutingTableOptions model
				createVPCRoutingTableOptionsModel := new(vpcv1.CreateVPCRoutingTableOptions)
				createVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRoutingTableOptionsModel.AcceptRoutesFrom = []vpcv1.ResourceFilter{*resourceFilterModel}
				createVPCRoutingTableOptionsModel.AdvertiseRoutesTo = []string{}
				createVPCRoutingTableOptionsModel.Name = core.StringPtr("my-routing-table-1")
				createVPCRoutingTableOptionsModel.RouteDirectLinkIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteInternetIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteTransitGatewayIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteVPCZoneIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.Routes = []vpcv1.RoutePrototype{*routePrototypeModel}
				createVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateVPCRoutingTable(createVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateVPCRoutingTableOptions model with no property values
				createVPCRoutingTableOptionsModelNew := new(vpcv1.CreateVPCRoutingTableOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateVPCRoutingTable(createVPCRoutingTableOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateVPCRoutingTable successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceFilter model
				resourceFilterModel := new(vpcv1.ResourceFilter)
				resourceFilterModel.ResourceType = core.StringPtr("vpn_server")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RoutePrototype model
				routePrototypeModel := new(vpcv1.RoutePrototype)
				routePrototypeModel.Action = core.StringPtr("deliver")
				routePrototypeModel.Advertise = core.BoolPtr(false)
				routePrototypeModel.Destination = core.StringPtr("192.168.3.0/24")
				routePrototypeModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePrototypeModel.NextHop = routeNextHopPrototypeModel
				routePrototypeModel.Priority = core.Int64Ptr(int64(1))
				routePrototypeModel.Zone = zoneIdentityModel

				// Construct an instance of the CreateVPCRoutingTableOptions model
				createVPCRoutingTableOptionsModel := new(vpcv1.CreateVPCRoutingTableOptions)
				createVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRoutingTableOptionsModel.AcceptRoutesFrom = []vpcv1.ResourceFilter{*resourceFilterModel}
				createVPCRoutingTableOptionsModel.AdvertiseRoutesTo = []string{}
				createVPCRoutingTableOptionsModel.Name = core.StringPtr("my-routing-table-1")
				createVPCRoutingTableOptionsModel.RouteDirectLinkIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteInternetIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteTransitGatewayIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.RouteVPCZoneIngress = core.BoolPtr(false)
				createVPCRoutingTableOptionsModel.Routes = []vpcv1.RoutePrototype{*routePrototypeModel}
				createVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateVPCRoutingTable(createVPCRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteVPCRoutingTable(deleteVPCRoutingTableOptions *DeleteVPCRoutingTableOptions)`, func() {
		version := "2024-06-23"
		deleteVPCRoutingTablePath := "/vpcs/testString/routing_tables/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVPCRoutingTablePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteVPCRoutingTable successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteVPCRoutingTable(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteVPCRoutingTableOptions model
				deleteVPCRoutingTableOptionsModel := new(vpcv1.DeleteVPCRoutingTableOptions)
				deleteVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				deleteVPCRoutingTableOptionsModel.ID = core.StringPtr("testString")
				deleteVPCRoutingTableOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteVPCRoutingTable(deleteVPCRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteVPCRoutingTable with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVPCRoutingTableOptions model
				deleteVPCRoutingTableOptionsModel := new(vpcv1.DeleteVPCRoutingTableOptions)
				deleteVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				deleteVPCRoutingTableOptionsModel.ID = core.StringPtr("testString")
				deleteVPCRoutingTableOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteVPCRoutingTable(deleteVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteVPCRoutingTableOptions model with no property values
				deleteVPCRoutingTableOptionsModelNew := new(vpcv1.DeleteVPCRoutingTableOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteVPCRoutingTable(deleteVPCRoutingTableOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCRoutingTable(getVPCRoutingTableOptions *GetVPCRoutingTableOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPCRoutingTablePath := "/vpcs/testString/routing_tables/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCRoutingTablePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPCRoutingTable with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCRoutingTableOptions model
				getVPCRoutingTableOptionsModel := new(vpcv1.GetVPCRoutingTableOptions)
				getVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPCRoutingTable(getVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPCRoutingTable(getVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCRoutingTable(getVPCRoutingTableOptions *GetVPCRoutingTableOptions)`, func() {
		version := "2024-06-23"
		getVPCRoutingTablePath := "/vpcs/testString/routing_tables/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCRoutingTablePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": false, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": true, "route_internet_ingress": true, "route_transit_gateway_ingress": true, "route_vpc_zone_ingress": false, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "name": "my-vpc-routing-table-route"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}`)
				}))
			})
			It(`Invoke GetVPCRoutingTable successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPCRoutingTableOptions model
				getVPCRoutingTableOptionsModel := new(vpcv1.GetVPCRoutingTableOptions)
				getVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPCRoutingTableWithContext(ctx, getVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPCRoutingTable(getVPCRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPCRoutingTableWithContext(ctx, getVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCRoutingTablePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": false, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": true, "route_internet_ingress": true, "route_transit_gateway_ingress": true, "route_vpc_zone_ingress": false, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "name": "my-vpc-routing-table-route"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}`)
				}))
			})
			It(`Invoke GetVPCRoutingTable successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPCRoutingTable(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPCRoutingTableOptions model
				getVPCRoutingTableOptionsModel := new(vpcv1.GetVPCRoutingTableOptions)
				getVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPCRoutingTable(getVPCRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPCRoutingTable with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCRoutingTableOptions model
				getVPCRoutingTableOptionsModel := new(vpcv1.GetVPCRoutingTableOptions)
				getVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPCRoutingTable(getVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPCRoutingTableOptions model with no property values
				getVPCRoutingTableOptionsModelNew := new(vpcv1.GetVPCRoutingTableOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPCRoutingTable(getVPCRoutingTableOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPCRoutingTable successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCRoutingTableOptions model
				getVPCRoutingTableOptionsModel := new(vpcv1.GetVPCRoutingTableOptions)
				getVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRoutingTableOptionsModel.ID = core.StringPtr("testString")
				getVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPCRoutingTable(getVPCRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPCRoutingTable(updateVPCRoutingTableOptions *UpdateVPCRoutingTableOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateVPCRoutingTablePath := "/vpcs/testString/routing_tables/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCRoutingTablePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateVPCRoutingTable with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceFilter model
				resourceFilterModel := new(vpcv1.ResourceFilter)
				resourceFilterModel.ResourceType = core.StringPtr("vpn_server")

				// Construct an instance of the RoutingTablePatch model
				routingTablePatchModel := new(vpcv1.RoutingTablePatch)
				routingTablePatchModel.AcceptRoutesFrom = []vpcv1.ResourceFilter{*resourceFilterModel}
				routingTablePatchModel.AdvertiseRoutesTo = []string{"transit_gateway"}
				routingTablePatchModel.Name = core.StringPtr("my-routing-table-2")
				routingTablePatchModel.RouteDirectLinkIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteInternetIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteTransitGatewayIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteVPCZoneIngress = core.BoolPtr(true)
				routingTablePatchModelAsPatch, asPatchErr := routingTablePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRoutingTableOptions model
				updateVPCRoutingTableOptionsModel := new(vpcv1.UpdateVPCRoutingTableOptions)
				updateVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRoutingTableOptionsModel.ID = core.StringPtr("testString")
				updateVPCRoutingTableOptionsModel.RoutingTablePatch = routingTablePatchModelAsPatch
				updateVPCRoutingTableOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateVPCRoutingTable(updateVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateVPCRoutingTable(updateVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPCRoutingTable(updateVPCRoutingTableOptions *UpdateVPCRoutingTableOptions)`, func() {
		version := "2024-06-23"
		updateVPCRoutingTablePath := "/vpcs/testString/routing_tables/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCRoutingTablePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": false, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": true, "route_internet_ingress": true, "route_transit_gateway_ingress": true, "route_vpc_zone_ingress": false, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "name": "my-vpc-routing-table-route"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}`)
				}))
			})
			It(`Invoke UpdateVPCRoutingTable successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ResourceFilter model
				resourceFilterModel := new(vpcv1.ResourceFilter)
				resourceFilterModel.ResourceType = core.StringPtr("vpn_server")

				// Construct an instance of the RoutingTablePatch model
				routingTablePatchModel := new(vpcv1.RoutingTablePatch)
				routingTablePatchModel.AcceptRoutesFrom = []vpcv1.ResourceFilter{*resourceFilterModel}
				routingTablePatchModel.AdvertiseRoutesTo = []string{"transit_gateway"}
				routingTablePatchModel.Name = core.StringPtr("my-routing-table-2")
				routingTablePatchModel.RouteDirectLinkIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteInternetIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteTransitGatewayIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteVPCZoneIngress = core.BoolPtr(true)
				routingTablePatchModelAsPatch, asPatchErr := routingTablePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRoutingTableOptions model
				updateVPCRoutingTableOptionsModel := new(vpcv1.UpdateVPCRoutingTableOptions)
				updateVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRoutingTableOptionsModel.ID = core.StringPtr("testString")
				updateVPCRoutingTableOptionsModel.RoutingTablePatch = routingTablePatchModelAsPatch
				updateVPCRoutingTableOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateVPCRoutingTableWithContext(ctx, updateVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateVPCRoutingTable(updateVPCRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateVPCRoutingTableWithContext(ctx, updateVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCRoutingTablePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": false, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": true, "route_internet_ingress": true, "route_transit_gateway_ingress": true, "route_vpc_zone_ingress": false, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "name": "my-vpc-routing-table-route"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}`)
				}))
			})
			It(`Invoke UpdateVPCRoutingTable successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateVPCRoutingTable(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ResourceFilter model
				resourceFilterModel := new(vpcv1.ResourceFilter)
				resourceFilterModel.ResourceType = core.StringPtr("vpn_server")

				// Construct an instance of the RoutingTablePatch model
				routingTablePatchModel := new(vpcv1.RoutingTablePatch)
				routingTablePatchModel.AcceptRoutesFrom = []vpcv1.ResourceFilter{*resourceFilterModel}
				routingTablePatchModel.AdvertiseRoutesTo = []string{"transit_gateway"}
				routingTablePatchModel.Name = core.StringPtr("my-routing-table-2")
				routingTablePatchModel.RouteDirectLinkIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteInternetIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteTransitGatewayIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteVPCZoneIngress = core.BoolPtr(true)
				routingTablePatchModelAsPatch, asPatchErr := routingTablePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRoutingTableOptions model
				updateVPCRoutingTableOptionsModel := new(vpcv1.UpdateVPCRoutingTableOptions)
				updateVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRoutingTableOptionsModel.ID = core.StringPtr("testString")
				updateVPCRoutingTableOptionsModel.RoutingTablePatch = routingTablePatchModelAsPatch
				updateVPCRoutingTableOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateVPCRoutingTable(updateVPCRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateVPCRoutingTable with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceFilter model
				resourceFilterModel := new(vpcv1.ResourceFilter)
				resourceFilterModel.ResourceType = core.StringPtr("vpn_server")

				// Construct an instance of the RoutingTablePatch model
				routingTablePatchModel := new(vpcv1.RoutingTablePatch)
				routingTablePatchModel.AcceptRoutesFrom = []vpcv1.ResourceFilter{*resourceFilterModel}
				routingTablePatchModel.AdvertiseRoutesTo = []string{"transit_gateway"}
				routingTablePatchModel.Name = core.StringPtr("my-routing-table-2")
				routingTablePatchModel.RouteDirectLinkIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteInternetIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteTransitGatewayIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteVPCZoneIngress = core.BoolPtr(true)
				routingTablePatchModelAsPatch, asPatchErr := routingTablePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRoutingTableOptions model
				updateVPCRoutingTableOptionsModel := new(vpcv1.UpdateVPCRoutingTableOptions)
				updateVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRoutingTableOptionsModel.ID = core.StringPtr("testString")
				updateVPCRoutingTableOptionsModel.RoutingTablePatch = routingTablePatchModelAsPatch
				updateVPCRoutingTableOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateVPCRoutingTable(updateVPCRoutingTableOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateVPCRoutingTableOptions model with no property values
				updateVPCRoutingTableOptionsModelNew := new(vpcv1.UpdateVPCRoutingTableOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateVPCRoutingTable(updateVPCRoutingTableOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateVPCRoutingTable successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceFilter model
				resourceFilterModel := new(vpcv1.ResourceFilter)
				resourceFilterModel.ResourceType = core.StringPtr("vpn_server")

				// Construct an instance of the RoutingTablePatch model
				routingTablePatchModel := new(vpcv1.RoutingTablePatch)
				routingTablePatchModel.AcceptRoutesFrom = []vpcv1.ResourceFilter{*resourceFilterModel}
				routingTablePatchModel.AdvertiseRoutesTo = []string{"transit_gateway"}
				routingTablePatchModel.Name = core.StringPtr("my-routing-table-2")
				routingTablePatchModel.RouteDirectLinkIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteInternetIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteTransitGatewayIngress = core.BoolPtr(true)
				routingTablePatchModel.RouteVPCZoneIngress = core.BoolPtr(true)
				routingTablePatchModelAsPatch, asPatchErr := routingTablePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRoutingTableOptions model
				updateVPCRoutingTableOptionsModel := new(vpcv1.UpdateVPCRoutingTableOptions)
				updateVPCRoutingTableOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRoutingTableOptionsModel.ID = core.StringPtr("testString")
				updateVPCRoutingTableOptionsModel.RoutingTablePatch = routingTablePatchModelAsPatch
				updateVPCRoutingTableOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPCRoutingTableOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateVPCRoutingTable(updateVPCRoutingTableOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPCRoutingTableRoutes(listVPCRoutingTableRoutesOptions *ListVPCRoutingTableRoutesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVPCRoutingTableRoutesPath := "/vpcs/testString/routing_tables/testString/routes"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCRoutingTableRoutesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVPCRoutingTableRoutes with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCRoutingTableRoutesOptions model
				listVPCRoutingTableRoutesOptionsModel := new(vpcv1.ListVPCRoutingTableRoutesOptions)
				listVPCRoutingTableRoutesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.RoutingTableID = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutingTableRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVPCRoutingTableRoutes(listVPCRoutingTableRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVPCRoutingTableRoutes(listVPCRoutingTableRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPCRoutingTableRoutes(listVPCRoutingTableRoutesOptions *ListVPCRoutingTableRoutesOptions)`, func() {
		version := "2024-06-23"
		listVPCRoutingTableRoutesPath := "/vpcs/testString/routing_tables/testString/routes"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCRoutingTableRoutesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPCRoutingTableRoutes successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVPCRoutingTableRoutesOptions model
				listVPCRoutingTableRoutesOptionsModel := new(vpcv1.ListVPCRoutingTableRoutesOptions)
				listVPCRoutingTableRoutesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.RoutingTableID = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutingTableRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVPCRoutingTableRoutesWithContext(ctx, listVPCRoutingTableRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVPCRoutingTableRoutes(listVPCRoutingTableRoutesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVPCRoutingTableRoutesWithContext(ctx, listVPCRoutingTableRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCRoutingTableRoutesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPCRoutingTableRoutes successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVPCRoutingTableRoutes(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVPCRoutingTableRoutesOptions model
				listVPCRoutingTableRoutesOptionsModel := new(vpcv1.ListVPCRoutingTableRoutesOptions)
				listVPCRoutingTableRoutesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.RoutingTableID = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutingTableRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVPCRoutingTableRoutes(listVPCRoutingTableRoutesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVPCRoutingTableRoutes with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCRoutingTableRoutesOptions model
				listVPCRoutingTableRoutesOptionsModel := new(vpcv1.ListVPCRoutingTableRoutesOptions)
				listVPCRoutingTableRoutesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.RoutingTableID = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutingTableRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVPCRoutingTableRoutes(listVPCRoutingTableRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListVPCRoutingTableRoutesOptions model with no property values
				listVPCRoutingTableRoutesOptionsModelNew := new(vpcv1.ListVPCRoutingTableRoutesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListVPCRoutingTableRoutes(listVPCRoutingTableRoutesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVPCRoutingTableRoutes successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPCRoutingTableRoutesOptions model
				listVPCRoutingTableRoutesOptionsModel := new(vpcv1.ListVPCRoutingTableRoutesOptions)
				listVPCRoutingTableRoutesOptionsModel.VPCID = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.RoutingTableID = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPCRoutingTableRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPCRoutingTableRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVPCRoutingTableRoutes(listVPCRoutingTableRoutesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.RouteCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.RouteCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.RouteCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPCRoutingTableRoutesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1","id":"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1","lifecycle_state":"stable","name":"my-vpc-routing-table-route","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1","id":"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1","lifecycle_state":"stable","name":"my-vpc-routing-table-route","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VPCRoutingTableRoutesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPCRoutingTableRoutesOptionsModel := &vpcv1.ListVPCRoutingTableRoutesOptions{
					VPCID:          core.StringPtr("testString"),
					RoutingTableID: core.StringPtr("testString"),
					Limit:          core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewVPCRoutingTableRoutesPager(listVPCRoutingTableRoutesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.Route
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VPCRoutingTableRoutesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPCRoutingTableRoutesOptionsModel := &vpcv1.ListVPCRoutingTableRoutesOptions{
					VPCID:          core.StringPtr("testString"),
					RoutingTableID: core.StringPtr("testString"),
					Limit:          core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewVPCRoutingTableRoutesPager(listVPCRoutingTableRoutesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateVPCRoutingTableRoute(createVPCRoutingTableRouteOptions *CreateVPCRoutingTableRouteOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createVPCRoutingTableRoutePath := "/vpcs/testString/routing_tables/testString/routes"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCRoutingTableRoutePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateVPCRoutingTableRoute with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the CreateVPCRoutingTableRouteOptions model
				createVPCRoutingTableRouteOptionsModel := new(vpcv1.CreateVPCRoutingTableRouteOptions)
				createVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				createVPCRoutingTableRouteOptionsModel.Destination = core.StringPtr("192.168.3.0/24")
				createVPCRoutingTableRouteOptionsModel.Zone = zoneIdentityModel
				createVPCRoutingTableRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPCRoutingTableRouteOptionsModel.Advertise = core.BoolPtr(false)
				createVPCRoutingTableRouteOptionsModel.Name = core.StringPtr("my-vpc-routing-table-route")
				createVPCRoutingTableRouteOptionsModel.NextHop = routeNextHopPrototypeModel
				createVPCRoutingTableRouteOptionsModel.Priority = core.Int64Ptr(int64(1))
				createVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateVPCRoutingTableRoute(createVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateVPCRoutingTableRoute(createVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateVPCRoutingTableRoute(createVPCRoutingTableRouteOptions *CreateVPCRoutingTableRouteOptions)`, func() {
		version := "2024-06-23"
		createVPCRoutingTableRoutePath := "/vpcs/testString/routing_tables/testString/routes"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCRoutingTableRoutePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateVPCRoutingTableRoute successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the CreateVPCRoutingTableRouteOptions model
				createVPCRoutingTableRouteOptionsModel := new(vpcv1.CreateVPCRoutingTableRouteOptions)
				createVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				createVPCRoutingTableRouteOptionsModel.Destination = core.StringPtr("192.168.3.0/24")
				createVPCRoutingTableRouteOptionsModel.Zone = zoneIdentityModel
				createVPCRoutingTableRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPCRoutingTableRouteOptionsModel.Advertise = core.BoolPtr(false)
				createVPCRoutingTableRouteOptionsModel.Name = core.StringPtr("my-vpc-routing-table-route")
				createVPCRoutingTableRouteOptionsModel.NextHop = routeNextHopPrototypeModel
				createVPCRoutingTableRouteOptionsModel.Priority = core.Int64Ptr(int64(1))
				createVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateVPCRoutingTableRouteWithContext(ctx, createVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateVPCRoutingTableRoute(createVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateVPCRoutingTableRouteWithContext(ctx, createVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPCRoutingTableRoutePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke CreateVPCRoutingTableRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateVPCRoutingTableRoute(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the CreateVPCRoutingTableRouteOptions model
				createVPCRoutingTableRouteOptionsModel := new(vpcv1.CreateVPCRoutingTableRouteOptions)
				createVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				createVPCRoutingTableRouteOptionsModel.Destination = core.StringPtr("192.168.3.0/24")
				createVPCRoutingTableRouteOptionsModel.Zone = zoneIdentityModel
				createVPCRoutingTableRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPCRoutingTableRouteOptionsModel.Advertise = core.BoolPtr(false)
				createVPCRoutingTableRouteOptionsModel.Name = core.StringPtr("my-vpc-routing-table-route")
				createVPCRoutingTableRouteOptionsModel.NextHop = routeNextHopPrototypeModel
				createVPCRoutingTableRouteOptionsModel.Priority = core.Int64Ptr(int64(1))
				createVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateVPCRoutingTableRoute(createVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateVPCRoutingTableRoute with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the CreateVPCRoutingTableRouteOptions model
				createVPCRoutingTableRouteOptionsModel := new(vpcv1.CreateVPCRoutingTableRouteOptions)
				createVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				createVPCRoutingTableRouteOptionsModel.Destination = core.StringPtr("192.168.3.0/24")
				createVPCRoutingTableRouteOptionsModel.Zone = zoneIdentityModel
				createVPCRoutingTableRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPCRoutingTableRouteOptionsModel.Advertise = core.BoolPtr(false)
				createVPCRoutingTableRouteOptionsModel.Name = core.StringPtr("my-vpc-routing-table-route")
				createVPCRoutingTableRouteOptionsModel.NextHop = routeNextHopPrototypeModel
				createVPCRoutingTableRouteOptionsModel.Priority = core.Int64Ptr(int64(1))
				createVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateVPCRoutingTableRoute(createVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateVPCRoutingTableRouteOptions model with no property values
				createVPCRoutingTableRouteOptionsModelNew := new(vpcv1.CreateVPCRoutingTableRouteOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateVPCRoutingTableRoute(createVPCRoutingTableRouteOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateVPCRoutingTableRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				zoneIdentityModel.Name = core.StringPtr("us-south-1")

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the CreateVPCRoutingTableRouteOptions model
				createVPCRoutingTableRouteOptionsModel := new(vpcv1.CreateVPCRoutingTableRouteOptions)
				createVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				createVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				createVPCRoutingTableRouteOptionsModel.Destination = core.StringPtr("192.168.3.0/24")
				createVPCRoutingTableRouteOptionsModel.Zone = zoneIdentityModel
				createVPCRoutingTableRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPCRoutingTableRouteOptionsModel.Advertise = core.BoolPtr(false)
				createVPCRoutingTableRouteOptionsModel.Name = core.StringPtr("my-vpc-routing-table-route")
				createVPCRoutingTableRouteOptionsModel.NextHop = routeNextHopPrototypeModel
				createVPCRoutingTableRouteOptionsModel.Priority = core.Int64Ptr(int64(1))
				createVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateVPCRoutingTableRoute(createVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteVPCRoutingTableRoute(deleteVPCRoutingTableRouteOptions *DeleteVPCRoutingTableRouteOptions)`, func() {
		version := "2024-06-23"
		deleteVPCRoutingTableRoutePath := "/vpcs/testString/routing_tables/testString/routes/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVPCRoutingTableRoutePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteVPCRoutingTableRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteVPCRoutingTableRoute(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteVPCRoutingTableRouteOptions model
				deleteVPCRoutingTableRouteOptionsModel := new(vpcv1.DeleteVPCRoutingTableRouteOptions)
				deleteVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				deleteVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				deleteVPCRoutingTableRouteOptionsModel.ID = core.StringPtr("testString")
				deleteVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteVPCRoutingTableRoute(deleteVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteVPCRoutingTableRoute with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVPCRoutingTableRouteOptions model
				deleteVPCRoutingTableRouteOptionsModel := new(vpcv1.DeleteVPCRoutingTableRouteOptions)
				deleteVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				deleteVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				deleteVPCRoutingTableRouteOptionsModel.ID = core.StringPtr("testString")
				deleteVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteVPCRoutingTableRoute(deleteVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteVPCRoutingTableRouteOptions model with no property values
				deleteVPCRoutingTableRouteOptionsModelNew := new(vpcv1.DeleteVPCRoutingTableRouteOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteVPCRoutingTableRoute(deleteVPCRoutingTableRouteOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCRoutingTableRoute(getVPCRoutingTableRouteOptions *GetVPCRoutingTableRouteOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPCRoutingTableRoutePath := "/vpcs/testString/routing_tables/testString/routes/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCRoutingTableRoutePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPCRoutingTableRoute with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCRoutingTableRouteOptions model
				getVPCRoutingTableRouteOptionsModel := new(vpcv1.GetVPCRoutingTableRouteOptions)
				getVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.ID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPCRoutingTableRoute(getVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPCRoutingTableRoute(getVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPCRoutingTableRoute(getVPCRoutingTableRouteOptions *GetVPCRoutingTableRouteOptions)`, func() {
		version := "2024-06-23"
		getVPCRoutingTableRoutePath := "/vpcs/testString/routing_tables/testString/routes/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCRoutingTableRoutePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetVPCRoutingTableRoute successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPCRoutingTableRouteOptions model
				getVPCRoutingTableRouteOptionsModel := new(vpcv1.GetVPCRoutingTableRouteOptions)
				getVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.ID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPCRoutingTableRouteWithContext(ctx, getVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPCRoutingTableRoute(getVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPCRoutingTableRouteWithContext(ctx, getVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPCRoutingTableRoutePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke GetVPCRoutingTableRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPCRoutingTableRoute(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPCRoutingTableRouteOptions model
				getVPCRoutingTableRouteOptionsModel := new(vpcv1.GetVPCRoutingTableRouteOptions)
				getVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.ID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPCRoutingTableRoute(getVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPCRoutingTableRoute with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCRoutingTableRouteOptions model
				getVPCRoutingTableRouteOptionsModel := new(vpcv1.GetVPCRoutingTableRouteOptions)
				getVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.ID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPCRoutingTableRoute(getVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPCRoutingTableRouteOptions model with no property values
				getVPCRoutingTableRouteOptionsModelNew := new(vpcv1.GetVPCRoutingTableRouteOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPCRoutingTableRoute(getVPCRoutingTableRouteOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPCRoutingTableRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPCRoutingTableRouteOptions model
				getVPCRoutingTableRouteOptionsModel := new(vpcv1.GetVPCRoutingTableRouteOptions)
				getVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.ID = core.StringPtr("testString")
				getVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPCRoutingTableRoute(getVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPCRoutingTableRoute(updateVPCRoutingTableRouteOptions *UpdateVPCRoutingTableRouteOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateVPCRoutingTableRoutePath := "/vpcs/testString/routing_tables/testString/routes/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCRoutingTableRoutePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateVPCRoutingTableRoute with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPatchModel := new(vpcv1.RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPatchModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the RoutePatch model
				routePatchModel := new(vpcv1.RoutePatch)
				routePatchModel.Advertise = core.BoolPtr(false)
				routePatchModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePatchModel.NextHop = routeNextHopPatchModel
				routePatchModel.Priority = core.Int64Ptr(int64(1))
				routePatchModelAsPatch, asPatchErr := routePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRoutingTableRouteOptions model
				updateVPCRoutingTableRouteOptionsModel := new(vpcv1.UpdateVPCRoutingTableRouteOptions)
				updateVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.RoutePatch = routePatchModelAsPatch
				updateVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateVPCRoutingTableRoute(updateVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateVPCRoutingTableRoute(updateVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPCRoutingTableRoute(updateVPCRoutingTableRouteOptions *UpdateVPCRoutingTableRouteOptions)`, func() {
		version := "2024-06-23"
		updateVPCRoutingTableRoutePath := "/vpcs/testString/routing_tables/testString/routes/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCRoutingTableRoutePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateVPCRoutingTableRoute successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPatchModel := new(vpcv1.RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPatchModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the RoutePatch model
				routePatchModel := new(vpcv1.RoutePatch)
				routePatchModel.Advertise = core.BoolPtr(false)
				routePatchModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePatchModel.NextHop = routeNextHopPatchModel
				routePatchModel.Priority = core.Int64Ptr(int64(1))
				routePatchModelAsPatch, asPatchErr := routePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRoutingTableRouteOptions model
				updateVPCRoutingTableRouteOptionsModel := new(vpcv1.UpdateVPCRoutingTableRouteOptions)
				updateVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.RoutePatch = routePatchModelAsPatch
				updateVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateVPCRoutingTableRouteWithContext(ctx, updateVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateVPCRoutingTableRoute(updateVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateVPCRoutingTableRouteWithContext(ctx, updateVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPCRoutingTableRoutePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "id": "r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1", "lifecycle_state": "stable", "name": "my-vpc-routing-table-route", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}`)
				}))
			})
			It(`Invoke UpdateVPCRoutingTableRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateVPCRoutingTableRoute(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPatchModel := new(vpcv1.RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPatchModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the RoutePatch model
				routePatchModel := new(vpcv1.RoutePatch)
				routePatchModel.Advertise = core.BoolPtr(false)
				routePatchModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePatchModel.NextHop = routeNextHopPatchModel
				routePatchModel.Priority = core.Int64Ptr(int64(1))
				routePatchModelAsPatch, asPatchErr := routePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRoutingTableRouteOptions model
				updateVPCRoutingTableRouteOptionsModel := new(vpcv1.UpdateVPCRoutingTableRouteOptions)
				updateVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.RoutePatch = routePatchModelAsPatch
				updateVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateVPCRoutingTableRoute(updateVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateVPCRoutingTableRoute with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPatchModel := new(vpcv1.RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPatchModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the RoutePatch model
				routePatchModel := new(vpcv1.RoutePatch)
				routePatchModel.Advertise = core.BoolPtr(false)
				routePatchModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePatchModel.NextHop = routeNextHopPatchModel
				routePatchModel.Priority = core.Int64Ptr(int64(1))
				routePatchModelAsPatch, asPatchErr := routePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRoutingTableRouteOptions model
				updateVPCRoutingTableRouteOptionsModel := new(vpcv1.UpdateVPCRoutingTableRouteOptions)
				updateVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.RoutePatch = routePatchModelAsPatch
				updateVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateVPCRoutingTableRoute(updateVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateVPCRoutingTableRouteOptions model with no property values
				updateVPCRoutingTableRouteOptionsModelNew := new(vpcv1.UpdateVPCRoutingTableRouteOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateVPCRoutingTableRoute(updateVPCRoutingTableRouteOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateVPCRoutingTableRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPatchModel := new(vpcv1.RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP)
				routeNextHopPatchModel.Address = core.StringPtr("0.0.0.0")

				// Construct an instance of the RoutePatch model
				routePatchModel := new(vpcv1.RoutePatch)
				routePatchModel.Advertise = core.BoolPtr(false)
				routePatchModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePatchModel.NextHop = routeNextHopPatchModel
				routePatchModel.Priority = core.Int64Ptr(int64(1))
				routePatchModelAsPatch, asPatchErr := routePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPCRoutingTableRouteOptions model
				updateVPCRoutingTableRouteOptionsModel := new(vpcv1.UpdateVPCRoutingTableRouteOptions)
				updateVPCRoutingTableRouteOptionsModel.VPCID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.RoutingTableID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPCRoutingTableRouteOptionsModel.RoutePatch = routePatchModelAsPatch
				updateVPCRoutingTableRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateVPCRoutingTableRoute(updateVPCRoutingTableRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListIkePolicies(listIkePoliciesOptions *ListIkePoliciesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listIkePoliciesPath := "/ike_policies"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIkePoliciesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListIkePolicies with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListIkePoliciesOptions model
				listIkePoliciesOptionsModel := new(vpcv1.ListIkePoliciesOptions)
				listIkePoliciesOptionsModel.Start = core.StringPtr("testString")
				listIkePoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIkePoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListIkePolicies(listIkePoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListIkePolicies(listIkePoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListIkePolicies(listIkePoliciesOptions *ListIkePoliciesOptions)`, func() {
		version := "2024-06-23"
		listIkePoliciesPath := "/ike_policies"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIkePoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListIkePolicies successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListIkePoliciesOptions model
				listIkePoliciesOptionsModel := new(vpcv1.ListIkePoliciesOptions)
				listIkePoliciesOptionsModel.Start = core.StringPtr("testString")
				listIkePoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIkePoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListIkePoliciesWithContext(ctx, listIkePoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListIkePolicies(listIkePoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListIkePoliciesWithContext(ctx, listIkePoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIkePoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListIkePolicies successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListIkePolicies(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListIkePoliciesOptions model
				listIkePoliciesOptionsModel := new(vpcv1.ListIkePoliciesOptions)
				listIkePoliciesOptionsModel.Start = core.StringPtr("testString")
				listIkePoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIkePoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListIkePolicies(listIkePoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListIkePolicies with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListIkePoliciesOptions model
				listIkePoliciesOptionsModel := new(vpcv1.ListIkePoliciesOptions)
				listIkePoliciesOptionsModel.Start = core.StringPtr("testString")
				listIkePoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIkePoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListIkePolicies(listIkePoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListIkePolicies successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListIkePoliciesOptions model
				listIkePoliciesOptionsModel := new(vpcv1.ListIkePoliciesOptions)
				listIkePoliciesOptionsModel.Start = core.StringPtr("testString")
				listIkePoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIkePoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListIkePolicies(listIkePoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.IkePolicyCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.IkePolicyCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.IkePolicyCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIkePoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","id":"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","name":"my-vpn-gateway-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","id":"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","id":"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","name":"my-vpn-gateway-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","id":"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use IkePoliciesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listIkePoliciesOptionsModel := &vpcv1.ListIkePoliciesOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewIkePoliciesPager(listIkePoliciesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.IkePolicy
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use IkePoliciesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listIkePoliciesOptionsModel := &vpcv1.ListIkePoliciesOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewIkePoliciesPager(listIkePoliciesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateIkePolicy(createIkePolicyOptions *CreateIkePolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createIkePolicyPath := "/ike_policies"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createIkePolicyPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateIkePolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateIkePolicyOptions model
				createIkePolicyOptionsModel := new(vpcv1.CreateIkePolicyOptions)
				createIkePolicyOptionsModel.AuthenticationAlgorithm = core.StringPtr("sha256")
				createIkePolicyOptionsModel.DhGroup = core.Int64Ptr(int64(14))
				createIkePolicyOptionsModel.EncryptionAlgorithm = core.StringPtr("aes128")
				createIkePolicyOptionsModel.IkeVersion = core.Int64Ptr(int64(1))
				createIkePolicyOptionsModel.KeyLifetime = core.Int64Ptr(int64(28800))
				createIkePolicyOptionsModel.Name = core.StringPtr("my-ike-policy")
				createIkePolicyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateIkePolicy(createIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateIkePolicy(createIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateIkePolicy(createIkePolicyOptions *CreateIkePolicyOptions)`, func() {
		version := "2024-06-23"
		createIkePolicyPath := "/ike_policies"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createIkePolicyPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}`)
				}))
			})
			It(`Invoke CreateIkePolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateIkePolicyOptions model
				createIkePolicyOptionsModel := new(vpcv1.CreateIkePolicyOptions)
				createIkePolicyOptionsModel.AuthenticationAlgorithm = core.StringPtr("sha256")
				createIkePolicyOptionsModel.DhGroup = core.Int64Ptr(int64(14))
				createIkePolicyOptionsModel.EncryptionAlgorithm = core.StringPtr("aes128")
				createIkePolicyOptionsModel.IkeVersion = core.Int64Ptr(int64(1))
				createIkePolicyOptionsModel.KeyLifetime = core.Int64Ptr(int64(28800))
				createIkePolicyOptionsModel.Name = core.StringPtr("my-ike-policy")
				createIkePolicyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateIkePolicyWithContext(ctx, createIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateIkePolicy(createIkePolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateIkePolicyWithContext(ctx, createIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createIkePolicyPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}`)
				}))
			})
			It(`Invoke CreateIkePolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateIkePolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateIkePolicyOptions model
				createIkePolicyOptionsModel := new(vpcv1.CreateIkePolicyOptions)
				createIkePolicyOptionsModel.AuthenticationAlgorithm = core.StringPtr("sha256")
				createIkePolicyOptionsModel.DhGroup = core.Int64Ptr(int64(14))
				createIkePolicyOptionsModel.EncryptionAlgorithm = core.StringPtr("aes128")
				createIkePolicyOptionsModel.IkeVersion = core.Int64Ptr(int64(1))
				createIkePolicyOptionsModel.KeyLifetime = core.Int64Ptr(int64(28800))
				createIkePolicyOptionsModel.Name = core.StringPtr("my-ike-policy")
				createIkePolicyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateIkePolicy(createIkePolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateIkePolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateIkePolicyOptions model
				createIkePolicyOptionsModel := new(vpcv1.CreateIkePolicyOptions)
				createIkePolicyOptionsModel.AuthenticationAlgorithm = core.StringPtr("sha256")
				createIkePolicyOptionsModel.DhGroup = core.Int64Ptr(int64(14))
				createIkePolicyOptionsModel.EncryptionAlgorithm = core.StringPtr("aes128")
				createIkePolicyOptionsModel.IkeVersion = core.Int64Ptr(int64(1))
				createIkePolicyOptionsModel.KeyLifetime = core.Int64Ptr(int64(28800))
				createIkePolicyOptionsModel.Name = core.StringPtr("my-ike-policy")
				createIkePolicyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateIkePolicy(createIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateIkePolicyOptions model with no property values
				createIkePolicyOptionsModelNew := new(vpcv1.CreateIkePolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateIkePolicy(createIkePolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateIkePolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateIkePolicyOptions model
				createIkePolicyOptionsModel := new(vpcv1.CreateIkePolicyOptions)
				createIkePolicyOptionsModel.AuthenticationAlgorithm = core.StringPtr("sha256")
				createIkePolicyOptionsModel.DhGroup = core.Int64Ptr(int64(14))
				createIkePolicyOptionsModel.EncryptionAlgorithm = core.StringPtr("aes128")
				createIkePolicyOptionsModel.IkeVersion = core.Int64Ptr(int64(1))
				createIkePolicyOptionsModel.KeyLifetime = core.Int64Ptr(int64(28800))
				createIkePolicyOptionsModel.Name = core.StringPtr("my-ike-policy")
				createIkePolicyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateIkePolicy(createIkePolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteIkePolicy(deleteIkePolicyOptions *DeleteIkePolicyOptions)`, func() {
		version := "2024-06-23"
		deleteIkePolicyPath := "/ike_policies/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteIkePolicyPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteIkePolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteIkePolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteIkePolicyOptions model
				deleteIkePolicyOptionsModel := new(vpcv1.DeleteIkePolicyOptions)
				deleteIkePolicyOptionsModel.ID = core.StringPtr("testString")
				deleteIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteIkePolicy(deleteIkePolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteIkePolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteIkePolicyOptions model
				deleteIkePolicyOptionsModel := new(vpcv1.DeleteIkePolicyOptions)
				deleteIkePolicyOptionsModel.ID = core.StringPtr("testString")
				deleteIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteIkePolicy(deleteIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteIkePolicyOptions model with no property values
				deleteIkePolicyOptionsModelNew := new(vpcv1.DeleteIkePolicyOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteIkePolicy(deleteIkePolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetIkePolicy(getIkePolicyOptions *GetIkePolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getIkePolicyPath := "/ike_policies/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getIkePolicyPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetIkePolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetIkePolicyOptions model
				getIkePolicyOptionsModel := new(vpcv1.GetIkePolicyOptions)
				getIkePolicyOptionsModel.ID = core.StringPtr("testString")
				getIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetIkePolicy(getIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetIkePolicy(getIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetIkePolicy(getIkePolicyOptions *GetIkePolicyOptions)`, func() {
		version := "2024-06-23"
		getIkePolicyPath := "/ike_policies/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getIkePolicyPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}`)
				}))
			})
			It(`Invoke GetIkePolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetIkePolicyOptions model
				getIkePolicyOptionsModel := new(vpcv1.GetIkePolicyOptions)
				getIkePolicyOptionsModel.ID = core.StringPtr("testString")
				getIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetIkePolicyWithContext(ctx, getIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetIkePolicy(getIkePolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetIkePolicyWithContext(ctx, getIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getIkePolicyPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}`)
				}))
			})
			It(`Invoke GetIkePolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetIkePolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetIkePolicyOptions model
				getIkePolicyOptionsModel := new(vpcv1.GetIkePolicyOptions)
				getIkePolicyOptionsModel.ID = core.StringPtr("testString")
				getIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetIkePolicy(getIkePolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetIkePolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetIkePolicyOptions model
				getIkePolicyOptionsModel := new(vpcv1.GetIkePolicyOptions)
				getIkePolicyOptionsModel.ID = core.StringPtr("testString")
				getIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetIkePolicy(getIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetIkePolicyOptions model with no property values
				getIkePolicyOptionsModelNew := new(vpcv1.GetIkePolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetIkePolicy(getIkePolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetIkePolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetIkePolicyOptions model
				getIkePolicyOptionsModel := new(vpcv1.GetIkePolicyOptions)
				getIkePolicyOptionsModel.ID = core.StringPtr("testString")
				getIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetIkePolicy(getIkePolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateIkePolicy(updateIkePolicyOptions *UpdateIkePolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateIkePolicyPath := "/ike_policies/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateIkePolicyPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateIkePolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the IkePolicyPatch model
				ikePolicyPatchModel := new(vpcv1.IkePolicyPatch)
				ikePolicyPatchModel.AuthenticationAlgorithm = core.StringPtr("sha256")
				ikePolicyPatchModel.DhGroup = core.Int64Ptr(int64(14))
				ikePolicyPatchModel.EncryptionAlgorithm = core.StringPtr("aes128")
				ikePolicyPatchModel.IkeVersion = core.Int64Ptr(int64(1))
				ikePolicyPatchModel.KeyLifetime = core.Int64Ptr(int64(86400))
				ikePolicyPatchModel.Name = core.StringPtr("my-ike-policy")
				ikePolicyPatchModelAsPatch, asPatchErr := ikePolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateIkePolicyOptions model
				updateIkePolicyOptionsModel := new(vpcv1.UpdateIkePolicyOptions)
				updateIkePolicyOptionsModel.ID = core.StringPtr("testString")
				updateIkePolicyOptionsModel.IkePolicyPatch = ikePolicyPatchModelAsPatch
				updateIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateIkePolicy(updateIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateIkePolicy(updateIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateIkePolicy(updateIkePolicyOptions *UpdateIkePolicyOptions)`, func() {
		version := "2024-06-23"
		updateIkePolicyPath := "/ike_policies/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateIkePolicyPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}`)
				}))
			})
			It(`Invoke UpdateIkePolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the IkePolicyPatch model
				ikePolicyPatchModel := new(vpcv1.IkePolicyPatch)
				ikePolicyPatchModel.AuthenticationAlgorithm = core.StringPtr("sha256")
				ikePolicyPatchModel.DhGroup = core.Int64Ptr(int64(14))
				ikePolicyPatchModel.EncryptionAlgorithm = core.StringPtr("aes128")
				ikePolicyPatchModel.IkeVersion = core.Int64Ptr(int64(1))
				ikePolicyPatchModel.KeyLifetime = core.Int64Ptr(int64(86400))
				ikePolicyPatchModel.Name = core.StringPtr("my-ike-policy")
				ikePolicyPatchModelAsPatch, asPatchErr := ikePolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateIkePolicyOptions model
				updateIkePolicyOptionsModel := new(vpcv1.UpdateIkePolicyOptions)
				updateIkePolicyOptionsModel.ID = core.StringPtr("testString")
				updateIkePolicyOptionsModel.IkePolicyPatch = ikePolicyPatchModelAsPatch
				updateIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateIkePolicyWithContext(ctx, updateIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateIkePolicy(updateIkePolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateIkePolicyWithContext(ctx, updateIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateIkePolicyPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}`)
				}))
			})
			It(`Invoke UpdateIkePolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateIkePolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the IkePolicyPatch model
				ikePolicyPatchModel := new(vpcv1.IkePolicyPatch)
				ikePolicyPatchModel.AuthenticationAlgorithm = core.StringPtr("sha256")
				ikePolicyPatchModel.DhGroup = core.Int64Ptr(int64(14))
				ikePolicyPatchModel.EncryptionAlgorithm = core.StringPtr("aes128")
				ikePolicyPatchModel.IkeVersion = core.Int64Ptr(int64(1))
				ikePolicyPatchModel.KeyLifetime = core.Int64Ptr(int64(86400))
				ikePolicyPatchModel.Name = core.StringPtr("my-ike-policy")
				ikePolicyPatchModelAsPatch, asPatchErr := ikePolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateIkePolicyOptions model
				updateIkePolicyOptionsModel := new(vpcv1.UpdateIkePolicyOptions)
				updateIkePolicyOptionsModel.ID = core.StringPtr("testString")
				updateIkePolicyOptionsModel.IkePolicyPatch = ikePolicyPatchModelAsPatch
				updateIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateIkePolicy(updateIkePolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateIkePolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the IkePolicyPatch model
				ikePolicyPatchModel := new(vpcv1.IkePolicyPatch)
				ikePolicyPatchModel.AuthenticationAlgorithm = core.StringPtr("sha256")
				ikePolicyPatchModel.DhGroup = core.Int64Ptr(int64(14))
				ikePolicyPatchModel.EncryptionAlgorithm = core.StringPtr("aes128")
				ikePolicyPatchModel.IkeVersion = core.Int64Ptr(int64(1))
				ikePolicyPatchModel.KeyLifetime = core.Int64Ptr(int64(86400))
				ikePolicyPatchModel.Name = core.StringPtr("my-ike-policy")
				ikePolicyPatchModelAsPatch, asPatchErr := ikePolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateIkePolicyOptions model
				updateIkePolicyOptionsModel := new(vpcv1.UpdateIkePolicyOptions)
				updateIkePolicyOptionsModel.ID = core.StringPtr("testString")
				updateIkePolicyOptionsModel.IkePolicyPatch = ikePolicyPatchModelAsPatch
				updateIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateIkePolicy(updateIkePolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateIkePolicyOptions model with no property values
				updateIkePolicyOptionsModelNew := new(vpcv1.UpdateIkePolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateIkePolicy(updateIkePolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateIkePolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the IkePolicyPatch model
				ikePolicyPatchModel := new(vpcv1.IkePolicyPatch)
				ikePolicyPatchModel.AuthenticationAlgorithm = core.StringPtr("sha256")
				ikePolicyPatchModel.DhGroup = core.Int64Ptr(int64(14))
				ikePolicyPatchModel.EncryptionAlgorithm = core.StringPtr("aes128")
				ikePolicyPatchModel.IkeVersion = core.Int64Ptr(int64(1))
				ikePolicyPatchModel.KeyLifetime = core.Int64Ptr(int64(86400))
				ikePolicyPatchModel.Name = core.StringPtr("my-ike-policy")
				ikePolicyPatchModelAsPatch, asPatchErr := ikePolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateIkePolicyOptions model
				updateIkePolicyOptionsModel := new(vpcv1.UpdateIkePolicyOptions)
				updateIkePolicyOptionsModel.ID = core.StringPtr("testString")
				updateIkePolicyOptionsModel.IkePolicyPatch = ikePolicyPatchModelAsPatch
				updateIkePolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateIkePolicy(updateIkePolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListIkePolicyConnections(listIkePolicyConnectionsOptions *ListIkePolicyConnectionsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listIkePolicyConnectionsPath := "/ike_policies/testString/connections"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIkePolicyConnectionsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListIkePolicyConnections with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListIkePolicyConnectionsOptions model
				listIkePolicyConnectionsOptionsModel := new(vpcv1.ListIkePolicyConnectionsOptions)
				listIkePolicyConnectionsOptionsModel.ID = core.StringPtr("testString")
				listIkePolicyConnectionsOptionsModel.Start = core.StringPtr("testString")
				listIkePolicyConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIkePolicyConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListIkePolicyConnections(listIkePolicyConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListIkePolicyConnections(listIkePolicyConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListIkePolicyConnections(listIkePolicyConnectionsOptions *ListIkePolicyConnectionsOptions)`, func() {
		version := "2024-06-23"
		listIkePolicyConnectionsPath := "/ike_policies/testString/connections"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIkePolicyConnectionsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-gateway-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": false, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "192.0.2.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListIkePolicyConnections successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListIkePolicyConnectionsOptions model
				listIkePolicyConnectionsOptionsModel := new(vpcv1.ListIkePolicyConnectionsOptions)
				listIkePolicyConnectionsOptionsModel.ID = core.StringPtr("testString")
				listIkePolicyConnectionsOptionsModel.Start = core.StringPtr("testString")
				listIkePolicyConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIkePolicyConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListIkePolicyConnectionsWithContext(ctx, listIkePolicyConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListIkePolicyConnections(listIkePolicyConnectionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListIkePolicyConnectionsWithContext(ctx, listIkePolicyConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIkePolicyConnectionsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-gateway-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": false, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "192.0.2.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListIkePolicyConnections successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListIkePolicyConnections(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListIkePolicyConnectionsOptions model
				listIkePolicyConnectionsOptionsModel := new(vpcv1.ListIkePolicyConnectionsOptions)
				listIkePolicyConnectionsOptionsModel.ID = core.StringPtr("testString")
				listIkePolicyConnectionsOptionsModel.Start = core.StringPtr("testString")
				listIkePolicyConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIkePolicyConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListIkePolicyConnections(listIkePolicyConnectionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListIkePolicyConnections with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListIkePolicyConnectionsOptions model
				listIkePolicyConnectionsOptionsModel := new(vpcv1.ListIkePolicyConnectionsOptions)
				listIkePolicyConnectionsOptionsModel.ID = core.StringPtr("testString")
				listIkePolicyConnectionsOptionsModel.Start = core.StringPtr("testString")
				listIkePolicyConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIkePolicyConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListIkePolicyConnections(listIkePolicyConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListIkePolicyConnectionsOptions model with no property values
				listIkePolicyConnectionsOptionsModelNew := new(vpcv1.ListIkePolicyConnectionsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListIkePolicyConnections(listIkePolicyConnectionsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListIkePolicyConnections successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListIkePolicyConnectionsOptions model
				listIkePolicyConnectionsOptionsModel := new(vpcv1.ListIkePolicyConnectionsOptions)
				listIkePolicyConnectionsOptionsModel.ID = core.StringPtr("testString")
				listIkePolicyConnectionsOptionsModel.Start = core.StringPtr("testString")
				listIkePolicyConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIkePolicyConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListIkePolicyConnections(listIkePolicyConnectionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.IkePolicyConnectionCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.IkePolicyConnectionCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.IkePolicyConnectionCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIkePolicyConnectionsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","id":"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","id":"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876","id":"r006-51eae621-dbbc-4c47-b623-b57a43c19876","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-gateway-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":false,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"192.0.2.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","id":"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","id":"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876","id":"r006-51eae621-dbbc-4c47-b623-b57a43c19876","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-gateway-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":false,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"192.0.2.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use IkePolicyConnectionsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listIkePolicyConnectionsOptionsModel := &vpcv1.ListIkePolicyConnectionsOptions{
					ID:    core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewIkePolicyConnectionsPager(listIkePolicyConnectionsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.VPNGatewayConnectionIntf
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use IkePolicyConnectionsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listIkePolicyConnectionsOptionsModel := &vpcv1.ListIkePolicyConnectionsOptions{
					ID:    core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewIkePolicyConnectionsPager(listIkePolicyConnectionsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`ListIpsecPolicies(listIpsecPoliciesOptions *ListIpsecPoliciesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listIpsecPoliciesPath := "/ipsec_policies"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIpsecPoliciesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListIpsecPolicies with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListIpsecPoliciesOptions model
				listIpsecPoliciesOptionsModel := new(vpcv1.ListIpsecPoliciesOptions)
				listIpsecPoliciesOptionsModel.Start = core.StringPtr("testString")
				listIpsecPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIpsecPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListIpsecPolicies(listIpsecPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListIpsecPolicies(listIpsecPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListIpsecPolicies(listIpsecPoliciesOptions *ListIpsecPoliciesOptions)`, func() {
		version := "2024-06-23"
		listIpsecPoliciesPath := "/ipsec_policies"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIpsecPoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "ipsec_policies": [{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListIpsecPolicies successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListIpsecPoliciesOptions model
				listIpsecPoliciesOptionsModel := new(vpcv1.ListIpsecPoliciesOptions)
				listIpsecPoliciesOptionsModel.Start = core.StringPtr("testString")
				listIpsecPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIpsecPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListIpsecPoliciesWithContext(ctx, listIpsecPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListIpsecPolicies(listIpsecPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListIpsecPoliciesWithContext(ctx, listIpsecPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIpsecPoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "ipsec_policies": [{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListIpsecPolicies successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListIpsecPolicies(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListIpsecPoliciesOptions model
				listIpsecPoliciesOptionsModel := new(vpcv1.ListIpsecPoliciesOptions)
				listIpsecPoliciesOptionsModel.Start = core.StringPtr("testString")
				listIpsecPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIpsecPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListIpsecPolicies(listIpsecPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListIpsecPolicies with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListIpsecPoliciesOptions model
				listIpsecPoliciesOptionsModel := new(vpcv1.ListIpsecPoliciesOptions)
				listIpsecPoliciesOptionsModel.Start = core.StringPtr("testString")
				listIpsecPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIpsecPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListIpsecPolicies(listIpsecPoliciesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListIpsecPolicies successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListIpsecPoliciesOptions model
				listIpsecPoliciesOptionsModel := new(vpcv1.ListIpsecPoliciesOptions)
				listIpsecPoliciesOptionsModel.Start = core.StringPtr("testString")
				listIpsecPoliciesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIpsecPoliciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListIpsecPolicies(listIpsecPoliciesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.IPsecPolicyCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.IPsecPolicyCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.IPsecPolicyCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIpsecPoliciesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","id":"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","name":"my-vpn-gateway-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876","id":"r006-51eae621-dbbc-4c47-b623-b57a43c19876","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","id":"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","name":"my-vpn-gateway-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876","id":"r006-51eae621-dbbc-4c47-b623-b57a43c19876","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use IpsecPoliciesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listIpsecPoliciesOptionsModel := &vpcv1.ListIpsecPoliciesOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewIpsecPoliciesPager(listIpsecPoliciesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.IPsecPolicy
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use IpsecPoliciesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listIpsecPoliciesOptionsModel := &vpcv1.ListIpsecPoliciesOptions{
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewIpsecPoliciesPager(listIpsecPoliciesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateIpsecPolicy(createIpsecPolicyOptions *CreateIpsecPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createIpsecPolicyPath := "/ipsec_policies"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createIpsecPolicyPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateIpsecPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateIpsecPolicyOptions model
				createIpsecPolicyOptionsModel := new(vpcv1.CreateIpsecPolicyOptions)
				createIpsecPolicyOptionsModel.AuthenticationAlgorithm = core.StringPtr("disabled")
				createIpsecPolicyOptionsModel.EncryptionAlgorithm = core.StringPtr("aes128")
				createIpsecPolicyOptionsModel.Pfs = core.StringPtr("disabled")
				createIpsecPolicyOptionsModel.KeyLifetime = core.Int64Ptr(int64(3600))
				createIpsecPolicyOptionsModel.Name = core.StringPtr("my-ipsec-policy")
				createIpsecPolicyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateIpsecPolicy(createIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateIpsecPolicy(createIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateIpsecPolicy(createIpsecPolicyOptions *CreateIpsecPolicyOptions)`, func() {
		version := "2024-06-23"
		createIpsecPolicyPath := "/ipsec_policies"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createIpsecPolicyPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}`)
				}))
			})
			It(`Invoke CreateIpsecPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateIpsecPolicyOptions model
				createIpsecPolicyOptionsModel := new(vpcv1.CreateIpsecPolicyOptions)
				createIpsecPolicyOptionsModel.AuthenticationAlgorithm = core.StringPtr("disabled")
				createIpsecPolicyOptionsModel.EncryptionAlgorithm = core.StringPtr("aes128")
				createIpsecPolicyOptionsModel.Pfs = core.StringPtr("disabled")
				createIpsecPolicyOptionsModel.KeyLifetime = core.Int64Ptr(int64(3600))
				createIpsecPolicyOptionsModel.Name = core.StringPtr("my-ipsec-policy")
				createIpsecPolicyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateIpsecPolicyWithContext(ctx, createIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateIpsecPolicy(createIpsecPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateIpsecPolicyWithContext(ctx, createIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createIpsecPolicyPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}`)
				}))
			})
			It(`Invoke CreateIpsecPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateIpsecPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateIpsecPolicyOptions model
				createIpsecPolicyOptionsModel := new(vpcv1.CreateIpsecPolicyOptions)
				createIpsecPolicyOptionsModel.AuthenticationAlgorithm = core.StringPtr("disabled")
				createIpsecPolicyOptionsModel.EncryptionAlgorithm = core.StringPtr("aes128")
				createIpsecPolicyOptionsModel.Pfs = core.StringPtr("disabled")
				createIpsecPolicyOptionsModel.KeyLifetime = core.Int64Ptr(int64(3600))
				createIpsecPolicyOptionsModel.Name = core.StringPtr("my-ipsec-policy")
				createIpsecPolicyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateIpsecPolicy(createIpsecPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateIpsecPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateIpsecPolicyOptions model
				createIpsecPolicyOptionsModel := new(vpcv1.CreateIpsecPolicyOptions)
				createIpsecPolicyOptionsModel.AuthenticationAlgorithm = core.StringPtr("disabled")
				createIpsecPolicyOptionsModel.EncryptionAlgorithm = core.StringPtr("aes128")
				createIpsecPolicyOptionsModel.Pfs = core.StringPtr("disabled")
				createIpsecPolicyOptionsModel.KeyLifetime = core.Int64Ptr(int64(3600))
				createIpsecPolicyOptionsModel.Name = core.StringPtr("my-ipsec-policy")
				createIpsecPolicyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateIpsecPolicy(createIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateIpsecPolicyOptions model with no property values
				createIpsecPolicyOptionsModelNew := new(vpcv1.CreateIpsecPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateIpsecPolicy(createIpsecPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateIpsecPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the CreateIpsecPolicyOptions model
				createIpsecPolicyOptionsModel := new(vpcv1.CreateIpsecPolicyOptions)
				createIpsecPolicyOptionsModel.AuthenticationAlgorithm = core.StringPtr("disabled")
				createIpsecPolicyOptionsModel.EncryptionAlgorithm = core.StringPtr("aes128")
				createIpsecPolicyOptionsModel.Pfs = core.StringPtr("disabled")
				createIpsecPolicyOptionsModel.KeyLifetime = core.Int64Ptr(int64(3600))
				createIpsecPolicyOptionsModel.Name = core.StringPtr("my-ipsec-policy")
				createIpsecPolicyOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateIpsecPolicy(createIpsecPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteIpsecPolicy(deleteIpsecPolicyOptions *DeleteIpsecPolicyOptions)`, func() {
		version := "2024-06-23"
		deleteIpsecPolicyPath := "/ipsec_policies/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteIpsecPolicyPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke DeleteIpsecPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteIpsecPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteIpsecPolicyOptions model
				deleteIpsecPolicyOptionsModel := new(vpcv1.DeleteIpsecPolicyOptions)
				deleteIpsecPolicyOptionsModel.ID = core.StringPtr("testString")
				deleteIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteIpsecPolicy(deleteIpsecPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteIpsecPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteIpsecPolicyOptions model
				deleteIpsecPolicyOptionsModel := new(vpcv1.DeleteIpsecPolicyOptions)
				deleteIpsecPolicyOptionsModel.ID = core.StringPtr("testString")
				deleteIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteIpsecPolicy(deleteIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteIpsecPolicyOptions model with no property values
				deleteIpsecPolicyOptionsModelNew := new(vpcv1.DeleteIpsecPolicyOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteIpsecPolicy(deleteIpsecPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetIpsecPolicy(getIpsecPolicyOptions *GetIpsecPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getIpsecPolicyPath := "/ipsec_policies/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getIpsecPolicyPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetIpsecPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetIpsecPolicyOptions model
				getIpsecPolicyOptionsModel := new(vpcv1.GetIpsecPolicyOptions)
				getIpsecPolicyOptionsModel.ID = core.StringPtr("testString")
				getIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetIpsecPolicy(getIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetIpsecPolicy(getIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetIpsecPolicy(getIpsecPolicyOptions *GetIpsecPolicyOptions)`, func() {
		version := "2024-06-23"
		getIpsecPolicyPath := "/ipsec_policies/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getIpsecPolicyPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}`)
				}))
			})
			It(`Invoke GetIpsecPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetIpsecPolicyOptions model
				getIpsecPolicyOptionsModel := new(vpcv1.GetIpsecPolicyOptions)
				getIpsecPolicyOptionsModel.ID = core.StringPtr("testString")
				getIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetIpsecPolicyWithContext(ctx, getIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetIpsecPolicy(getIpsecPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetIpsecPolicyWithContext(ctx, getIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getIpsecPolicyPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}`)
				}))
			})
			It(`Invoke GetIpsecPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetIpsecPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetIpsecPolicyOptions model
				getIpsecPolicyOptionsModel := new(vpcv1.GetIpsecPolicyOptions)
				getIpsecPolicyOptionsModel.ID = core.StringPtr("testString")
				getIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetIpsecPolicy(getIpsecPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetIpsecPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetIpsecPolicyOptions model
				getIpsecPolicyOptionsModel := new(vpcv1.GetIpsecPolicyOptions)
				getIpsecPolicyOptionsModel.ID = core.StringPtr("testString")
				getIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetIpsecPolicy(getIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetIpsecPolicyOptions model with no property values
				getIpsecPolicyOptionsModelNew := new(vpcv1.GetIpsecPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetIpsecPolicy(getIpsecPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetIpsecPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetIpsecPolicyOptions model
				getIpsecPolicyOptionsModel := new(vpcv1.GetIpsecPolicyOptions)
				getIpsecPolicyOptionsModel.ID = core.StringPtr("testString")
				getIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetIpsecPolicy(getIpsecPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateIpsecPolicy(updateIpsecPolicyOptions *UpdateIpsecPolicyOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateIpsecPolicyPath := "/ipsec_policies/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateIpsecPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateIpsecPolicy with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the IPsecPolicyPatch model
				iPsecPolicyPatchModel := new(vpcv1.IPsecPolicyPatch)
				iPsecPolicyPatchModel.AuthenticationAlgorithm = core.StringPtr("disabled")
				iPsecPolicyPatchModel.EncryptionAlgorithm = core.StringPtr("aes128")
				iPsecPolicyPatchModel.KeyLifetime = core.Int64Ptr(int64(3600))
				iPsecPolicyPatchModel.Name = core.StringPtr("my-ipsec-policy")
				iPsecPolicyPatchModel.Pfs = core.StringPtr("disabled")
				iPsecPolicyPatchModelAsPatch, asPatchErr := iPsecPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateIpsecPolicyOptions model
				updateIpsecPolicyOptionsModel := new(vpcv1.UpdateIpsecPolicyOptions)
				updateIpsecPolicyOptionsModel.ID = core.StringPtr("testString")
				updateIpsecPolicyOptionsModel.IPsecPolicyPatch = iPsecPolicyPatchModelAsPatch
				updateIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateIpsecPolicy(updateIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateIpsecPolicy(updateIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateIpsecPolicy(updateIpsecPolicyOptions *UpdateIpsecPolicyOptions)`, func() {
		version := "2024-06-23"
		updateIpsecPolicyPath := "/ipsec_policies/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateIpsecPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}`)
				}))
			})
			It(`Invoke UpdateIpsecPolicy successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the IPsecPolicyPatch model
				iPsecPolicyPatchModel := new(vpcv1.IPsecPolicyPatch)
				iPsecPolicyPatchModel.AuthenticationAlgorithm = core.StringPtr("disabled")
				iPsecPolicyPatchModel.EncryptionAlgorithm = core.StringPtr("aes128")
				iPsecPolicyPatchModel.KeyLifetime = core.Int64Ptr(int64(3600))
				iPsecPolicyPatchModel.Name = core.StringPtr("my-ipsec-policy")
				iPsecPolicyPatchModel.Pfs = core.StringPtr("disabled")
				iPsecPolicyPatchModelAsPatch, asPatchErr := iPsecPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateIpsecPolicyOptions model
				updateIpsecPolicyOptionsModel := new(vpcv1.UpdateIpsecPolicyOptions)
				updateIpsecPolicyOptionsModel.ID = core.StringPtr("testString")
				updateIpsecPolicyOptionsModel.IPsecPolicyPatch = iPsecPolicyPatchModelAsPatch
				updateIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateIpsecPolicyWithContext(ctx, updateIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateIpsecPolicy(updateIpsecPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateIpsecPolicyWithContext(ctx, updateIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateIpsecPolicyPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}`)
				}))
			})
			It(`Invoke UpdateIpsecPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateIpsecPolicy(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the IPsecPolicyPatch model
				iPsecPolicyPatchModel := new(vpcv1.IPsecPolicyPatch)
				iPsecPolicyPatchModel.AuthenticationAlgorithm = core.StringPtr("disabled")
				iPsecPolicyPatchModel.EncryptionAlgorithm = core.StringPtr("aes128")
				iPsecPolicyPatchModel.KeyLifetime = core.Int64Ptr(int64(3600))
				iPsecPolicyPatchModel.Name = core.StringPtr("my-ipsec-policy")
				iPsecPolicyPatchModel.Pfs = core.StringPtr("disabled")
				iPsecPolicyPatchModelAsPatch, asPatchErr := iPsecPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateIpsecPolicyOptions model
				updateIpsecPolicyOptionsModel := new(vpcv1.UpdateIpsecPolicyOptions)
				updateIpsecPolicyOptionsModel.ID = core.StringPtr("testString")
				updateIpsecPolicyOptionsModel.IPsecPolicyPatch = iPsecPolicyPatchModelAsPatch
				updateIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateIpsecPolicy(updateIpsecPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateIpsecPolicy with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the IPsecPolicyPatch model
				iPsecPolicyPatchModel := new(vpcv1.IPsecPolicyPatch)
				iPsecPolicyPatchModel.AuthenticationAlgorithm = core.StringPtr("disabled")
				iPsecPolicyPatchModel.EncryptionAlgorithm = core.StringPtr("aes128")
				iPsecPolicyPatchModel.KeyLifetime = core.Int64Ptr(int64(3600))
				iPsecPolicyPatchModel.Name = core.StringPtr("my-ipsec-policy")
				iPsecPolicyPatchModel.Pfs = core.StringPtr("disabled")
				iPsecPolicyPatchModelAsPatch, asPatchErr := iPsecPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateIpsecPolicyOptions model
				updateIpsecPolicyOptionsModel := new(vpcv1.UpdateIpsecPolicyOptions)
				updateIpsecPolicyOptionsModel.ID = core.StringPtr("testString")
				updateIpsecPolicyOptionsModel.IPsecPolicyPatch = iPsecPolicyPatchModelAsPatch
				updateIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateIpsecPolicy(updateIpsecPolicyOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateIpsecPolicyOptions model with no property values
				updateIpsecPolicyOptionsModelNew := new(vpcv1.UpdateIpsecPolicyOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateIpsecPolicy(updateIpsecPolicyOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateIpsecPolicy successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the IPsecPolicyPatch model
				iPsecPolicyPatchModel := new(vpcv1.IPsecPolicyPatch)
				iPsecPolicyPatchModel.AuthenticationAlgorithm = core.StringPtr("disabled")
				iPsecPolicyPatchModel.EncryptionAlgorithm = core.StringPtr("aes128")
				iPsecPolicyPatchModel.KeyLifetime = core.Int64Ptr(int64(3600))
				iPsecPolicyPatchModel.Name = core.StringPtr("my-ipsec-policy")
				iPsecPolicyPatchModel.Pfs = core.StringPtr("disabled")
				iPsecPolicyPatchModelAsPatch, asPatchErr := iPsecPolicyPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateIpsecPolicyOptions model
				updateIpsecPolicyOptionsModel := new(vpcv1.UpdateIpsecPolicyOptions)
				updateIpsecPolicyOptionsModel.ID = core.StringPtr("testString")
				updateIpsecPolicyOptionsModel.IPsecPolicyPatch = iPsecPolicyPatchModelAsPatch
				updateIpsecPolicyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateIpsecPolicy(updateIpsecPolicyOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListIpsecPolicyConnections(listIpsecPolicyConnectionsOptions *ListIpsecPolicyConnectionsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listIpsecPolicyConnectionsPath := "/ipsec_policies/testString/connections"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIpsecPolicyConnectionsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListIpsecPolicyConnections with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListIpsecPolicyConnectionsOptions model
				listIpsecPolicyConnectionsOptionsModel := new(vpcv1.ListIpsecPolicyConnectionsOptions)
				listIpsecPolicyConnectionsOptionsModel.ID = core.StringPtr("testString")
				listIpsecPolicyConnectionsOptionsModel.Start = core.StringPtr("testString")
				listIpsecPolicyConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIpsecPolicyConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListIpsecPolicyConnections(listIpsecPolicyConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListIpsecPolicyConnections(listIpsecPolicyConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListIpsecPolicyConnections(listIpsecPolicyConnectionsOptions *ListIpsecPolicyConnectionsOptions)`, func() {
		version := "2024-06-23"
		listIpsecPolicyConnectionsPath := "/ipsec_policies/testString/connections"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIpsecPolicyConnectionsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-gateway-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": false, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "192.0.2.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListIpsecPolicyConnections successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListIpsecPolicyConnectionsOptions model
				listIpsecPolicyConnectionsOptionsModel := new(vpcv1.ListIpsecPolicyConnectionsOptions)
				listIpsecPolicyConnectionsOptionsModel.ID = core.StringPtr("testString")
				listIpsecPolicyConnectionsOptionsModel.Start = core.StringPtr("testString")
				listIpsecPolicyConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIpsecPolicyConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListIpsecPolicyConnectionsWithContext(ctx, listIpsecPolicyConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListIpsecPolicyConnections(listIpsecPolicyConnectionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListIpsecPolicyConnectionsWithContext(ctx, listIpsecPolicyConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIpsecPolicyConnectionsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-gateway-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": false, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "192.0.2.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListIpsecPolicyConnections successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListIpsecPolicyConnections(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListIpsecPolicyConnectionsOptions model
				listIpsecPolicyConnectionsOptionsModel := new(vpcv1.ListIpsecPolicyConnectionsOptions)
				listIpsecPolicyConnectionsOptionsModel.ID = core.StringPtr("testString")
				listIpsecPolicyConnectionsOptionsModel.Start = core.StringPtr("testString")
				listIpsecPolicyConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIpsecPolicyConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListIpsecPolicyConnections(listIpsecPolicyConnectionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListIpsecPolicyConnections with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListIpsecPolicyConnectionsOptions model
				listIpsecPolicyConnectionsOptionsModel := new(vpcv1.ListIpsecPolicyConnectionsOptions)
				listIpsecPolicyConnectionsOptionsModel.ID = core.StringPtr("testString")
				listIpsecPolicyConnectionsOptionsModel.Start = core.StringPtr("testString")
				listIpsecPolicyConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIpsecPolicyConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListIpsecPolicyConnections(listIpsecPolicyConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListIpsecPolicyConnectionsOptions model with no property values
				listIpsecPolicyConnectionsOptionsModelNew := new(vpcv1.ListIpsecPolicyConnectionsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListIpsecPolicyConnections(listIpsecPolicyConnectionsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListIpsecPolicyConnections successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListIpsecPolicyConnectionsOptions model
				listIpsecPolicyConnectionsOptionsModel := new(vpcv1.ListIpsecPolicyConnectionsOptions)
				listIpsecPolicyConnectionsOptionsModel.ID = core.StringPtr("testString")
				listIpsecPolicyConnectionsOptionsModel.Start = core.StringPtr("testString")
				listIpsecPolicyConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listIpsecPolicyConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListIpsecPolicyConnections(listIpsecPolicyConnectionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.IPsecPolicyConnectionCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.IPsecPolicyConnectionCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.IPsecPolicyConnectionCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listIpsecPolicyConnectionsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","id":"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","id":"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876","id":"r006-51eae621-dbbc-4c47-b623-b57a43c19876","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-gateway-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":false,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"192.0.2.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","id":"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","id":"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876","id":"r006-51eae621-dbbc-4c47-b623-b57a43c19876","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-gateway-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":false,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"192.0.2.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use IpsecPolicyConnectionsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listIpsecPolicyConnectionsOptionsModel := &vpcv1.ListIpsecPolicyConnectionsOptions{
					ID:    core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewIpsecPolicyConnectionsPager(listIpsecPolicyConnectionsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.VPNGatewayConnectionIntf
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use IpsecPolicyConnectionsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listIpsecPolicyConnectionsOptionsModel := &vpcv1.ListIpsecPolicyConnectionsOptions{
					ID:    core.StringPtr("testString"),
					Limit: core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewIpsecPolicyConnectionsPager(listIpsecPolicyConnectionsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`ListVPNGateways(listVPNGatewaysOptions *ListVPNGatewaysOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVPNGatewaysPath := "/vpn_gateways"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewaysPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["mode"]).To(Equal([]string{"policy"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVPNGateways with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewaysOptions model
				listVPNGatewaysOptionsModel := new(vpcv1.ListVPNGatewaysOptions)
				listVPNGatewaysOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVPNGatewaysOptionsModel.Sort = core.StringPtr("name")
				listVPNGatewaysOptionsModel.Mode = core.StringPtr("policy")
				listVPNGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVPNGateways(listVPNGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVPNGateways(listVPNGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNGateways(listVPNGatewaysOptions *ListVPNGatewaysOptions)`, func() {
		version := "2024-06-23"
		listVPNGatewaysPath := "/vpn_gateways"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewaysPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["mode"]).To(Equal([]string{"policy"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "policy"}]}`)
				}))
			})
			It(`Invoke ListVPNGateways successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVPNGatewaysOptions model
				listVPNGatewaysOptionsModel := new(vpcv1.ListVPNGatewaysOptions)
				listVPNGatewaysOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVPNGatewaysOptionsModel.Sort = core.StringPtr("name")
				listVPNGatewaysOptionsModel.Mode = core.StringPtr("policy")
				listVPNGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVPNGatewaysWithContext(ctx, listVPNGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVPNGateways(listVPNGatewaysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVPNGatewaysWithContext(ctx, listVPNGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewaysPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					Expect(req.URL.Query()["mode"]).To(Equal([]string{"policy"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "policy"}]}`)
				}))
			})
			It(`Invoke ListVPNGateways successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVPNGateways(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVPNGatewaysOptions model
				listVPNGatewaysOptionsModel := new(vpcv1.ListVPNGatewaysOptions)
				listVPNGatewaysOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVPNGatewaysOptionsModel.Sort = core.StringPtr("name")
				listVPNGatewaysOptionsModel.Mode = core.StringPtr("policy")
				listVPNGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVPNGateways(listVPNGatewaysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVPNGateways with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewaysOptions model
				listVPNGatewaysOptionsModel := new(vpcv1.ListVPNGatewaysOptions)
				listVPNGatewaysOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVPNGatewaysOptionsModel.Sort = core.StringPtr("name")
				listVPNGatewaysOptionsModel.Mode = core.StringPtr("policy")
				listVPNGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVPNGateways(listVPNGatewaysOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVPNGateways successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewaysOptions model
				listVPNGatewaysOptionsModel := new(vpcv1.ListVPNGatewaysOptions)
				listVPNGatewaysOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewaysOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewaysOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVPNGatewaysOptionsModel.Sort = core.StringPtr("name")
				listVPNGatewaysOptionsModel.Mode = core.StringPtr("policy")
				listVPNGatewaysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVPNGateways(listVPNGatewaysOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.VPNGatewayCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.VPNGatewayCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.VPNGatewayCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewaysPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","id":"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","name":"my-vpn-gateway-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN's subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN's subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"name":"my-vpn-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_gateway","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"policy"}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","id":"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","name":"my-vpn-gateway-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN's subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN's subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"name":"my-vpn-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_gateway","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"policy"}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VPNGatewaysPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPNGatewaysOptionsModel := &vpcv1.ListVPNGatewaysOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					Sort:            core.StringPtr("name"),
					Mode:            core.StringPtr("policy"),
				}

				pager, err := vpcService.NewVPNGatewaysPager(listVPNGatewaysOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.VPNGatewayIntf
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VPNGatewaysPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPNGatewaysOptionsModel := &vpcv1.ListVPNGatewaysOptions{
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					Sort:            core.StringPtr("name"),
					Mode:            core.StringPtr("policy"),
				}

				pager, err := vpcService.NewVPNGatewaysPager(listVPNGatewaysOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateVPNGateway(createVPNGatewayOptions *CreateVPNGatewayOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createVPNGatewayPath := "/vpn_gateways"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPNGatewayPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateVPNGateway with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the VPNGatewayPrototypeVPNGatewayRouteModePrototype model
				vpnGatewayPrototypeModel := new(vpcv1.VPNGatewayPrototypeVPNGatewayRouteModePrototype)
				vpnGatewayPrototypeModel.Name = core.StringPtr("my-vpn-gateway")
				vpnGatewayPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				vpnGatewayPrototypeModel.Subnet = subnetIdentityModel
				vpnGatewayPrototypeModel.AdvertisedCIDRs = []string{"192.168.3.0/24"}
				vpnGatewayPrototypeModel.LocalAsn = core.Int64Ptr(int64(64520))
				vpnGatewayPrototypeModel.Mode = core.StringPtr("route")

				// Construct an instance of the CreateVPNGatewayOptions model
				createVPNGatewayOptionsModel := new(vpcv1.CreateVPNGatewayOptions)
				createVPNGatewayOptionsModel.VPNGatewayPrototype = vpnGatewayPrototypeModel
				createVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateVPNGateway(createVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateVPNGateway(createVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateVPNGateway(createVPNGatewayOptions *CreateVPNGatewayOptions)`, func() {
		version := "2024-06-23"
		createVPNGatewayPath := "/vpn_gateways"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPNGatewayPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "policy"}`)
				}))
			})
			It(`Invoke CreateVPNGateway successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the VPNGatewayPrototypeVPNGatewayRouteModePrototype model
				vpnGatewayPrototypeModel := new(vpcv1.VPNGatewayPrototypeVPNGatewayRouteModePrototype)
				vpnGatewayPrototypeModel.Name = core.StringPtr("my-vpn-gateway")
				vpnGatewayPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				vpnGatewayPrototypeModel.Subnet = subnetIdentityModel
				vpnGatewayPrototypeModel.AdvertisedCIDRs = []string{"192.168.3.0/24"}
				vpnGatewayPrototypeModel.LocalAsn = core.Int64Ptr(int64(64520))
				vpnGatewayPrototypeModel.Mode = core.StringPtr("route")

				// Construct an instance of the CreateVPNGatewayOptions model
				createVPNGatewayOptionsModel := new(vpcv1.CreateVPNGatewayOptions)
				createVPNGatewayOptionsModel.VPNGatewayPrototype = vpnGatewayPrototypeModel
				createVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateVPNGatewayWithContext(ctx, createVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateVPNGateway(createVPNGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateVPNGatewayWithContext(ctx, createVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPNGatewayPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "policy"}`)
				}))
			})
			It(`Invoke CreateVPNGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateVPNGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the VPNGatewayPrototypeVPNGatewayRouteModePrototype model
				vpnGatewayPrototypeModel := new(vpcv1.VPNGatewayPrototypeVPNGatewayRouteModePrototype)
				vpnGatewayPrototypeModel.Name = core.StringPtr("my-vpn-gateway")
				vpnGatewayPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				vpnGatewayPrototypeModel.Subnet = subnetIdentityModel
				vpnGatewayPrototypeModel.AdvertisedCIDRs = []string{"192.168.3.0/24"}
				vpnGatewayPrototypeModel.LocalAsn = core.Int64Ptr(int64(64520))
				vpnGatewayPrototypeModel.Mode = core.StringPtr("route")

				// Construct an instance of the CreateVPNGatewayOptions model
				createVPNGatewayOptionsModel := new(vpcv1.CreateVPNGatewayOptions)
				createVPNGatewayOptionsModel.VPNGatewayPrototype = vpnGatewayPrototypeModel
				createVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateVPNGateway(createVPNGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateVPNGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the VPNGatewayPrototypeVPNGatewayRouteModePrototype model
				vpnGatewayPrototypeModel := new(vpcv1.VPNGatewayPrototypeVPNGatewayRouteModePrototype)
				vpnGatewayPrototypeModel.Name = core.StringPtr("my-vpn-gateway")
				vpnGatewayPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				vpnGatewayPrototypeModel.Subnet = subnetIdentityModel
				vpnGatewayPrototypeModel.AdvertisedCIDRs = []string{"192.168.3.0/24"}
				vpnGatewayPrototypeModel.LocalAsn = core.Int64Ptr(int64(64520))
				vpnGatewayPrototypeModel.Mode = core.StringPtr("route")

				// Construct an instance of the CreateVPNGatewayOptions model
				createVPNGatewayOptionsModel := new(vpcv1.CreateVPNGatewayOptions)
				createVPNGatewayOptionsModel.VPNGatewayPrototype = vpnGatewayPrototypeModel
				createVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateVPNGateway(createVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateVPNGatewayOptions model with no property values
				createVPNGatewayOptionsModelNew := new(vpcv1.CreateVPNGatewayOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateVPNGateway(createVPNGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateVPNGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the VPNGatewayPrototypeVPNGatewayRouteModePrototype model
				vpnGatewayPrototypeModel := new(vpcv1.VPNGatewayPrototypeVPNGatewayRouteModePrototype)
				vpnGatewayPrototypeModel.Name = core.StringPtr("my-vpn-gateway")
				vpnGatewayPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				vpnGatewayPrototypeModel.Subnet = subnetIdentityModel
				vpnGatewayPrototypeModel.AdvertisedCIDRs = []string{"192.168.3.0/24"}
				vpnGatewayPrototypeModel.LocalAsn = core.Int64Ptr(int64(64520))
				vpnGatewayPrototypeModel.Mode = core.StringPtr("route")

				// Construct an instance of the CreateVPNGatewayOptions model
				createVPNGatewayOptionsModel := new(vpcv1.CreateVPNGatewayOptions)
				createVPNGatewayOptionsModel.VPNGatewayPrototype = vpnGatewayPrototypeModel
				createVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateVPNGateway(createVPNGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteVPNGateway(deleteVPNGatewayOptions *DeleteVPNGatewayOptions)`, func() {
		version := "2024-06-23"
		deleteVPNGatewayPath := "/vpn_gateways/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVPNGatewayPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteVPNGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteVPNGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteVPNGatewayOptions model
				deleteVPNGatewayOptionsModel := new(vpcv1.DeleteVPNGatewayOptions)
				deleteVPNGatewayOptionsModel.ID = core.StringPtr("testString")
				deleteVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteVPNGateway(deleteVPNGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteVPNGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVPNGatewayOptions model
				deleteVPNGatewayOptionsModel := new(vpcv1.DeleteVPNGatewayOptions)
				deleteVPNGatewayOptionsModel.ID = core.StringPtr("testString")
				deleteVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteVPNGateway(deleteVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteVPNGatewayOptions model with no property values
				deleteVPNGatewayOptionsModelNew := new(vpcv1.DeleteVPNGatewayOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteVPNGateway(deleteVPNGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPNGateway(getVPNGatewayOptions *GetVPNGatewayOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPNGatewayPath := "/vpn_gateways/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNGatewayPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPNGateway with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNGatewayOptions model
				getVPNGatewayOptionsModel := new(vpcv1.GetVPNGatewayOptions)
				getVPNGatewayOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPNGateway(getVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPNGateway(getVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPNGateway(getVPNGatewayOptions *GetVPNGatewayOptions)`, func() {
		version := "2024-06-23"
		getVPNGatewayPath := "/vpn_gateways/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNGatewayPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "policy"}`)
				}))
			})
			It(`Invoke GetVPNGateway successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPNGatewayOptions model
				getVPNGatewayOptionsModel := new(vpcv1.GetVPNGatewayOptions)
				getVPNGatewayOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPNGatewayWithContext(ctx, getVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPNGateway(getVPNGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPNGatewayWithContext(ctx, getVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNGatewayPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "policy"}`)
				}))
			})
			It(`Invoke GetVPNGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPNGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPNGatewayOptions model
				getVPNGatewayOptionsModel := new(vpcv1.GetVPNGatewayOptions)
				getVPNGatewayOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPNGateway(getVPNGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPNGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNGatewayOptions model
				getVPNGatewayOptionsModel := new(vpcv1.GetVPNGatewayOptions)
				getVPNGatewayOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPNGateway(getVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPNGatewayOptions model with no property values
				getVPNGatewayOptionsModelNew := new(vpcv1.GetVPNGatewayOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPNGateway(getVPNGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPNGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNGatewayOptions model
				getVPNGatewayOptionsModel := new(vpcv1.GetVPNGatewayOptions)
				getVPNGatewayOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPNGateway(getVPNGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPNGateway(updateVPNGatewayOptions *UpdateVPNGatewayOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateVPNGatewayPath := "/vpn_gateways/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPNGatewayPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateVPNGateway with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPNGatewayPatch model
				vpnGatewayPatchModel := new(vpcv1.VPNGatewayPatch)
				vpnGatewayPatchModel.LocalAsn = core.Int64Ptr(int64(64520))
				vpnGatewayPatchModel.Name = core.StringPtr("my-vpn-gateway-updated")
				vpnGatewayPatchModelAsPatch, asPatchErr := vpnGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNGatewayOptions model
				updateVPNGatewayOptionsModel := new(vpcv1.UpdateVPNGatewayOptions)
				updateVPNGatewayOptionsModel.ID = core.StringPtr("testString")
				updateVPNGatewayOptionsModel.VPNGatewayPatch = vpnGatewayPatchModelAsPatch
				updateVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateVPNGateway(updateVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateVPNGateway(updateVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPNGateway(updateVPNGatewayOptions *UpdateVPNGatewayOptions)`, func() {
		version := "2024-06-23"
		updateVPNGatewayPath := "/vpn_gateways/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPNGatewayPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "policy"}`)
				}))
			})
			It(`Invoke UpdateVPNGateway successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VPNGatewayPatch model
				vpnGatewayPatchModel := new(vpcv1.VPNGatewayPatch)
				vpnGatewayPatchModel.LocalAsn = core.Int64Ptr(int64(64520))
				vpnGatewayPatchModel.Name = core.StringPtr("my-vpn-gateway-updated")
				vpnGatewayPatchModelAsPatch, asPatchErr := vpnGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNGatewayOptions model
				updateVPNGatewayOptionsModel := new(vpcv1.UpdateVPNGatewayOptions)
				updateVPNGatewayOptionsModel.ID = core.StringPtr("testString")
				updateVPNGatewayOptionsModel.VPNGatewayPatch = vpnGatewayPatchModelAsPatch
				updateVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateVPNGatewayWithContext(ctx, updateVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateVPNGateway(updateVPNGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateVPNGatewayWithContext(ctx, updateVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPNGatewayPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "name": "my-vpn-gateway-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "0717-ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN's subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "policy"}`)
				}))
			})
			It(`Invoke UpdateVPNGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateVPNGateway(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VPNGatewayPatch model
				vpnGatewayPatchModel := new(vpcv1.VPNGatewayPatch)
				vpnGatewayPatchModel.LocalAsn = core.Int64Ptr(int64(64520))
				vpnGatewayPatchModel.Name = core.StringPtr("my-vpn-gateway-updated")
				vpnGatewayPatchModelAsPatch, asPatchErr := vpnGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNGatewayOptions model
				updateVPNGatewayOptionsModel := new(vpcv1.UpdateVPNGatewayOptions)
				updateVPNGatewayOptionsModel.ID = core.StringPtr("testString")
				updateVPNGatewayOptionsModel.VPNGatewayPatch = vpnGatewayPatchModelAsPatch
				updateVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateVPNGateway(updateVPNGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateVPNGateway with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPNGatewayPatch model
				vpnGatewayPatchModel := new(vpcv1.VPNGatewayPatch)
				vpnGatewayPatchModel.LocalAsn = core.Int64Ptr(int64(64520))
				vpnGatewayPatchModel.Name = core.StringPtr("my-vpn-gateway-updated")
				vpnGatewayPatchModelAsPatch, asPatchErr := vpnGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNGatewayOptions model
				updateVPNGatewayOptionsModel := new(vpcv1.UpdateVPNGatewayOptions)
				updateVPNGatewayOptionsModel.ID = core.StringPtr("testString")
				updateVPNGatewayOptionsModel.VPNGatewayPatch = vpnGatewayPatchModelAsPatch
				updateVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateVPNGateway(updateVPNGatewayOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateVPNGatewayOptions model with no property values
				updateVPNGatewayOptionsModelNew := new(vpcv1.UpdateVPNGatewayOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateVPNGateway(updateVPNGatewayOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateVPNGateway successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPNGatewayPatch model
				vpnGatewayPatchModel := new(vpcv1.VPNGatewayPatch)
				vpnGatewayPatchModel.LocalAsn = core.Int64Ptr(int64(64520))
				vpnGatewayPatchModel.Name = core.StringPtr("my-vpn-gateway-updated")
				vpnGatewayPatchModelAsPatch, asPatchErr := vpnGatewayPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNGatewayOptions model
				updateVPNGatewayOptionsModel := new(vpcv1.UpdateVPNGatewayOptions)
				updateVPNGatewayOptionsModel.ID = core.StringPtr("testString")
				updateVPNGatewayOptionsModel.VPNGatewayPatch = vpnGatewayPatchModelAsPatch
				updateVPNGatewayOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateVPNGateway(updateVPNGatewayOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNGatewayAdvertisedCIDRs(listVPNGatewayAdvertisedCIDRsOptions *ListVPNGatewayAdvertisedCIDRsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVPNGatewayAdvertisedCIDRsPath := "/vpn_gateways/testString/advertised_cidrs"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayAdvertisedCIDRsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVPNGatewayAdvertisedCIDRs with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayAdvertisedCIDRsOptions model
				listVPNGatewayAdvertisedCIDRsOptionsModel := new(vpcv1.ListVPNGatewayAdvertisedCIDRsOptions)
				listVPNGatewayAdvertisedCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayAdvertisedCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVPNGatewayAdvertisedCIDRs(listVPNGatewayAdvertisedCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVPNGatewayAdvertisedCIDRs(listVPNGatewayAdvertisedCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNGatewayAdvertisedCIDRs(listVPNGatewayAdvertisedCIDRsOptions *ListVPNGatewayAdvertisedCIDRsOptions)`, func() {
		version := "2024-06-23"
		listVPNGatewayAdvertisedCIDRsPath := "/vpn_gateways/testString/advertised_cidrs"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayAdvertisedCIDRsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"advertised_cidrs": ["192.168.3.0/24"]}`)
				}))
			})
			It(`Invoke ListVPNGatewayAdvertisedCIDRs successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVPNGatewayAdvertisedCIDRsOptions model
				listVPNGatewayAdvertisedCIDRsOptionsModel := new(vpcv1.ListVPNGatewayAdvertisedCIDRsOptions)
				listVPNGatewayAdvertisedCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayAdvertisedCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVPNGatewayAdvertisedCIDRsWithContext(ctx, listVPNGatewayAdvertisedCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVPNGatewayAdvertisedCIDRs(listVPNGatewayAdvertisedCIDRsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVPNGatewayAdvertisedCIDRsWithContext(ctx, listVPNGatewayAdvertisedCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayAdvertisedCIDRsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"advertised_cidrs": ["192.168.3.0/24"]}`)
				}))
			})
			It(`Invoke ListVPNGatewayAdvertisedCIDRs successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVPNGatewayAdvertisedCIDRs(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVPNGatewayAdvertisedCIDRsOptions model
				listVPNGatewayAdvertisedCIDRsOptionsModel := new(vpcv1.ListVPNGatewayAdvertisedCIDRsOptions)
				listVPNGatewayAdvertisedCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayAdvertisedCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVPNGatewayAdvertisedCIDRs(listVPNGatewayAdvertisedCIDRsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVPNGatewayAdvertisedCIDRs with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayAdvertisedCIDRsOptions model
				listVPNGatewayAdvertisedCIDRsOptionsModel := new(vpcv1.ListVPNGatewayAdvertisedCIDRsOptions)
				listVPNGatewayAdvertisedCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayAdvertisedCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVPNGatewayAdvertisedCIDRs(listVPNGatewayAdvertisedCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListVPNGatewayAdvertisedCIDRsOptions model with no property values
				listVPNGatewayAdvertisedCIDRsOptionsModelNew := new(vpcv1.ListVPNGatewayAdvertisedCIDRsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListVPNGatewayAdvertisedCIDRs(listVPNGatewayAdvertisedCIDRsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVPNGatewayAdvertisedCIDRs successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayAdvertisedCIDRsOptions model
				listVPNGatewayAdvertisedCIDRsOptionsModel := new(vpcv1.ListVPNGatewayAdvertisedCIDRsOptions)
				listVPNGatewayAdvertisedCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayAdvertisedCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVPNGatewayAdvertisedCIDRs(listVPNGatewayAdvertisedCIDRsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`RemoveVPNGatewayAdvertisedCIDR(removeVPNGatewayAdvertisedCIDROptions *RemoveVPNGatewayAdvertisedCIDROptions)`, func() {
		version := "2024-06-23"
		removeVPNGatewayAdvertisedCIDRPath := "/vpn_gateways/testString/advertised_cidrs/192.168.1.0%2F24"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(removeVPNGatewayAdvertisedCIDRPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke RemoveVPNGatewayAdvertisedCIDR successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.RemoveVPNGatewayAdvertisedCIDR(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the RemoveVPNGatewayAdvertisedCIDROptions model
				removeVPNGatewayAdvertisedCIDROptionsModel := new(vpcv1.RemoveVPNGatewayAdvertisedCIDROptions)
				removeVPNGatewayAdvertisedCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				removeVPNGatewayAdvertisedCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				removeVPNGatewayAdvertisedCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.RemoveVPNGatewayAdvertisedCIDR(removeVPNGatewayAdvertisedCIDROptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke RemoveVPNGatewayAdvertisedCIDR with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RemoveVPNGatewayAdvertisedCIDROptions model
				removeVPNGatewayAdvertisedCIDROptionsModel := new(vpcv1.RemoveVPNGatewayAdvertisedCIDROptions)
				removeVPNGatewayAdvertisedCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				removeVPNGatewayAdvertisedCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				removeVPNGatewayAdvertisedCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.RemoveVPNGatewayAdvertisedCIDR(removeVPNGatewayAdvertisedCIDROptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the RemoveVPNGatewayAdvertisedCIDROptions model with no property values
				removeVPNGatewayAdvertisedCIDROptionsModelNew := new(vpcv1.RemoveVPNGatewayAdvertisedCIDROptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.RemoveVPNGatewayAdvertisedCIDR(removeVPNGatewayAdvertisedCIDROptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CheckVPNGatewayAdvertisedCIDR(checkVPNGatewayAdvertisedCIDROptions *CheckVPNGatewayAdvertisedCIDROptions)`, func() {
		version := "2024-06-23"
		checkVPNGatewayAdvertisedCIDRPath := "/vpn_gateways/testString/advertised_cidrs/192.168.1.0%2F24"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(checkVPNGatewayAdvertisedCIDRPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke CheckVPNGatewayAdvertisedCIDR successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.CheckVPNGatewayAdvertisedCIDR(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the CheckVPNGatewayAdvertisedCIDROptions model
				checkVPNGatewayAdvertisedCIDROptionsModel := new(vpcv1.CheckVPNGatewayAdvertisedCIDROptions)
				checkVPNGatewayAdvertisedCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				checkVPNGatewayAdvertisedCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				checkVPNGatewayAdvertisedCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.CheckVPNGatewayAdvertisedCIDR(checkVPNGatewayAdvertisedCIDROptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke CheckVPNGatewayAdvertisedCIDR with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CheckVPNGatewayAdvertisedCIDROptions model
				checkVPNGatewayAdvertisedCIDROptionsModel := new(vpcv1.CheckVPNGatewayAdvertisedCIDROptions)
				checkVPNGatewayAdvertisedCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				checkVPNGatewayAdvertisedCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				checkVPNGatewayAdvertisedCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.CheckVPNGatewayAdvertisedCIDR(checkVPNGatewayAdvertisedCIDROptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the CheckVPNGatewayAdvertisedCIDROptions model with no property values
				checkVPNGatewayAdvertisedCIDROptionsModelNew := new(vpcv1.CheckVPNGatewayAdvertisedCIDROptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.CheckVPNGatewayAdvertisedCIDR(checkVPNGatewayAdvertisedCIDROptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`AddVPNGatewayAdvertisedCIDR(addVPNGatewayAdvertisedCIDROptions *AddVPNGatewayAdvertisedCIDROptions)`, func() {
		version := "2024-06-23"
		addVPNGatewayAdvertisedCIDRPath := "/vpn_gateways/testString/advertised_cidrs/192.168.1.0%2F24"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addVPNGatewayAdvertisedCIDRPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke AddVPNGatewayAdvertisedCIDR successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.AddVPNGatewayAdvertisedCIDR(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the AddVPNGatewayAdvertisedCIDROptions model
				addVPNGatewayAdvertisedCIDROptionsModel := new(vpcv1.AddVPNGatewayAdvertisedCIDROptions)
				addVPNGatewayAdvertisedCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				addVPNGatewayAdvertisedCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				addVPNGatewayAdvertisedCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.AddVPNGatewayAdvertisedCIDR(addVPNGatewayAdvertisedCIDROptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke AddVPNGatewayAdvertisedCIDR with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddVPNGatewayAdvertisedCIDROptions model
				addVPNGatewayAdvertisedCIDROptionsModel := new(vpcv1.AddVPNGatewayAdvertisedCIDROptions)
				addVPNGatewayAdvertisedCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				addVPNGatewayAdvertisedCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				addVPNGatewayAdvertisedCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.AddVPNGatewayAdvertisedCIDR(addVPNGatewayAdvertisedCIDROptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the AddVPNGatewayAdvertisedCIDROptions model with no property values
				addVPNGatewayAdvertisedCIDROptionsModelNew := new(vpcv1.AddVPNGatewayAdvertisedCIDROptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.AddVPNGatewayAdvertisedCIDR(addVPNGatewayAdvertisedCIDROptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNGatewayConnections(listVPNGatewayConnectionsOptions *ListVPNGatewayConnectionsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVPNGatewayConnectionsPath := "/vpn_gateways/testString/connections"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayConnectionsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["status"]).To(Equal([]string{"down"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVPNGatewayConnections with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayConnectionsOptions model
				listVPNGatewayConnectionsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsOptions)
				listVPNGatewayConnectionsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewayConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewayConnectionsOptionsModel.Status = core.StringPtr("down")
				listVPNGatewayConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVPNGatewayConnections(listVPNGatewayConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVPNGatewayConnections(listVPNGatewayConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNGatewayConnections(listVPNGatewayConnectionsOptions *ListVPNGatewayConnectionsOptions)`, func() {
		version := "2024-06-23"
		listVPNGatewayConnectionsPath := "/vpn_gateways/testString/connections"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayConnectionsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["status"]).To(Equal([]string{"down"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-gateway-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": false, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "192.0.2.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPNGatewayConnections successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVPNGatewayConnectionsOptions model
				listVPNGatewayConnectionsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsOptions)
				listVPNGatewayConnectionsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewayConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewayConnectionsOptionsModel.Status = core.StringPtr("down")
				listVPNGatewayConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVPNGatewayConnectionsWithContext(ctx, listVPNGatewayConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVPNGatewayConnections(listVPNGatewayConnectionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVPNGatewayConnectionsWithContext(ctx, listVPNGatewayConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayConnectionsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["status"]).To(Equal([]string{"down"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-gateway-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": false, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "192.0.2.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPNGatewayConnections successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVPNGatewayConnections(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVPNGatewayConnectionsOptions model
				listVPNGatewayConnectionsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsOptions)
				listVPNGatewayConnectionsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewayConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewayConnectionsOptionsModel.Status = core.StringPtr("down")
				listVPNGatewayConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVPNGatewayConnections(listVPNGatewayConnectionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVPNGatewayConnections with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayConnectionsOptions model
				listVPNGatewayConnectionsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsOptions)
				listVPNGatewayConnectionsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewayConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewayConnectionsOptionsModel.Status = core.StringPtr("down")
				listVPNGatewayConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVPNGatewayConnections(listVPNGatewayConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListVPNGatewayConnectionsOptions model with no property values
				listVPNGatewayConnectionsOptionsModelNew := new(vpcv1.ListVPNGatewayConnectionsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListVPNGatewayConnections(listVPNGatewayConnectionsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVPNGatewayConnections successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayConnectionsOptions model
				listVPNGatewayConnectionsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsOptions)
				listVPNGatewayConnectionsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewayConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewayConnectionsOptionsModel.Status = core.StringPtr("down")
				listVPNGatewayConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVPNGatewayConnections(listVPNGatewayConnectionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.VPNGatewayConnectionCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.VPNGatewayConnectionCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.VPNGatewayConnectionCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayConnectionsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","id":"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","id":"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876","id":"r006-51eae621-dbbc-4c47-b623-b57a43c19876","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-gateway-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":false,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"192.0.2.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","id":"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","id":"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876","id":"r006-51eae621-dbbc-4c47-b623-b57a43c19876","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-gateway-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":false,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"192.0.2.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VPNGatewayConnectionsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPNGatewayConnectionsOptionsModel := &vpcv1.ListVPNGatewayConnectionsOptions{
					VPNGatewayID: core.StringPtr("testString"),
					Limit:        core.Int64Ptr(int64(10)),
					Status:       core.StringPtr("down"),
				}

				pager, err := vpcService.NewVPNGatewayConnectionsPager(listVPNGatewayConnectionsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.VPNGatewayConnectionIntf
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VPNGatewayConnectionsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPNGatewayConnectionsOptionsModel := &vpcv1.ListVPNGatewayConnectionsOptions{
					VPNGatewayID: core.StringPtr("testString"),
					Limit:        core.Int64Ptr(int64(10)),
					Status:       core.StringPtr("down"),
				}

				pager, err := vpcService.NewVPNGatewayConnectionsPager(listVPNGatewayConnectionsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateVPNGatewayConnection(createVPNGatewayConnectionOptions *CreateVPNGatewayConnectionOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createVPNGatewayConnectionPath := "/vpn_gateways/testString/connections"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPNGatewayConnectionPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateVPNGatewayConnection with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPNGatewayConnectionDpdPrototype model
				vpnGatewayConnectionDpdPrototypeModel := new(vpcv1.VPNGatewayConnectionDpdPrototype)
				vpnGatewayConnectionDpdPrototypeModel.Action = core.StringPtr("restart")
				vpnGatewayConnectionDpdPrototypeModel.Interval = core.Int64Ptr(int64(30))
				vpnGatewayConnectionDpdPrototypeModel.Timeout = core.Int64Ptr(int64(120))

				// Construct an instance of the VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID model
				vpnGatewayConnectionIkePolicyPrototypeModel := new(vpcv1.VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID)
				vpnGatewayConnectionIkePolicyPrototypeModel.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

				// Construct an instance of the VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID model
				vpnGatewayConnectionIPsecPolicyPrototypeModel := new(vpcv1.VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID)
				vpnGatewayConnectionIPsecPolicyPrototypeModel.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")

				// Construct an instance of the VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn model
				vpnGatewayConnectionIkeIdentityPrototypeModel := new(vpcv1.VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn)
				vpnGatewayConnectionIkeIdentityPrototypeModel.Type = core.StringPtr("fqdn")
				vpnGatewayConnectionIkeIdentityPrototypeModel.Value = core.StringPtr("my-service.example.com")

				// Construct an instance of the VPNGatewayConnectionStaticRouteModeLocalPrototype model
				vpnGatewayConnectionStaticRouteModeLocalPrototypeModel := new(vpcv1.VPNGatewayConnectionStaticRouteModeLocalPrototype)
				vpnGatewayConnectionStaticRouteModeLocalPrototypeModel.IkeIdentities = []vpcv1.VPNGatewayConnectionIkeIdentityPrototypeIntf{vpnGatewayConnectionIkeIdentityPrototypeModel}

				// Construct an instance of the VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress model
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel := new(vpcv1.VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress)
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel.IkeIdentity = vpnGatewayConnectionIkeIdentityPrototypeModel
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel.Address = core.StringPtr("192.0.2.5")

				// Construct an instance of the VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model
				vpnGatewayConnectionPrototypeModel := new(vpcv1.VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype)
				vpnGatewayConnectionPrototypeModel.AdminStateUp = core.BoolPtr(true)
				vpnGatewayConnectionPrototypeModel.DeadPeerDetection = vpnGatewayConnectionDpdPrototypeModel
				vpnGatewayConnectionPrototypeModel.EstablishMode = core.StringPtr("bidirectional")
				vpnGatewayConnectionPrototypeModel.IkePolicy = vpnGatewayConnectionIkePolicyPrototypeModel
				vpnGatewayConnectionPrototypeModel.IpsecPolicy = vpnGatewayConnectionIPsecPolicyPrototypeModel
				vpnGatewayConnectionPrototypeModel.Name = core.StringPtr("my-vpn-gateway-connection")
				vpnGatewayConnectionPrototypeModel.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
				vpnGatewayConnectionPrototypeModel.DistributeTraffic = core.BoolPtr(false)
				vpnGatewayConnectionPrototypeModel.Local = vpnGatewayConnectionStaticRouteModeLocalPrototypeModel
				vpnGatewayConnectionPrototypeModel.Peer = vpnGatewayConnectionStaticRouteModePeerPrototypeModel
				vpnGatewayConnectionPrototypeModel.RoutingProtocol = core.StringPtr("none")

				// Construct an instance of the CreateVPNGatewayConnectionOptions model
				createVPNGatewayConnectionOptionsModel := new(vpcv1.CreateVPNGatewayConnectionOptions)
				createVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				createVPNGatewayConnectionOptionsModel.VPNGatewayConnectionPrototype = vpnGatewayConnectionPrototypeModel
				createVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateVPNGatewayConnection(createVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateVPNGatewayConnection(createVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateVPNGatewayConnection(createVPNGatewayConnectionOptions *CreateVPNGatewayConnectionOptions)`, func() {
		version := "2024-06-23"
		createVPNGatewayConnectionPath := "/vpn_gateways/testString/connections"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPNGatewayConnectionPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-gateway-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": false, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "192.0.2.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}`)
				}))
			})
			It(`Invoke CreateVPNGatewayConnection successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VPNGatewayConnectionDpdPrototype model
				vpnGatewayConnectionDpdPrototypeModel := new(vpcv1.VPNGatewayConnectionDpdPrototype)
				vpnGatewayConnectionDpdPrototypeModel.Action = core.StringPtr("restart")
				vpnGatewayConnectionDpdPrototypeModel.Interval = core.Int64Ptr(int64(30))
				vpnGatewayConnectionDpdPrototypeModel.Timeout = core.Int64Ptr(int64(120))

				// Construct an instance of the VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID model
				vpnGatewayConnectionIkePolicyPrototypeModel := new(vpcv1.VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID)
				vpnGatewayConnectionIkePolicyPrototypeModel.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

				// Construct an instance of the VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID model
				vpnGatewayConnectionIPsecPolicyPrototypeModel := new(vpcv1.VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID)
				vpnGatewayConnectionIPsecPolicyPrototypeModel.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")

				// Construct an instance of the VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn model
				vpnGatewayConnectionIkeIdentityPrototypeModel := new(vpcv1.VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn)
				vpnGatewayConnectionIkeIdentityPrototypeModel.Type = core.StringPtr("fqdn")
				vpnGatewayConnectionIkeIdentityPrototypeModel.Value = core.StringPtr("my-service.example.com")

				// Construct an instance of the VPNGatewayConnectionStaticRouteModeLocalPrototype model
				vpnGatewayConnectionStaticRouteModeLocalPrototypeModel := new(vpcv1.VPNGatewayConnectionStaticRouteModeLocalPrototype)
				vpnGatewayConnectionStaticRouteModeLocalPrototypeModel.IkeIdentities = []vpcv1.VPNGatewayConnectionIkeIdentityPrototypeIntf{vpnGatewayConnectionIkeIdentityPrototypeModel}

				// Construct an instance of the VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress model
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel := new(vpcv1.VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress)
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel.IkeIdentity = vpnGatewayConnectionIkeIdentityPrototypeModel
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel.Address = core.StringPtr("192.0.2.5")

				// Construct an instance of the VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model
				vpnGatewayConnectionPrototypeModel := new(vpcv1.VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype)
				vpnGatewayConnectionPrototypeModel.AdminStateUp = core.BoolPtr(true)
				vpnGatewayConnectionPrototypeModel.DeadPeerDetection = vpnGatewayConnectionDpdPrototypeModel
				vpnGatewayConnectionPrototypeModel.EstablishMode = core.StringPtr("bidirectional")
				vpnGatewayConnectionPrototypeModel.IkePolicy = vpnGatewayConnectionIkePolicyPrototypeModel
				vpnGatewayConnectionPrototypeModel.IpsecPolicy = vpnGatewayConnectionIPsecPolicyPrototypeModel
				vpnGatewayConnectionPrototypeModel.Name = core.StringPtr("my-vpn-gateway-connection")
				vpnGatewayConnectionPrototypeModel.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
				vpnGatewayConnectionPrototypeModel.DistributeTraffic = core.BoolPtr(false)
				vpnGatewayConnectionPrototypeModel.Local = vpnGatewayConnectionStaticRouteModeLocalPrototypeModel
				vpnGatewayConnectionPrototypeModel.Peer = vpnGatewayConnectionStaticRouteModePeerPrototypeModel
				vpnGatewayConnectionPrototypeModel.RoutingProtocol = core.StringPtr("none")

				// Construct an instance of the CreateVPNGatewayConnectionOptions model
				createVPNGatewayConnectionOptionsModel := new(vpcv1.CreateVPNGatewayConnectionOptions)
				createVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				createVPNGatewayConnectionOptionsModel.VPNGatewayConnectionPrototype = vpnGatewayConnectionPrototypeModel
				createVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateVPNGatewayConnectionWithContext(ctx, createVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateVPNGatewayConnection(createVPNGatewayConnectionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateVPNGatewayConnectionWithContext(ctx, createVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPNGatewayConnectionPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-gateway-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": false, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "192.0.2.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}`)
				}))
			})
			It(`Invoke CreateVPNGatewayConnection successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateVPNGatewayConnection(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VPNGatewayConnectionDpdPrototype model
				vpnGatewayConnectionDpdPrototypeModel := new(vpcv1.VPNGatewayConnectionDpdPrototype)
				vpnGatewayConnectionDpdPrototypeModel.Action = core.StringPtr("restart")
				vpnGatewayConnectionDpdPrototypeModel.Interval = core.Int64Ptr(int64(30))
				vpnGatewayConnectionDpdPrototypeModel.Timeout = core.Int64Ptr(int64(120))

				// Construct an instance of the VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID model
				vpnGatewayConnectionIkePolicyPrototypeModel := new(vpcv1.VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID)
				vpnGatewayConnectionIkePolicyPrototypeModel.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

				// Construct an instance of the VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID model
				vpnGatewayConnectionIPsecPolicyPrototypeModel := new(vpcv1.VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID)
				vpnGatewayConnectionIPsecPolicyPrototypeModel.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")

				// Construct an instance of the VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn model
				vpnGatewayConnectionIkeIdentityPrototypeModel := new(vpcv1.VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn)
				vpnGatewayConnectionIkeIdentityPrototypeModel.Type = core.StringPtr("fqdn")
				vpnGatewayConnectionIkeIdentityPrototypeModel.Value = core.StringPtr("my-service.example.com")

				// Construct an instance of the VPNGatewayConnectionStaticRouteModeLocalPrototype model
				vpnGatewayConnectionStaticRouteModeLocalPrototypeModel := new(vpcv1.VPNGatewayConnectionStaticRouteModeLocalPrototype)
				vpnGatewayConnectionStaticRouteModeLocalPrototypeModel.IkeIdentities = []vpcv1.VPNGatewayConnectionIkeIdentityPrototypeIntf{vpnGatewayConnectionIkeIdentityPrototypeModel}

				// Construct an instance of the VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress model
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel := new(vpcv1.VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress)
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel.IkeIdentity = vpnGatewayConnectionIkeIdentityPrototypeModel
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel.Address = core.StringPtr("192.0.2.5")

				// Construct an instance of the VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model
				vpnGatewayConnectionPrototypeModel := new(vpcv1.VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype)
				vpnGatewayConnectionPrototypeModel.AdminStateUp = core.BoolPtr(true)
				vpnGatewayConnectionPrototypeModel.DeadPeerDetection = vpnGatewayConnectionDpdPrototypeModel
				vpnGatewayConnectionPrototypeModel.EstablishMode = core.StringPtr("bidirectional")
				vpnGatewayConnectionPrototypeModel.IkePolicy = vpnGatewayConnectionIkePolicyPrototypeModel
				vpnGatewayConnectionPrototypeModel.IpsecPolicy = vpnGatewayConnectionIPsecPolicyPrototypeModel
				vpnGatewayConnectionPrototypeModel.Name = core.StringPtr("my-vpn-gateway-connection")
				vpnGatewayConnectionPrototypeModel.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
				vpnGatewayConnectionPrototypeModel.DistributeTraffic = core.BoolPtr(false)
				vpnGatewayConnectionPrototypeModel.Local = vpnGatewayConnectionStaticRouteModeLocalPrototypeModel
				vpnGatewayConnectionPrototypeModel.Peer = vpnGatewayConnectionStaticRouteModePeerPrototypeModel
				vpnGatewayConnectionPrototypeModel.RoutingProtocol = core.StringPtr("none")

				// Construct an instance of the CreateVPNGatewayConnectionOptions model
				createVPNGatewayConnectionOptionsModel := new(vpcv1.CreateVPNGatewayConnectionOptions)
				createVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				createVPNGatewayConnectionOptionsModel.VPNGatewayConnectionPrototype = vpnGatewayConnectionPrototypeModel
				createVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateVPNGatewayConnection(createVPNGatewayConnectionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateVPNGatewayConnection with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPNGatewayConnectionDpdPrototype model
				vpnGatewayConnectionDpdPrototypeModel := new(vpcv1.VPNGatewayConnectionDpdPrototype)
				vpnGatewayConnectionDpdPrototypeModel.Action = core.StringPtr("restart")
				vpnGatewayConnectionDpdPrototypeModel.Interval = core.Int64Ptr(int64(30))
				vpnGatewayConnectionDpdPrototypeModel.Timeout = core.Int64Ptr(int64(120))

				// Construct an instance of the VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID model
				vpnGatewayConnectionIkePolicyPrototypeModel := new(vpcv1.VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID)
				vpnGatewayConnectionIkePolicyPrototypeModel.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

				// Construct an instance of the VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID model
				vpnGatewayConnectionIPsecPolicyPrototypeModel := new(vpcv1.VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID)
				vpnGatewayConnectionIPsecPolicyPrototypeModel.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")

				// Construct an instance of the VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn model
				vpnGatewayConnectionIkeIdentityPrototypeModel := new(vpcv1.VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn)
				vpnGatewayConnectionIkeIdentityPrototypeModel.Type = core.StringPtr("fqdn")
				vpnGatewayConnectionIkeIdentityPrototypeModel.Value = core.StringPtr("my-service.example.com")

				// Construct an instance of the VPNGatewayConnectionStaticRouteModeLocalPrototype model
				vpnGatewayConnectionStaticRouteModeLocalPrototypeModel := new(vpcv1.VPNGatewayConnectionStaticRouteModeLocalPrototype)
				vpnGatewayConnectionStaticRouteModeLocalPrototypeModel.IkeIdentities = []vpcv1.VPNGatewayConnectionIkeIdentityPrototypeIntf{vpnGatewayConnectionIkeIdentityPrototypeModel}

				// Construct an instance of the VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress model
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel := new(vpcv1.VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress)
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel.IkeIdentity = vpnGatewayConnectionIkeIdentityPrototypeModel
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel.Address = core.StringPtr("192.0.2.5")

				// Construct an instance of the VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model
				vpnGatewayConnectionPrototypeModel := new(vpcv1.VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype)
				vpnGatewayConnectionPrototypeModel.AdminStateUp = core.BoolPtr(true)
				vpnGatewayConnectionPrototypeModel.DeadPeerDetection = vpnGatewayConnectionDpdPrototypeModel
				vpnGatewayConnectionPrototypeModel.EstablishMode = core.StringPtr("bidirectional")
				vpnGatewayConnectionPrototypeModel.IkePolicy = vpnGatewayConnectionIkePolicyPrototypeModel
				vpnGatewayConnectionPrototypeModel.IpsecPolicy = vpnGatewayConnectionIPsecPolicyPrototypeModel
				vpnGatewayConnectionPrototypeModel.Name = core.StringPtr("my-vpn-gateway-connection")
				vpnGatewayConnectionPrototypeModel.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
				vpnGatewayConnectionPrototypeModel.DistributeTraffic = core.BoolPtr(false)
				vpnGatewayConnectionPrototypeModel.Local = vpnGatewayConnectionStaticRouteModeLocalPrototypeModel
				vpnGatewayConnectionPrototypeModel.Peer = vpnGatewayConnectionStaticRouteModePeerPrototypeModel
				vpnGatewayConnectionPrototypeModel.RoutingProtocol = core.StringPtr("none")

				// Construct an instance of the CreateVPNGatewayConnectionOptions model
				createVPNGatewayConnectionOptionsModel := new(vpcv1.CreateVPNGatewayConnectionOptions)
				createVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				createVPNGatewayConnectionOptionsModel.VPNGatewayConnectionPrototype = vpnGatewayConnectionPrototypeModel
				createVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateVPNGatewayConnection(createVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateVPNGatewayConnectionOptions model with no property values
				createVPNGatewayConnectionOptionsModelNew := new(vpcv1.CreateVPNGatewayConnectionOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateVPNGatewayConnection(createVPNGatewayConnectionOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateVPNGatewayConnection successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPNGatewayConnectionDpdPrototype model
				vpnGatewayConnectionDpdPrototypeModel := new(vpcv1.VPNGatewayConnectionDpdPrototype)
				vpnGatewayConnectionDpdPrototypeModel.Action = core.StringPtr("restart")
				vpnGatewayConnectionDpdPrototypeModel.Interval = core.Int64Ptr(int64(30))
				vpnGatewayConnectionDpdPrototypeModel.Timeout = core.Int64Ptr(int64(120))

				// Construct an instance of the VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID model
				vpnGatewayConnectionIkePolicyPrototypeModel := new(vpcv1.VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID)
				vpnGatewayConnectionIkePolicyPrototypeModel.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

				// Construct an instance of the VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID model
				vpnGatewayConnectionIPsecPolicyPrototypeModel := new(vpcv1.VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID)
				vpnGatewayConnectionIPsecPolicyPrototypeModel.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")

				// Construct an instance of the VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn model
				vpnGatewayConnectionIkeIdentityPrototypeModel := new(vpcv1.VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn)
				vpnGatewayConnectionIkeIdentityPrototypeModel.Type = core.StringPtr("fqdn")
				vpnGatewayConnectionIkeIdentityPrototypeModel.Value = core.StringPtr("my-service.example.com")

				// Construct an instance of the VPNGatewayConnectionStaticRouteModeLocalPrototype model
				vpnGatewayConnectionStaticRouteModeLocalPrototypeModel := new(vpcv1.VPNGatewayConnectionStaticRouteModeLocalPrototype)
				vpnGatewayConnectionStaticRouteModeLocalPrototypeModel.IkeIdentities = []vpcv1.VPNGatewayConnectionIkeIdentityPrototypeIntf{vpnGatewayConnectionIkeIdentityPrototypeModel}

				// Construct an instance of the VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress model
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel := new(vpcv1.VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress)
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel.IkeIdentity = vpnGatewayConnectionIkeIdentityPrototypeModel
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel.Address = core.StringPtr("192.0.2.5")

				// Construct an instance of the VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model
				vpnGatewayConnectionPrototypeModel := new(vpcv1.VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype)
				vpnGatewayConnectionPrototypeModel.AdminStateUp = core.BoolPtr(true)
				vpnGatewayConnectionPrototypeModel.DeadPeerDetection = vpnGatewayConnectionDpdPrototypeModel
				vpnGatewayConnectionPrototypeModel.EstablishMode = core.StringPtr("bidirectional")
				vpnGatewayConnectionPrototypeModel.IkePolicy = vpnGatewayConnectionIkePolicyPrototypeModel
				vpnGatewayConnectionPrototypeModel.IpsecPolicy = vpnGatewayConnectionIPsecPolicyPrototypeModel
				vpnGatewayConnectionPrototypeModel.Name = core.StringPtr("my-vpn-gateway-connection")
				vpnGatewayConnectionPrototypeModel.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
				vpnGatewayConnectionPrototypeModel.DistributeTraffic = core.BoolPtr(false)
				vpnGatewayConnectionPrototypeModel.Local = vpnGatewayConnectionStaticRouteModeLocalPrototypeModel
				vpnGatewayConnectionPrototypeModel.Peer = vpnGatewayConnectionStaticRouteModePeerPrototypeModel
				vpnGatewayConnectionPrototypeModel.RoutingProtocol = core.StringPtr("none")

				// Construct an instance of the CreateVPNGatewayConnectionOptions model
				createVPNGatewayConnectionOptionsModel := new(vpcv1.CreateVPNGatewayConnectionOptions)
				createVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				createVPNGatewayConnectionOptionsModel.VPNGatewayConnectionPrototype = vpnGatewayConnectionPrototypeModel
				createVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateVPNGatewayConnection(createVPNGatewayConnectionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteVPNGatewayConnection(deleteVPNGatewayConnectionOptions *DeleteVPNGatewayConnectionOptions)`, func() {
		version := "2024-06-23"
		deleteVPNGatewayConnectionPath := "/vpn_gateways/testString/connections/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVPNGatewayConnectionPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteVPNGatewayConnection successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteVPNGatewayConnection(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteVPNGatewayConnectionOptions model
				deleteVPNGatewayConnectionOptionsModel := new(vpcv1.DeleteVPNGatewayConnectionOptions)
				deleteVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				deleteVPNGatewayConnectionOptionsModel.ID = core.StringPtr("testString")
				deleteVPNGatewayConnectionOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteVPNGatewayConnection(deleteVPNGatewayConnectionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteVPNGatewayConnection with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVPNGatewayConnectionOptions model
				deleteVPNGatewayConnectionOptionsModel := new(vpcv1.DeleteVPNGatewayConnectionOptions)
				deleteVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				deleteVPNGatewayConnectionOptionsModel.ID = core.StringPtr("testString")
				deleteVPNGatewayConnectionOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteVPNGatewayConnection(deleteVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteVPNGatewayConnectionOptions model with no property values
				deleteVPNGatewayConnectionOptionsModelNew := new(vpcv1.DeleteVPNGatewayConnectionOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteVPNGatewayConnection(deleteVPNGatewayConnectionOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPNGatewayConnection(getVPNGatewayConnectionOptions *GetVPNGatewayConnectionOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPNGatewayConnectionPath := "/vpn_gateways/testString/connections/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNGatewayConnectionPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPNGatewayConnection with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNGatewayConnectionOptions model
				getVPNGatewayConnectionOptionsModel := new(vpcv1.GetVPNGatewayConnectionOptions)
				getVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				getVPNGatewayConnectionOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPNGatewayConnection(getVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPNGatewayConnection(getVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPNGatewayConnection(getVPNGatewayConnectionOptions *GetVPNGatewayConnectionOptions)`, func() {
		version := "2024-06-23"
		getVPNGatewayConnectionPath := "/vpn_gateways/testString/connections/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNGatewayConnectionPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-gateway-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": false, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "192.0.2.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}`)
				}))
			})
			It(`Invoke GetVPNGatewayConnection successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPNGatewayConnectionOptions model
				getVPNGatewayConnectionOptionsModel := new(vpcv1.GetVPNGatewayConnectionOptions)
				getVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				getVPNGatewayConnectionOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPNGatewayConnectionWithContext(ctx, getVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPNGatewayConnection(getVPNGatewayConnectionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPNGatewayConnectionWithContext(ctx, getVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNGatewayConnectionPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-gateway-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": false, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "192.0.2.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}`)
				}))
			})
			It(`Invoke GetVPNGatewayConnection successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPNGatewayConnection(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPNGatewayConnectionOptions model
				getVPNGatewayConnectionOptionsModel := new(vpcv1.GetVPNGatewayConnectionOptions)
				getVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				getVPNGatewayConnectionOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPNGatewayConnection(getVPNGatewayConnectionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPNGatewayConnection with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNGatewayConnectionOptions model
				getVPNGatewayConnectionOptionsModel := new(vpcv1.GetVPNGatewayConnectionOptions)
				getVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				getVPNGatewayConnectionOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPNGatewayConnection(getVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPNGatewayConnectionOptions model with no property values
				getVPNGatewayConnectionOptionsModelNew := new(vpcv1.GetVPNGatewayConnectionOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPNGatewayConnection(getVPNGatewayConnectionOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPNGatewayConnection successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNGatewayConnectionOptions model
				getVPNGatewayConnectionOptionsModel := new(vpcv1.GetVPNGatewayConnectionOptions)
				getVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				getVPNGatewayConnectionOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPNGatewayConnection(getVPNGatewayConnectionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPNGatewayConnection(updateVPNGatewayConnectionOptions *UpdateVPNGatewayConnectionOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateVPNGatewayConnectionPath := "/vpn_gateways/testString/connections/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPNGatewayConnectionPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateVPNGatewayConnection with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPNGatewayConnectionDpdPatch model
				vpnGatewayConnectionDpdPatchModel := new(vpcv1.VPNGatewayConnectionDpdPatch)
				vpnGatewayConnectionDpdPatchModel.Action = core.StringPtr("restart")
				vpnGatewayConnectionDpdPatchModel.Interval = core.Int64Ptr(int64(30))
				vpnGatewayConnectionDpdPatchModel.Timeout = core.Int64Ptr(int64(120))

				// Construct an instance of the VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID model
				vpnGatewayConnectionIkePolicyPatchModel := new(vpcv1.VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID)
				vpnGatewayConnectionIkePolicyPatchModel.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

				// Construct an instance of the VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID model
				vpnGatewayConnectionIPsecPolicyPatchModel := new(vpcv1.VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID)
				vpnGatewayConnectionIPsecPolicyPatchModel.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")

				// Construct an instance of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch model
				vpnGatewayConnectionPeerPatchModel := new(vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch)
				vpnGatewayConnectionPeerPatchModel.Address = core.StringPtr("192.0.2.5")

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("169.254.0.2")

				// Construct an instance of the VPNGatewayConnectionTunnel model
				vpnGatewayConnectionTunnelModel := new(vpcv1.VPNGatewayConnectionTunnel)
				vpnGatewayConnectionTunnelModel.NeighborIP = ipModel
				vpnGatewayConnectionTunnelModel.TunnelInterfaceIP = ipModel

				// Construct an instance of the VPNGatewayConnectionPatch model
				vpnGatewayConnectionPatchModel := new(vpcv1.VPNGatewayConnectionPatch)
				vpnGatewayConnectionPatchModel.AdminStateUp = core.BoolPtr(true)
				vpnGatewayConnectionPatchModel.DeadPeerDetection = vpnGatewayConnectionDpdPatchModel
				vpnGatewayConnectionPatchModel.DistributeTraffic = core.BoolPtr(true)
				vpnGatewayConnectionPatchModel.EstablishMode = core.StringPtr("bidirectional")
				vpnGatewayConnectionPatchModel.IkePolicy = vpnGatewayConnectionIkePolicyPatchModel
				vpnGatewayConnectionPatchModel.IpsecPolicy = vpnGatewayConnectionIPsecPolicyPatchModel
				vpnGatewayConnectionPatchModel.Name = core.StringPtr("my-vpn-gateway-connection")
				vpnGatewayConnectionPatchModel.Peer = vpnGatewayConnectionPeerPatchModel
				vpnGatewayConnectionPatchModel.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
				vpnGatewayConnectionPatchModel.RoutingProtocol = core.StringPtr("bgp")
				vpnGatewayConnectionPatchModel.Tunnels = []vpcv1.VPNGatewayConnectionTunnel{*vpnGatewayConnectionTunnelModel}
				vpnGatewayConnectionPatchModelAsPatch, asPatchErr := vpnGatewayConnectionPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNGatewayConnectionOptions model
				updateVPNGatewayConnectionOptionsModel := new(vpcv1.UpdateVPNGatewayConnectionOptions)
				updateVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				updateVPNGatewayConnectionOptionsModel.ID = core.StringPtr("testString")
				updateVPNGatewayConnectionOptionsModel.VPNGatewayConnectionPatch = vpnGatewayConnectionPatchModelAsPatch
				updateVPNGatewayConnectionOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateVPNGatewayConnection(updateVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateVPNGatewayConnection(updateVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPNGatewayConnection(updateVPNGatewayConnectionOptions *UpdateVPNGatewayConnectionOptions)`, func() {
		version := "2024-06-23"
		updateVPNGatewayConnectionPath := "/vpn_gateways/testString/connections/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPNGatewayConnectionPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-gateway-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": false, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "192.0.2.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}`)
				}))
			})
			It(`Invoke UpdateVPNGatewayConnection successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VPNGatewayConnectionDpdPatch model
				vpnGatewayConnectionDpdPatchModel := new(vpcv1.VPNGatewayConnectionDpdPatch)
				vpnGatewayConnectionDpdPatchModel.Action = core.StringPtr("restart")
				vpnGatewayConnectionDpdPatchModel.Interval = core.Int64Ptr(int64(30))
				vpnGatewayConnectionDpdPatchModel.Timeout = core.Int64Ptr(int64(120))

				// Construct an instance of the VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID model
				vpnGatewayConnectionIkePolicyPatchModel := new(vpcv1.VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID)
				vpnGatewayConnectionIkePolicyPatchModel.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

				// Construct an instance of the VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID model
				vpnGatewayConnectionIPsecPolicyPatchModel := new(vpcv1.VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID)
				vpnGatewayConnectionIPsecPolicyPatchModel.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")

				// Construct an instance of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch model
				vpnGatewayConnectionPeerPatchModel := new(vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch)
				vpnGatewayConnectionPeerPatchModel.Address = core.StringPtr("192.0.2.5")

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("169.254.0.2")

				// Construct an instance of the VPNGatewayConnectionTunnel model
				vpnGatewayConnectionTunnelModel := new(vpcv1.VPNGatewayConnectionTunnel)
				vpnGatewayConnectionTunnelModel.NeighborIP = ipModel
				vpnGatewayConnectionTunnelModel.TunnelInterfaceIP = ipModel

				// Construct an instance of the VPNGatewayConnectionPatch model
				vpnGatewayConnectionPatchModel := new(vpcv1.VPNGatewayConnectionPatch)
				vpnGatewayConnectionPatchModel.AdminStateUp = core.BoolPtr(true)
				vpnGatewayConnectionPatchModel.DeadPeerDetection = vpnGatewayConnectionDpdPatchModel
				vpnGatewayConnectionPatchModel.DistributeTraffic = core.BoolPtr(true)
				vpnGatewayConnectionPatchModel.EstablishMode = core.StringPtr("bidirectional")
				vpnGatewayConnectionPatchModel.IkePolicy = vpnGatewayConnectionIkePolicyPatchModel
				vpnGatewayConnectionPatchModel.IpsecPolicy = vpnGatewayConnectionIPsecPolicyPatchModel
				vpnGatewayConnectionPatchModel.Name = core.StringPtr("my-vpn-gateway-connection")
				vpnGatewayConnectionPatchModel.Peer = vpnGatewayConnectionPeerPatchModel
				vpnGatewayConnectionPatchModel.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
				vpnGatewayConnectionPatchModel.RoutingProtocol = core.StringPtr("bgp")
				vpnGatewayConnectionPatchModel.Tunnels = []vpcv1.VPNGatewayConnectionTunnel{*vpnGatewayConnectionTunnelModel}
				vpnGatewayConnectionPatchModelAsPatch, asPatchErr := vpnGatewayConnectionPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNGatewayConnectionOptions model
				updateVPNGatewayConnectionOptionsModel := new(vpcv1.UpdateVPNGatewayConnectionOptions)
				updateVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				updateVPNGatewayConnectionOptionsModel.ID = core.StringPtr("testString")
				updateVPNGatewayConnectionOptionsModel.VPNGatewayConnectionPatch = vpnGatewayConnectionPatchModelAsPatch
				updateVPNGatewayConnectionOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateVPNGatewayConnectionWithContext(ctx, updateVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateVPNGatewayConnection(updateVPNGatewayConnectionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateVPNGatewayConnectionWithContext(ctx, updateVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPNGatewayConnectionPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "id": "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "id": "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876", "id": "r006-51eae621-dbbc-4c47-b623-b57a43c19876", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-gateway-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": false, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "192.0.2.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}`)
				}))
			})
			It(`Invoke UpdateVPNGatewayConnection successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateVPNGatewayConnection(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VPNGatewayConnectionDpdPatch model
				vpnGatewayConnectionDpdPatchModel := new(vpcv1.VPNGatewayConnectionDpdPatch)
				vpnGatewayConnectionDpdPatchModel.Action = core.StringPtr("restart")
				vpnGatewayConnectionDpdPatchModel.Interval = core.Int64Ptr(int64(30))
				vpnGatewayConnectionDpdPatchModel.Timeout = core.Int64Ptr(int64(120))

				// Construct an instance of the VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID model
				vpnGatewayConnectionIkePolicyPatchModel := new(vpcv1.VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID)
				vpnGatewayConnectionIkePolicyPatchModel.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

				// Construct an instance of the VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID model
				vpnGatewayConnectionIPsecPolicyPatchModel := new(vpcv1.VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID)
				vpnGatewayConnectionIPsecPolicyPatchModel.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")

				// Construct an instance of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch model
				vpnGatewayConnectionPeerPatchModel := new(vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch)
				vpnGatewayConnectionPeerPatchModel.Address = core.StringPtr("192.0.2.5")

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("169.254.0.2")

				// Construct an instance of the VPNGatewayConnectionTunnel model
				vpnGatewayConnectionTunnelModel := new(vpcv1.VPNGatewayConnectionTunnel)
				vpnGatewayConnectionTunnelModel.NeighborIP = ipModel
				vpnGatewayConnectionTunnelModel.TunnelInterfaceIP = ipModel

				// Construct an instance of the VPNGatewayConnectionPatch model
				vpnGatewayConnectionPatchModel := new(vpcv1.VPNGatewayConnectionPatch)
				vpnGatewayConnectionPatchModel.AdminStateUp = core.BoolPtr(true)
				vpnGatewayConnectionPatchModel.DeadPeerDetection = vpnGatewayConnectionDpdPatchModel
				vpnGatewayConnectionPatchModel.DistributeTraffic = core.BoolPtr(true)
				vpnGatewayConnectionPatchModel.EstablishMode = core.StringPtr("bidirectional")
				vpnGatewayConnectionPatchModel.IkePolicy = vpnGatewayConnectionIkePolicyPatchModel
				vpnGatewayConnectionPatchModel.IpsecPolicy = vpnGatewayConnectionIPsecPolicyPatchModel
				vpnGatewayConnectionPatchModel.Name = core.StringPtr("my-vpn-gateway-connection")
				vpnGatewayConnectionPatchModel.Peer = vpnGatewayConnectionPeerPatchModel
				vpnGatewayConnectionPatchModel.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
				vpnGatewayConnectionPatchModel.RoutingProtocol = core.StringPtr("bgp")
				vpnGatewayConnectionPatchModel.Tunnels = []vpcv1.VPNGatewayConnectionTunnel{*vpnGatewayConnectionTunnelModel}
				vpnGatewayConnectionPatchModelAsPatch, asPatchErr := vpnGatewayConnectionPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNGatewayConnectionOptions model
				updateVPNGatewayConnectionOptionsModel := new(vpcv1.UpdateVPNGatewayConnectionOptions)
				updateVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				updateVPNGatewayConnectionOptionsModel.ID = core.StringPtr("testString")
				updateVPNGatewayConnectionOptionsModel.VPNGatewayConnectionPatch = vpnGatewayConnectionPatchModelAsPatch
				updateVPNGatewayConnectionOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateVPNGatewayConnection(updateVPNGatewayConnectionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateVPNGatewayConnection with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPNGatewayConnectionDpdPatch model
				vpnGatewayConnectionDpdPatchModel := new(vpcv1.VPNGatewayConnectionDpdPatch)
				vpnGatewayConnectionDpdPatchModel.Action = core.StringPtr("restart")
				vpnGatewayConnectionDpdPatchModel.Interval = core.Int64Ptr(int64(30))
				vpnGatewayConnectionDpdPatchModel.Timeout = core.Int64Ptr(int64(120))

				// Construct an instance of the VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID model
				vpnGatewayConnectionIkePolicyPatchModel := new(vpcv1.VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID)
				vpnGatewayConnectionIkePolicyPatchModel.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

				// Construct an instance of the VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID model
				vpnGatewayConnectionIPsecPolicyPatchModel := new(vpcv1.VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID)
				vpnGatewayConnectionIPsecPolicyPatchModel.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")

				// Construct an instance of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch model
				vpnGatewayConnectionPeerPatchModel := new(vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch)
				vpnGatewayConnectionPeerPatchModel.Address = core.StringPtr("192.0.2.5")

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("169.254.0.2")

				// Construct an instance of the VPNGatewayConnectionTunnel model
				vpnGatewayConnectionTunnelModel := new(vpcv1.VPNGatewayConnectionTunnel)
				vpnGatewayConnectionTunnelModel.NeighborIP = ipModel
				vpnGatewayConnectionTunnelModel.TunnelInterfaceIP = ipModel

				// Construct an instance of the VPNGatewayConnectionPatch model
				vpnGatewayConnectionPatchModel := new(vpcv1.VPNGatewayConnectionPatch)
				vpnGatewayConnectionPatchModel.AdminStateUp = core.BoolPtr(true)
				vpnGatewayConnectionPatchModel.DeadPeerDetection = vpnGatewayConnectionDpdPatchModel
				vpnGatewayConnectionPatchModel.DistributeTraffic = core.BoolPtr(true)
				vpnGatewayConnectionPatchModel.EstablishMode = core.StringPtr("bidirectional")
				vpnGatewayConnectionPatchModel.IkePolicy = vpnGatewayConnectionIkePolicyPatchModel
				vpnGatewayConnectionPatchModel.IpsecPolicy = vpnGatewayConnectionIPsecPolicyPatchModel
				vpnGatewayConnectionPatchModel.Name = core.StringPtr("my-vpn-gateway-connection")
				vpnGatewayConnectionPatchModel.Peer = vpnGatewayConnectionPeerPatchModel
				vpnGatewayConnectionPatchModel.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
				vpnGatewayConnectionPatchModel.RoutingProtocol = core.StringPtr("bgp")
				vpnGatewayConnectionPatchModel.Tunnels = []vpcv1.VPNGatewayConnectionTunnel{*vpnGatewayConnectionTunnelModel}
				vpnGatewayConnectionPatchModelAsPatch, asPatchErr := vpnGatewayConnectionPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNGatewayConnectionOptions model
				updateVPNGatewayConnectionOptionsModel := new(vpcv1.UpdateVPNGatewayConnectionOptions)
				updateVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				updateVPNGatewayConnectionOptionsModel.ID = core.StringPtr("testString")
				updateVPNGatewayConnectionOptionsModel.VPNGatewayConnectionPatch = vpnGatewayConnectionPatchModelAsPatch
				updateVPNGatewayConnectionOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateVPNGatewayConnection(updateVPNGatewayConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateVPNGatewayConnectionOptions model with no property values
				updateVPNGatewayConnectionOptionsModelNew := new(vpcv1.UpdateVPNGatewayConnectionOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateVPNGatewayConnection(updateVPNGatewayConnectionOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateVPNGatewayConnection successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPNGatewayConnectionDpdPatch model
				vpnGatewayConnectionDpdPatchModel := new(vpcv1.VPNGatewayConnectionDpdPatch)
				vpnGatewayConnectionDpdPatchModel.Action = core.StringPtr("restart")
				vpnGatewayConnectionDpdPatchModel.Interval = core.Int64Ptr(int64(30))
				vpnGatewayConnectionDpdPatchModel.Timeout = core.Int64Ptr(int64(120))

				// Construct an instance of the VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID model
				vpnGatewayConnectionIkePolicyPatchModel := new(vpcv1.VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID)
				vpnGatewayConnectionIkePolicyPatchModel.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

				// Construct an instance of the VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID model
				vpnGatewayConnectionIPsecPolicyPatchModel := new(vpcv1.VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID)
				vpnGatewayConnectionIPsecPolicyPatchModel.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")

				// Construct an instance of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch model
				vpnGatewayConnectionPeerPatchModel := new(vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch)
				vpnGatewayConnectionPeerPatchModel.Address = core.StringPtr("192.0.2.5")

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("169.254.0.2")

				// Construct an instance of the VPNGatewayConnectionTunnel model
				vpnGatewayConnectionTunnelModel := new(vpcv1.VPNGatewayConnectionTunnel)
				vpnGatewayConnectionTunnelModel.NeighborIP = ipModel
				vpnGatewayConnectionTunnelModel.TunnelInterfaceIP = ipModel

				// Construct an instance of the VPNGatewayConnectionPatch model
				vpnGatewayConnectionPatchModel := new(vpcv1.VPNGatewayConnectionPatch)
				vpnGatewayConnectionPatchModel.AdminStateUp = core.BoolPtr(true)
				vpnGatewayConnectionPatchModel.DeadPeerDetection = vpnGatewayConnectionDpdPatchModel
				vpnGatewayConnectionPatchModel.DistributeTraffic = core.BoolPtr(true)
				vpnGatewayConnectionPatchModel.EstablishMode = core.StringPtr("bidirectional")
				vpnGatewayConnectionPatchModel.IkePolicy = vpnGatewayConnectionIkePolicyPatchModel
				vpnGatewayConnectionPatchModel.IpsecPolicy = vpnGatewayConnectionIPsecPolicyPatchModel
				vpnGatewayConnectionPatchModel.Name = core.StringPtr("my-vpn-gateway-connection")
				vpnGatewayConnectionPatchModel.Peer = vpnGatewayConnectionPeerPatchModel
				vpnGatewayConnectionPatchModel.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
				vpnGatewayConnectionPatchModel.RoutingProtocol = core.StringPtr("bgp")
				vpnGatewayConnectionPatchModel.Tunnels = []vpcv1.VPNGatewayConnectionTunnel{*vpnGatewayConnectionTunnelModel}
				vpnGatewayConnectionPatchModelAsPatch, asPatchErr := vpnGatewayConnectionPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNGatewayConnectionOptions model
				updateVPNGatewayConnectionOptionsModel := new(vpcv1.UpdateVPNGatewayConnectionOptions)
				updateVPNGatewayConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				updateVPNGatewayConnectionOptionsModel.ID = core.StringPtr("testString")
				updateVPNGatewayConnectionOptionsModel.VPNGatewayConnectionPatch = vpnGatewayConnectionPatchModelAsPatch
				updateVPNGatewayConnectionOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPNGatewayConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateVPNGatewayConnection(updateVPNGatewayConnectionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNGatewayConnectionsLocalCIDRs(listVPNGatewayConnectionsLocalCIDRsOptions *ListVPNGatewayConnectionsLocalCIDRsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVPNGatewayConnectionsLocalCIDRsPath := "/vpn_gateways/testString/connections/testString/local/cidrs"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayConnectionsLocalCIDRsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVPNGatewayConnectionsLocalCIDRs with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayConnectionsLocalCIDRsOptions model
				listVPNGatewayConnectionsLocalCIDRsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsLocalCIDRsOptions)
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.ID = core.StringPtr("testString")
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVPNGatewayConnectionsLocalCIDRs(listVPNGatewayConnectionsLocalCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVPNGatewayConnectionsLocalCIDRs(listVPNGatewayConnectionsLocalCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNGatewayConnectionsLocalCIDRs(listVPNGatewayConnectionsLocalCIDRsOptions *ListVPNGatewayConnectionsLocalCIDRsOptions)`, func() {
		version := "2024-06-23"
		listVPNGatewayConnectionsLocalCIDRsPath := "/vpn_gateways/testString/connections/testString/local/cidrs"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayConnectionsLocalCIDRsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cidrs": ["192.0.2.0/24"]}`)
				}))
			})
			It(`Invoke ListVPNGatewayConnectionsLocalCIDRs successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVPNGatewayConnectionsLocalCIDRsOptions model
				listVPNGatewayConnectionsLocalCIDRsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsLocalCIDRsOptions)
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.ID = core.StringPtr("testString")
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVPNGatewayConnectionsLocalCIDRsWithContext(ctx, listVPNGatewayConnectionsLocalCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVPNGatewayConnectionsLocalCIDRs(listVPNGatewayConnectionsLocalCIDRsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVPNGatewayConnectionsLocalCIDRsWithContext(ctx, listVPNGatewayConnectionsLocalCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayConnectionsLocalCIDRsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cidrs": ["192.0.2.0/24"]}`)
				}))
			})
			It(`Invoke ListVPNGatewayConnectionsLocalCIDRs successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVPNGatewayConnectionsLocalCIDRs(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVPNGatewayConnectionsLocalCIDRsOptions model
				listVPNGatewayConnectionsLocalCIDRsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsLocalCIDRsOptions)
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.ID = core.StringPtr("testString")
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVPNGatewayConnectionsLocalCIDRs(listVPNGatewayConnectionsLocalCIDRsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVPNGatewayConnectionsLocalCIDRs with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayConnectionsLocalCIDRsOptions model
				listVPNGatewayConnectionsLocalCIDRsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsLocalCIDRsOptions)
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.ID = core.StringPtr("testString")
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVPNGatewayConnectionsLocalCIDRs(listVPNGatewayConnectionsLocalCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListVPNGatewayConnectionsLocalCIDRsOptions model with no property values
				listVPNGatewayConnectionsLocalCIDRsOptionsModelNew := new(vpcv1.ListVPNGatewayConnectionsLocalCIDRsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListVPNGatewayConnectionsLocalCIDRs(listVPNGatewayConnectionsLocalCIDRsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVPNGatewayConnectionsLocalCIDRs successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayConnectionsLocalCIDRsOptions model
				listVPNGatewayConnectionsLocalCIDRsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsLocalCIDRsOptions)
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.ID = core.StringPtr("testString")
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVPNGatewayConnectionsLocalCIDRs(listVPNGatewayConnectionsLocalCIDRsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`RemoveVPNGatewayConnectionsLocalCIDR(removeVPNGatewayConnectionsLocalCIDROptions *RemoveVPNGatewayConnectionsLocalCIDROptions)`, func() {
		version := "2024-06-23"
		removeVPNGatewayConnectionsLocalCIDRPath := "/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(removeVPNGatewayConnectionsLocalCIDRPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke RemoveVPNGatewayConnectionsLocalCIDR successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.RemoveVPNGatewayConnectionsLocalCIDR(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the RemoveVPNGatewayConnectionsLocalCIDROptions model
				removeVPNGatewayConnectionsLocalCIDROptionsModel := new(vpcv1.RemoveVPNGatewayConnectionsLocalCIDROptions)
				removeVPNGatewayConnectionsLocalCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				removeVPNGatewayConnectionsLocalCIDROptionsModel.ID = core.StringPtr("testString")
				removeVPNGatewayConnectionsLocalCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				removeVPNGatewayConnectionsLocalCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.RemoveVPNGatewayConnectionsLocalCIDR(removeVPNGatewayConnectionsLocalCIDROptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke RemoveVPNGatewayConnectionsLocalCIDR with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RemoveVPNGatewayConnectionsLocalCIDROptions model
				removeVPNGatewayConnectionsLocalCIDROptionsModel := new(vpcv1.RemoveVPNGatewayConnectionsLocalCIDROptions)
				removeVPNGatewayConnectionsLocalCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				removeVPNGatewayConnectionsLocalCIDROptionsModel.ID = core.StringPtr("testString")
				removeVPNGatewayConnectionsLocalCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				removeVPNGatewayConnectionsLocalCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.RemoveVPNGatewayConnectionsLocalCIDR(removeVPNGatewayConnectionsLocalCIDROptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the RemoveVPNGatewayConnectionsLocalCIDROptions model with no property values
				removeVPNGatewayConnectionsLocalCIDROptionsModelNew := new(vpcv1.RemoveVPNGatewayConnectionsLocalCIDROptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.RemoveVPNGatewayConnectionsLocalCIDR(removeVPNGatewayConnectionsLocalCIDROptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CheckVPNGatewayConnectionsLocalCIDR(checkVPNGatewayConnectionsLocalCIDROptions *CheckVPNGatewayConnectionsLocalCIDROptions)`, func() {
		version := "2024-06-23"
		checkVPNGatewayConnectionsLocalCIDRPath := "/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(checkVPNGatewayConnectionsLocalCIDRPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke CheckVPNGatewayConnectionsLocalCIDR successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.CheckVPNGatewayConnectionsLocalCIDR(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the CheckVPNGatewayConnectionsLocalCIDROptions model
				checkVPNGatewayConnectionsLocalCIDROptionsModel := new(vpcv1.CheckVPNGatewayConnectionsLocalCIDROptions)
				checkVPNGatewayConnectionsLocalCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				checkVPNGatewayConnectionsLocalCIDROptionsModel.ID = core.StringPtr("testString")
				checkVPNGatewayConnectionsLocalCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				checkVPNGatewayConnectionsLocalCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.CheckVPNGatewayConnectionsLocalCIDR(checkVPNGatewayConnectionsLocalCIDROptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke CheckVPNGatewayConnectionsLocalCIDR with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CheckVPNGatewayConnectionsLocalCIDROptions model
				checkVPNGatewayConnectionsLocalCIDROptionsModel := new(vpcv1.CheckVPNGatewayConnectionsLocalCIDROptions)
				checkVPNGatewayConnectionsLocalCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				checkVPNGatewayConnectionsLocalCIDROptionsModel.ID = core.StringPtr("testString")
				checkVPNGatewayConnectionsLocalCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				checkVPNGatewayConnectionsLocalCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.CheckVPNGatewayConnectionsLocalCIDR(checkVPNGatewayConnectionsLocalCIDROptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the CheckVPNGatewayConnectionsLocalCIDROptions model with no property values
				checkVPNGatewayConnectionsLocalCIDROptionsModelNew := new(vpcv1.CheckVPNGatewayConnectionsLocalCIDROptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.CheckVPNGatewayConnectionsLocalCIDR(checkVPNGatewayConnectionsLocalCIDROptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`AddVPNGatewayConnectionsLocalCIDR(addVPNGatewayConnectionsLocalCIDROptions *AddVPNGatewayConnectionsLocalCIDROptions)`, func() {
		version := "2024-06-23"
		addVPNGatewayConnectionsLocalCIDRPath := "/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addVPNGatewayConnectionsLocalCIDRPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(201)
				}))
			})
			It(`Invoke AddVPNGatewayConnectionsLocalCIDR successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.AddVPNGatewayConnectionsLocalCIDR(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the AddVPNGatewayConnectionsLocalCIDROptions model
				addVPNGatewayConnectionsLocalCIDROptionsModel := new(vpcv1.AddVPNGatewayConnectionsLocalCIDROptions)
				addVPNGatewayConnectionsLocalCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				addVPNGatewayConnectionsLocalCIDROptionsModel.ID = core.StringPtr("testString")
				addVPNGatewayConnectionsLocalCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				addVPNGatewayConnectionsLocalCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.AddVPNGatewayConnectionsLocalCIDR(addVPNGatewayConnectionsLocalCIDROptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke AddVPNGatewayConnectionsLocalCIDR with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddVPNGatewayConnectionsLocalCIDROptions model
				addVPNGatewayConnectionsLocalCIDROptionsModel := new(vpcv1.AddVPNGatewayConnectionsLocalCIDROptions)
				addVPNGatewayConnectionsLocalCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				addVPNGatewayConnectionsLocalCIDROptionsModel.ID = core.StringPtr("testString")
				addVPNGatewayConnectionsLocalCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				addVPNGatewayConnectionsLocalCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.AddVPNGatewayConnectionsLocalCIDR(addVPNGatewayConnectionsLocalCIDROptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the AddVPNGatewayConnectionsLocalCIDROptions model with no property values
				addVPNGatewayConnectionsLocalCIDROptionsModelNew := new(vpcv1.AddVPNGatewayConnectionsLocalCIDROptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.AddVPNGatewayConnectionsLocalCIDR(addVPNGatewayConnectionsLocalCIDROptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNGatewayConnectionsPeerCIDRs(listVPNGatewayConnectionsPeerCIDRsOptions *ListVPNGatewayConnectionsPeerCIDRsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVPNGatewayConnectionsPeerCIDRsPath := "/vpn_gateways/testString/connections/testString/peer/cidrs"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayConnectionsPeerCIDRsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVPNGatewayConnectionsPeerCIDRs with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayConnectionsPeerCIDRsOptions model
				listVPNGatewayConnectionsPeerCIDRsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsPeerCIDRsOptions)
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.ID = core.StringPtr("testString")
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVPNGatewayConnectionsPeerCIDRs(listVPNGatewayConnectionsPeerCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVPNGatewayConnectionsPeerCIDRs(listVPNGatewayConnectionsPeerCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNGatewayConnectionsPeerCIDRs(listVPNGatewayConnectionsPeerCIDRsOptions *ListVPNGatewayConnectionsPeerCIDRsOptions)`, func() {
		version := "2024-06-23"
		listVPNGatewayConnectionsPeerCIDRsPath := "/vpn_gateways/testString/connections/testString/peer/cidrs"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayConnectionsPeerCIDRsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cidrs": ["192.0.2.0/24"]}`)
				}))
			})
			It(`Invoke ListVPNGatewayConnectionsPeerCIDRs successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVPNGatewayConnectionsPeerCIDRsOptions model
				listVPNGatewayConnectionsPeerCIDRsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsPeerCIDRsOptions)
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.ID = core.StringPtr("testString")
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVPNGatewayConnectionsPeerCIDRsWithContext(ctx, listVPNGatewayConnectionsPeerCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVPNGatewayConnectionsPeerCIDRs(listVPNGatewayConnectionsPeerCIDRsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVPNGatewayConnectionsPeerCIDRsWithContext(ctx, listVPNGatewayConnectionsPeerCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayConnectionsPeerCIDRsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"cidrs": ["192.0.2.0/24"]}`)
				}))
			})
			It(`Invoke ListVPNGatewayConnectionsPeerCIDRs successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVPNGatewayConnectionsPeerCIDRs(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVPNGatewayConnectionsPeerCIDRsOptions model
				listVPNGatewayConnectionsPeerCIDRsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsPeerCIDRsOptions)
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.ID = core.StringPtr("testString")
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVPNGatewayConnectionsPeerCIDRs(listVPNGatewayConnectionsPeerCIDRsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVPNGatewayConnectionsPeerCIDRs with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayConnectionsPeerCIDRsOptions model
				listVPNGatewayConnectionsPeerCIDRsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsPeerCIDRsOptions)
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.ID = core.StringPtr("testString")
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVPNGatewayConnectionsPeerCIDRs(listVPNGatewayConnectionsPeerCIDRsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListVPNGatewayConnectionsPeerCIDRsOptions model with no property values
				listVPNGatewayConnectionsPeerCIDRsOptionsModelNew := new(vpcv1.ListVPNGatewayConnectionsPeerCIDRsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListVPNGatewayConnectionsPeerCIDRs(listVPNGatewayConnectionsPeerCIDRsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVPNGatewayConnectionsPeerCIDRs successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayConnectionsPeerCIDRsOptions model
				listVPNGatewayConnectionsPeerCIDRsOptionsModel := new(vpcv1.ListVPNGatewayConnectionsPeerCIDRsOptions)
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.ID = core.StringPtr("testString")
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVPNGatewayConnectionsPeerCIDRs(listVPNGatewayConnectionsPeerCIDRsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`RemoveVPNGatewayConnectionsPeerCIDR(removeVPNGatewayConnectionsPeerCIDROptions *RemoveVPNGatewayConnectionsPeerCIDROptions)`, func() {
		version := "2024-06-23"
		removeVPNGatewayConnectionsPeerCIDRPath := "/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(removeVPNGatewayConnectionsPeerCIDRPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke RemoveVPNGatewayConnectionsPeerCIDR successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.RemoveVPNGatewayConnectionsPeerCIDR(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the RemoveVPNGatewayConnectionsPeerCIDROptions model
				removeVPNGatewayConnectionsPeerCIDROptionsModel := new(vpcv1.RemoveVPNGatewayConnectionsPeerCIDROptions)
				removeVPNGatewayConnectionsPeerCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				removeVPNGatewayConnectionsPeerCIDROptionsModel.ID = core.StringPtr("testString")
				removeVPNGatewayConnectionsPeerCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				removeVPNGatewayConnectionsPeerCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.RemoveVPNGatewayConnectionsPeerCIDR(removeVPNGatewayConnectionsPeerCIDROptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke RemoveVPNGatewayConnectionsPeerCIDR with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the RemoveVPNGatewayConnectionsPeerCIDROptions model
				removeVPNGatewayConnectionsPeerCIDROptionsModel := new(vpcv1.RemoveVPNGatewayConnectionsPeerCIDROptions)
				removeVPNGatewayConnectionsPeerCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				removeVPNGatewayConnectionsPeerCIDROptionsModel.ID = core.StringPtr("testString")
				removeVPNGatewayConnectionsPeerCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				removeVPNGatewayConnectionsPeerCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.RemoveVPNGatewayConnectionsPeerCIDR(removeVPNGatewayConnectionsPeerCIDROptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the RemoveVPNGatewayConnectionsPeerCIDROptions model with no property values
				removeVPNGatewayConnectionsPeerCIDROptionsModelNew := new(vpcv1.RemoveVPNGatewayConnectionsPeerCIDROptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.RemoveVPNGatewayConnectionsPeerCIDR(removeVPNGatewayConnectionsPeerCIDROptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CheckVPNGatewayConnectionsPeerCIDR(checkVPNGatewayConnectionsPeerCIDROptions *CheckVPNGatewayConnectionsPeerCIDROptions)`, func() {
		version := "2024-06-23"
		checkVPNGatewayConnectionsPeerCIDRPath := "/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(checkVPNGatewayConnectionsPeerCIDRPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(204)
				}))
			})
			It(`Invoke CheckVPNGatewayConnectionsPeerCIDR successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.CheckVPNGatewayConnectionsPeerCIDR(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the CheckVPNGatewayConnectionsPeerCIDROptions model
				checkVPNGatewayConnectionsPeerCIDROptionsModel := new(vpcv1.CheckVPNGatewayConnectionsPeerCIDROptions)
				checkVPNGatewayConnectionsPeerCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				checkVPNGatewayConnectionsPeerCIDROptionsModel.ID = core.StringPtr("testString")
				checkVPNGatewayConnectionsPeerCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				checkVPNGatewayConnectionsPeerCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.CheckVPNGatewayConnectionsPeerCIDR(checkVPNGatewayConnectionsPeerCIDROptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke CheckVPNGatewayConnectionsPeerCIDR with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CheckVPNGatewayConnectionsPeerCIDROptions model
				checkVPNGatewayConnectionsPeerCIDROptionsModel := new(vpcv1.CheckVPNGatewayConnectionsPeerCIDROptions)
				checkVPNGatewayConnectionsPeerCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				checkVPNGatewayConnectionsPeerCIDROptionsModel.ID = core.StringPtr("testString")
				checkVPNGatewayConnectionsPeerCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				checkVPNGatewayConnectionsPeerCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.CheckVPNGatewayConnectionsPeerCIDR(checkVPNGatewayConnectionsPeerCIDROptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the CheckVPNGatewayConnectionsPeerCIDROptions model with no property values
				checkVPNGatewayConnectionsPeerCIDROptionsModelNew := new(vpcv1.CheckVPNGatewayConnectionsPeerCIDROptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.CheckVPNGatewayConnectionsPeerCIDR(checkVPNGatewayConnectionsPeerCIDROptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`AddVPNGatewayConnectionsPeerCIDR(addVPNGatewayConnectionsPeerCIDROptions *AddVPNGatewayConnectionsPeerCIDROptions)`, func() {
		version := "2024-06-23"
		addVPNGatewayConnectionsPeerCIDRPath := "/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(addVPNGatewayConnectionsPeerCIDRPath))
					Expect(req.Method).To(Equal("PUT"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(201)
				}))
			})
			It(`Invoke AddVPNGatewayConnectionsPeerCIDR successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.AddVPNGatewayConnectionsPeerCIDR(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the AddVPNGatewayConnectionsPeerCIDROptions model
				addVPNGatewayConnectionsPeerCIDROptionsModel := new(vpcv1.AddVPNGatewayConnectionsPeerCIDROptions)
				addVPNGatewayConnectionsPeerCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				addVPNGatewayConnectionsPeerCIDROptionsModel.ID = core.StringPtr("testString")
				addVPNGatewayConnectionsPeerCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				addVPNGatewayConnectionsPeerCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.AddVPNGatewayConnectionsPeerCIDR(addVPNGatewayConnectionsPeerCIDROptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke AddVPNGatewayConnectionsPeerCIDR with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the AddVPNGatewayConnectionsPeerCIDROptions model
				addVPNGatewayConnectionsPeerCIDROptionsModel := new(vpcv1.AddVPNGatewayConnectionsPeerCIDROptions)
				addVPNGatewayConnectionsPeerCIDROptionsModel.VPNGatewayID = core.StringPtr("testString")
				addVPNGatewayConnectionsPeerCIDROptionsModel.ID = core.StringPtr("testString")
				addVPNGatewayConnectionsPeerCIDROptionsModel.CIDR = core.StringPtr("192.168.1.0/24")
				addVPNGatewayConnectionsPeerCIDROptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.AddVPNGatewayConnectionsPeerCIDR(addVPNGatewayConnectionsPeerCIDROptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the AddVPNGatewayConnectionsPeerCIDROptions model with no property values
				addVPNGatewayConnectionsPeerCIDROptionsModelNew := new(vpcv1.AddVPNGatewayConnectionsPeerCIDROptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.AddVPNGatewayConnectionsPeerCIDR(addVPNGatewayConnectionsPeerCIDROptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNGatewayServiceConnections(listVPNGatewayServiceConnectionsOptions *ListVPNGatewayServiceConnectionsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVPNGatewayServiceConnectionsPath := "/vpn_gateways/testString/service_connections"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayServiceConnectionsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVPNGatewayServiceConnections with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayServiceConnectionsOptions model
				listVPNGatewayServiceConnectionsOptionsModel := new(vpcv1.ListVPNGatewayServiceConnectionsOptions)
				listVPNGatewayServiceConnectionsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayServiceConnectionsOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewayServiceConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewayServiceConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVPNGatewayServiceConnections(listVPNGatewayServiceConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVPNGatewayServiceConnections(listVPNGatewayServiceConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNGatewayServiceConnections(listVPNGatewayServiceConnectionsOptions *ListVPNGatewayServiceConnectionsOptions)`, func() {
		version := "2024-06-23"
		listVPNGatewayServiceConnectionsPath := "/vpn_gateways/testString/service_connections"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayServiceConnectionsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "service_connections": [{"created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:transit:dal03:a/aa2432b1fa4d4ace891e9b80fc104e34::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "resource_type": "transit_gateway"}, "id": "0717-64e7e88c-4b28-4082-9ab8-3f95876952ac", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "status": "up", "status_reasons": [{"code": "peer_not_responding", "message": "The connection is down because the peer is not responding.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}]}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPNGatewayServiceConnections successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVPNGatewayServiceConnectionsOptions model
				listVPNGatewayServiceConnectionsOptionsModel := new(vpcv1.ListVPNGatewayServiceConnectionsOptions)
				listVPNGatewayServiceConnectionsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayServiceConnectionsOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewayServiceConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewayServiceConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVPNGatewayServiceConnectionsWithContext(ctx, listVPNGatewayServiceConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVPNGatewayServiceConnections(listVPNGatewayServiceConnectionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVPNGatewayServiceConnectionsWithContext(ctx, listVPNGatewayServiceConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayServiceConnectionsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "service_connections": [{"created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:transit:dal03:a/aa2432b1fa4d4ace891e9b80fc104e34::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "resource_type": "transit_gateway"}, "id": "0717-64e7e88c-4b28-4082-9ab8-3f95876952ac", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "status": "up", "status_reasons": [{"code": "peer_not_responding", "message": "The connection is down because the peer is not responding.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}]}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPNGatewayServiceConnections successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVPNGatewayServiceConnections(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVPNGatewayServiceConnectionsOptions model
				listVPNGatewayServiceConnectionsOptionsModel := new(vpcv1.ListVPNGatewayServiceConnectionsOptions)
				listVPNGatewayServiceConnectionsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayServiceConnectionsOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewayServiceConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewayServiceConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVPNGatewayServiceConnections(listVPNGatewayServiceConnectionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVPNGatewayServiceConnections with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayServiceConnectionsOptions model
				listVPNGatewayServiceConnectionsOptionsModel := new(vpcv1.ListVPNGatewayServiceConnectionsOptions)
				listVPNGatewayServiceConnectionsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayServiceConnectionsOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewayServiceConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewayServiceConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVPNGatewayServiceConnections(listVPNGatewayServiceConnectionsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListVPNGatewayServiceConnectionsOptions model with no property values
				listVPNGatewayServiceConnectionsOptionsModelNew := new(vpcv1.ListVPNGatewayServiceConnectionsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListVPNGatewayServiceConnections(listVPNGatewayServiceConnectionsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVPNGatewayServiceConnections successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNGatewayServiceConnectionsOptions model
				listVPNGatewayServiceConnectionsOptionsModel := new(vpcv1.ListVPNGatewayServiceConnectionsOptions)
				listVPNGatewayServiceConnectionsOptionsModel.VPNGatewayID = core.StringPtr("testString")
				listVPNGatewayServiceConnectionsOptionsModel.Start = core.StringPtr("testString")
				listVPNGatewayServiceConnectionsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNGatewayServiceConnectionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVPNGatewayServiceConnections(listVPNGatewayServiceConnectionsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.VPNGatewayServiceConnectionCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.VPNGatewayServiceConnectionCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.VPNGatewayServiceConnectionCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNGatewayServiceConnectionsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"service_connections":[{"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:transit:dal03:a/aa2432b1fa4d4ace891e9b80fc104e34::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","resource_type":"transit_gateway"},"id":"0717-64e7e88c-4b28-4082-9ab8-3f95876952ac","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","status":"up","status_reasons":[{"code":"peer_not_responding","message":"The connection is down because the peer is not responding.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}]}]}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"service_connections":[{"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:transit:dal03:a/aa2432b1fa4d4ace891e9b80fc104e34::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","resource_type":"transit_gateway"},"id":"0717-64e7e88c-4b28-4082-9ab8-3f95876952ac","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","status":"up","status_reasons":[{"code":"peer_not_responding","message":"The connection is down because the peer is not responding.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}]}]}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VPNGatewayServiceConnectionsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPNGatewayServiceConnectionsOptionsModel := &vpcv1.ListVPNGatewayServiceConnectionsOptions{
					VPNGatewayID: core.StringPtr("testString"),
					Limit:        core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewVPNGatewayServiceConnectionsPager(listVPNGatewayServiceConnectionsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.VPNGatewayServiceConnection
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VPNGatewayServiceConnectionsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPNGatewayServiceConnectionsOptionsModel := &vpcv1.ListVPNGatewayServiceConnectionsOptions{
					VPNGatewayID: core.StringPtr("testString"),
					Limit:        core.Int64Ptr(int64(10)),
				}

				pager, err := vpcService.NewVPNGatewayServiceConnectionsPager(listVPNGatewayServiceConnectionsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`GetVPNGatewayServiceConnection(getVPNGatewayServiceConnectionOptions *GetVPNGatewayServiceConnectionOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPNGatewayServiceConnectionPath := "/vpn_gateways/testString/service_connections/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNGatewayServiceConnectionPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPNGatewayServiceConnection with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNGatewayServiceConnectionOptions model
				getVPNGatewayServiceConnectionOptionsModel := new(vpcv1.GetVPNGatewayServiceConnectionOptions)
				getVPNGatewayServiceConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				getVPNGatewayServiceConnectionOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayServiceConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPNGatewayServiceConnection(getVPNGatewayServiceConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPNGatewayServiceConnection(getVPNGatewayServiceConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPNGatewayServiceConnection(getVPNGatewayServiceConnectionOptions *GetVPNGatewayServiceConnectionOptions)`, func() {
		version := "2024-06-23"
		getVPNGatewayServiceConnectionPath := "/vpn_gateways/testString/service_connections/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNGatewayServiceConnectionPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:transit:dal03:a/aa2432b1fa4d4ace891e9b80fc104e34::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "resource_type": "transit_gateway"}, "id": "0717-64e7e88c-4b28-4082-9ab8-3f95876952ac", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "status": "up", "status_reasons": [{"code": "peer_not_responding", "message": "The connection is down because the peer is not responding.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}]}`)
				}))
			})
			It(`Invoke GetVPNGatewayServiceConnection successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPNGatewayServiceConnectionOptions model
				getVPNGatewayServiceConnectionOptionsModel := new(vpcv1.GetVPNGatewayServiceConnectionOptions)
				getVPNGatewayServiceConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				getVPNGatewayServiceConnectionOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayServiceConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPNGatewayServiceConnectionWithContext(ctx, getVPNGatewayServiceConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPNGatewayServiceConnection(getVPNGatewayServiceConnectionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPNGatewayServiceConnectionWithContext(ctx, getVPNGatewayServiceConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNGatewayServiceConnectionPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:transit:dal03:a/aa2432b1fa4d4ace891e9b80fc104e34::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "resource_type": "transit_gateway"}, "id": "0717-64e7e88c-4b28-4082-9ab8-3f95876952ac", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "status": "up", "status_reasons": [{"code": "peer_not_responding", "message": "The connection is down because the peer is not responding.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}]}`)
				}))
			})
			It(`Invoke GetVPNGatewayServiceConnection successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPNGatewayServiceConnection(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPNGatewayServiceConnectionOptions model
				getVPNGatewayServiceConnectionOptionsModel := new(vpcv1.GetVPNGatewayServiceConnectionOptions)
				getVPNGatewayServiceConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				getVPNGatewayServiceConnectionOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayServiceConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPNGatewayServiceConnection(getVPNGatewayServiceConnectionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPNGatewayServiceConnection with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNGatewayServiceConnectionOptions model
				getVPNGatewayServiceConnectionOptionsModel := new(vpcv1.GetVPNGatewayServiceConnectionOptions)
				getVPNGatewayServiceConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				getVPNGatewayServiceConnectionOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayServiceConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPNGatewayServiceConnection(getVPNGatewayServiceConnectionOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPNGatewayServiceConnectionOptions model with no property values
				getVPNGatewayServiceConnectionOptionsModelNew := new(vpcv1.GetVPNGatewayServiceConnectionOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPNGatewayServiceConnection(getVPNGatewayServiceConnectionOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPNGatewayServiceConnection successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNGatewayServiceConnectionOptions model
				getVPNGatewayServiceConnectionOptionsModel := new(vpcv1.GetVPNGatewayServiceConnectionOptions)
				getVPNGatewayServiceConnectionOptionsModel.VPNGatewayID = core.StringPtr("testString")
				getVPNGatewayServiceConnectionOptionsModel.ID = core.StringPtr("testString")
				getVPNGatewayServiceConnectionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPNGatewayServiceConnection(getVPNGatewayServiceConnectionOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNServers(listVPNServersOptions *ListVPNServersOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVPNServersPath := "/vpn_servers"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNServersPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVPNServers with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNServersOptions model
				listVPNServersOptionsModel := new(vpcv1.ListVPNServersOptions)
				listVPNServersOptionsModel.Name = core.StringPtr("my-name")
				listVPNServersOptionsModel.Start = core.StringPtr("testString")
				listVPNServersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServersOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVPNServersOptionsModel.Sort = core.StringPtr("name")
				listVPNServersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVPNServers(listVPNServersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVPNServers(listVPNServersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNServers(listVPNServersOptions *ListVPNServersOptions)`, func() {
		version := "2024-06-23"
		listVPNServersPath := "/vpn_servers"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNServersPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132, "vpn_servers": [{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server's server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "id": "r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}]}`)
				}))
			})
			It(`Invoke ListVPNServers successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVPNServersOptions model
				listVPNServersOptionsModel := new(vpcv1.ListVPNServersOptions)
				listVPNServersOptionsModel.Name = core.StringPtr("my-name")
				listVPNServersOptionsModel.Start = core.StringPtr("testString")
				listVPNServersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServersOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVPNServersOptionsModel.Sort = core.StringPtr("name")
				listVPNServersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVPNServersWithContext(ctx, listVPNServersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVPNServers(listVPNServersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVPNServersWithContext(ctx, listVPNServersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNServersPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["name"]).To(Equal([]string{"my-name"}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["resource_group.id"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132, "vpn_servers": [{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server's server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "id": "r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}]}`)
				}))
			})
			It(`Invoke ListVPNServers successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVPNServers(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVPNServersOptions model
				listVPNServersOptionsModel := new(vpcv1.ListVPNServersOptions)
				listVPNServersOptionsModel.Name = core.StringPtr("my-name")
				listVPNServersOptionsModel.Start = core.StringPtr("testString")
				listVPNServersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServersOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVPNServersOptionsModel.Sort = core.StringPtr("name")
				listVPNServersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVPNServers(listVPNServersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVPNServers with error: Operation request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNServersOptions model
				listVPNServersOptionsModel := new(vpcv1.ListVPNServersOptions)
				listVPNServersOptionsModel.Name = core.StringPtr("my-name")
				listVPNServersOptionsModel.Start = core.StringPtr("testString")
				listVPNServersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServersOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVPNServersOptionsModel.Sort = core.StringPtr("name")
				listVPNServersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVPNServers(listVPNServersOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVPNServers successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNServersOptions model
				listVPNServersOptionsModel := new(vpcv1.ListVPNServersOptions)
				listVPNServersOptionsModel.Name = core.StringPtr("my-name")
				listVPNServersOptionsModel.Start = core.StringPtr("testString")
				listVPNServersOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServersOptionsModel.ResourceGroupID = core.StringPtr("testString")
				listVPNServersOptionsModel.Sort = core.StringPtr("name")
				listVPNServersOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVPNServers(listVPNServersOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.VPNServerCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.VPNServerCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.VPNServerCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNServersPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server's server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f","id":"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"tcp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server's server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f","id":"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"tcp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VPNServersPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPNServersOptionsModel := &vpcv1.ListVPNServersOptions{
					Name:            core.StringPtr("my-name"),
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					Sort:            core.StringPtr("name"),
				}

				pager, err := vpcService.NewVPNServersPager(listVPNServersOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.VPNServer
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VPNServersPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPNServersOptionsModel := &vpcv1.ListVPNServersOptions{
					Name:            core.StringPtr("my-name"),
					Limit:           core.Int64Ptr(int64(10)),
					ResourceGroupID: core.StringPtr("testString"),
					Sort:            core.StringPtr("name"),
				}

				pager, err := vpcService.NewVPNServersPager(listVPNServersOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateVPNServer(createVPNServerOptions *CreateVPNServerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createVPNServerPath := "/vpn_servers"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPNServerPath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateVPNServer with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the VPNServerAuthenticationByUsernameIDProviderByIam model
				vpnServerAuthenticationByUsernameIDProviderModel := new(vpcv1.VPNServerAuthenticationByUsernameIDProviderByIam)
				vpnServerAuthenticationByUsernameIDProviderModel.ProviderType = core.StringPtr("iam")

				// Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
				vpnServerAuthenticationPrototypeModel := new(vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype)
				vpnServerAuthenticationPrototypeModel.Method = core.StringPtr("username")
				vpnServerAuthenticationPrototypeModel.IdentityProvider = vpnServerAuthenticationByUsernameIDProviderModel

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateVPNServerOptions model
				createVPNServerOptionsModel := new(vpcv1.CreateVPNServerOptions)
				createVPNServerOptionsModel.Certificate = certificateInstanceIdentityModel
				createVPNServerOptionsModel.ClientAuthentication = []vpcv1.VPNServerAuthenticationPrototypeIntf{vpnServerAuthenticationPrototypeModel}
				createVPNServerOptionsModel.ClientIPPool = core.StringPtr("172.16.0.0/16")
				createVPNServerOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createVPNServerOptionsModel.ClientDnsServerIps = []vpcv1.IP{*ipModel}
				createVPNServerOptionsModel.ClientIdleTimeout = core.Int64Ptr(int64(600))
				createVPNServerOptionsModel.EnableSplitTunneling = core.BoolPtr(false)
				createVPNServerOptionsModel.Name = core.StringPtr("my-vpn-server")
				createVPNServerOptionsModel.Port = core.Int64Ptr(int64(443))
				createVPNServerOptionsModel.Protocol = core.StringPtr("udp")
				createVPNServerOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVPNServerOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateVPNServer(createVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateVPNServer(createVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateVPNServer(createVPNServerOptions *CreateVPNServerOptions)`, func() {
		version := "2024-06-23"
		createVPNServerPath := "/vpn_servers"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPNServerPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server's server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "id": "r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateVPNServer successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the VPNServerAuthenticationByUsernameIDProviderByIam model
				vpnServerAuthenticationByUsernameIDProviderModel := new(vpcv1.VPNServerAuthenticationByUsernameIDProviderByIam)
				vpnServerAuthenticationByUsernameIDProviderModel.ProviderType = core.StringPtr("iam")

				// Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
				vpnServerAuthenticationPrototypeModel := new(vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype)
				vpnServerAuthenticationPrototypeModel.Method = core.StringPtr("username")
				vpnServerAuthenticationPrototypeModel.IdentityProvider = vpnServerAuthenticationByUsernameIDProviderModel

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateVPNServerOptions model
				createVPNServerOptionsModel := new(vpcv1.CreateVPNServerOptions)
				createVPNServerOptionsModel.Certificate = certificateInstanceIdentityModel
				createVPNServerOptionsModel.ClientAuthentication = []vpcv1.VPNServerAuthenticationPrototypeIntf{vpnServerAuthenticationPrototypeModel}
				createVPNServerOptionsModel.ClientIPPool = core.StringPtr("172.16.0.0/16")
				createVPNServerOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createVPNServerOptionsModel.ClientDnsServerIps = []vpcv1.IP{*ipModel}
				createVPNServerOptionsModel.ClientIdleTimeout = core.Int64Ptr(int64(600))
				createVPNServerOptionsModel.EnableSplitTunneling = core.BoolPtr(false)
				createVPNServerOptionsModel.Name = core.StringPtr("my-vpn-server")
				createVPNServerOptionsModel.Port = core.Int64Ptr(int64(443))
				createVPNServerOptionsModel.Protocol = core.StringPtr("udp")
				createVPNServerOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVPNServerOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateVPNServerWithContext(ctx, createVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateVPNServer(createVPNServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateVPNServerWithContext(ctx, createVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPNServerPath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server's server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "id": "r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke CreateVPNServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateVPNServer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the VPNServerAuthenticationByUsernameIDProviderByIam model
				vpnServerAuthenticationByUsernameIDProviderModel := new(vpcv1.VPNServerAuthenticationByUsernameIDProviderByIam)
				vpnServerAuthenticationByUsernameIDProviderModel.ProviderType = core.StringPtr("iam")

				// Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
				vpnServerAuthenticationPrototypeModel := new(vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype)
				vpnServerAuthenticationPrototypeModel.Method = core.StringPtr("username")
				vpnServerAuthenticationPrototypeModel.IdentityProvider = vpnServerAuthenticationByUsernameIDProviderModel

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateVPNServerOptions model
				createVPNServerOptionsModel := new(vpcv1.CreateVPNServerOptions)
				createVPNServerOptionsModel.Certificate = certificateInstanceIdentityModel
				createVPNServerOptionsModel.ClientAuthentication = []vpcv1.VPNServerAuthenticationPrototypeIntf{vpnServerAuthenticationPrototypeModel}
				createVPNServerOptionsModel.ClientIPPool = core.StringPtr("172.16.0.0/16")
				createVPNServerOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createVPNServerOptionsModel.ClientDnsServerIps = []vpcv1.IP{*ipModel}
				createVPNServerOptionsModel.ClientIdleTimeout = core.Int64Ptr(int64(600))
				createVPNServerOptionsModel.EnableSplitTunneling = core.BoolPtr(false)
				createVPNServerOptionsModel.Name = core.StringPtr("my-vpn-server")
				createVPNServerOptionsModel.Port = core.Int64Ptr(int64(443))
				createVPNServerOptionsModel.Protocol = core.StringPtr("udp")
				createVPNServerOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVPNServerOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateVPNServer(createVPNServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateVPNServer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the VPNServerAuthenticationByUsernameIDProviderByIam model
				vpnServerAuthenticationByUsernameIDProviderModel := new(vpcv1.VPNServerAuthenticationByUsernameIDProviderByIam)
				vpnServerAuthenticationByUsernameIDProviderModel.ProviderType = core.StringPtr("iam")

				// Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
				vpnServerAuthenticationPrototypeModel := new(vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype)
				vpnServerAuthenticationPrototypeModel.Method = core.StringPtr("username")
				vpnServerAuthenticationPrototypeModel.IdentityProvider = vpnServerAuthenticationByUsernameIDProviderModel

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateVPNServerOptions model
				createVPNServerOptionsModel := new(vpcv1.CreateVPNServerOptions)
				createVPNServerOptionsModel.Certificate = certificateInstanceIdentityModel
				createVPNServerOptionsModel.ClientAuthentication = []vpcv1.VPNServerAuthenticationPrototypeIntf{vpnServerAuthenticationPrototypeModel}
				createVPNServerOptionsModel.ClientIPPool = core.StringPtr("172.16.0.0/16")
				createVPNServerOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createVPNServerOptionsModel.ClientDnsServerIps = []vpcv1.IP{*ipModel}
				createVPNServerOptionsModel.ClientIdleTimeout = core.Int64Ptr(int64(600))
				createVPNServerOptionsModel.EnableSplitTunneling = core.BoolPtr(false)
				createVPNServerOptionsModel.Name = core.StringPtr("my-vpn-server")
				createVPNServerOptionsModel.Port = core.Int64Ptr(int64(443))
				createVPNServerOptionsModel.Protocol = core.StringPtr("udp")
				createVPNServerOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVPNServerOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateVPNServer(createVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateVPNServerOptions model with no property values
				createVPNServerOptionsModelNew := new(vpcv1.CreateVPNServerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateVPNServer(createVPNServerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateVPNServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the VPNServerAuthenticationByUsernameIDProviderByIam model
				vpnServerAuthenticationByUsernameIDProviderModel := new(vpcv1.VPNServerAuthenticationByUsernameIDProviderByIam)
				vpnServerAuthenticationByUsernameIDProviderModel.ProviderType = core.StringPtr("iam")

				// Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
				vpnServerAuthenticationPrototypeModel := new(vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype)
				vpnServerAuthenticationPrototypeModel.Method = core.StringPtr("username")
				vpnServerAuthenticationPrototypeModel.IdentityProvider = vpnServerAuthenticationByUsernameIDProviderModel

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

				// Construct an instance of the CreateVPNServerOptions model
				createVPNServerOptionsModel := new(vpcv1.CreateVPNServerOptions)
				createVPNServerOptionsModel.Certificate = certificateInstanceIdentityModel
				createVPNServerOptionsModel.ClientAuthentication = []vpcv1.VPNServerAuthenticationPrototypeIntf{vpnServerAuthenticationPrototypeModel}
				createVPNServerOptionsModel.ClientIPPool = core.StringPtr("172.16.0.0/16")
				createVPNServerOptionsModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				createVPNServerOptionsModel.ClientDnsServerIps = []vpcv1.IP{*ipModel}
				createVPNServerOptionsModel.ClientIdleTimeout = core.Int64Ptr(int64(600))
				createVPNServerOptionsModel.EnableSplitTunneling = core.BoolPtr(false)
				createVPNServerOptionsModel.Name = core.StringPtr("my-vpn-server")
				createVPNServerOptionsModel.Port = core.Int64Ptr(int64(443))
				createVPNServerOptionsModel.Protocol = core.StringPtr("udp")
				createVPNServerOptionsModel.ResourceGroup = resourceGroupIdentityModel
				createVPNServerOptionsModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				createVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateVPNServer(createVPNServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteVPNServer(deleteVPNServerOptions *DeleteVPNServerOptions)`, func() {
		version := "2024-06-23"
		deleteVPNServerPath := "/vpn_servers/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVPNServerPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteVPNServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteVPNServer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteVPNServerOptions model
				deleteVPNServerOptionsModel := new(vpcv1.DeleteVPNServerOptions)
				deleteVPNServerOptionsModel.ID = core.StringPtr("testString")
				deleteVPNServerOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteVPNServer(deleteVPNServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteVPNServer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVPNServerOptions model
				deleteVPNServerOptionsModel := new(vpcv1.DeleteVPNServerOptions)
				deleteVPNServerOptionsModel.ID = core.StringPtr("testString")
				deleteVPNServerOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteVPNServer(deleteVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteVPNServerOptions model with no property values
				deleteVPNServerOptionsModelNew := new(vpcv1.DeleteVPNServerOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteVPNServer(deleteVPNServerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPNServer(getVPNServerOptions *GetVPNServerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPNServerPath := "/vpn_servers/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNServerPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPNServer with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNServerOptions model
				getVPNServerOptionsModel := new(vpcv1.GetVPNServerOptions)
				getVPNServerOptionsModel.ID = core.StringPtr("testString")
				getVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPNServer(getVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPNServer(getVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPNServer(getVPNServerOptions *GetVPNServerOptions)`, func() {
		version := "2024-06-23"
		getVPNServerPath := "/vpn_servers/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNServerPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server's server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "id": "r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetVPNServer successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPNServerOptions model
				getVPNServerOptionsModel := new(vpcv1.GetVPNServerOptions)
				getVPNServerOptionsModel.ID = core.StringPtr("testString")
				getVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPNServerWithContext(ctx, getVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPNServer(getVPNServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPNServerWithContext(ctx, getVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNServerPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server's server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "id": "r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke GetVPNServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPNServer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPNServerOptions model
				getVPNServerOptionsModel := new(vpcv1.GetVPNServerOptions)
				getVPNServerOptionsModel.ID = core.StringPtr("testString")
				getVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPNServer(getVPNServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPNServer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNServerOptions model
				getVPNServerOptionsModel := new(vpcv1.GetVPNServerOptions)
				getVPNServerOptionsModel.ID = core.StringPtr("testString")
				getVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPNServer(getVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPNServerOptions model with no property values
				getVPNServerOptionsModelNew := new(vpcv1.GetVPNServerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPNServer(getVPNServerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPNServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNServerOptions model
				getVPNServerOptionsModel := new(vpcv1.GetVPNServerOptions)
				getVPNServerOptionsModel.ID = core.StringPtr("testString")
				getVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPNServer(getVPNServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPNServer(updateVPNServerOptions *UpdateVPNServerOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateVPNServerPath := "/vpn_servers/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPNServerPath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateVPNServer with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the VPNServerAuthenticationByUsernameIDProviderByIam model
				vpnServerAuthenticationByUsernameIDProviderModel := new(vpcv1.VPNServerAuthenticationByUsernameIDProviderByIam)
				vpnServerAuthenticationByUsernameIDProviderModel.ProviderType = core.StringPtr("iam")

				// Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
				vpnServerAuthenticationPrototypeModel := new(vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype)
				vpnServerAuthenticationPrototypeModel.Method = core.StringPtr("username")
				vpnServerAuthenticationPrototypeModel.IdentityProvider = vpnServerAuthenticationByUsernameIDProviderModel

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the VPNServerPatch model
				vpnServerPatchModel := new(vpcv1.VPNServerPatch)
				vpnServerPatchModel.Certificate = certificateInstanceIdentityModel
				vpnServerPatchModel.ClientAuthentication = []vpcv1.VPNServerAuthenticationPrototypeIntf{vpnServerAuthenticationPrototypeModel}
				vpnServerPatchModel.ClientDnsServerIps = []vpcv1.IP{*ipModel}
				vpnServerPatchModel.ClientIdleTimeout = core.Int64Ptr(int64(600))
				vpnServerPatchModel.ClientIPPool = core.StringPtr("172.16.0.0/16")
				vpnServerPatchModel.EnableSplitTunneling = core.BoolPtr(true)
				vpnServerPatchModel.Name = core.StringPtr("my-vpn-server-updated")
				vpnServerPatchModel.Port = core.Int64Ptr(int64(443))
				vpnServerPatchModel.Protocol = core.StringPtr("tcp")
				vpnServerPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				vpnServerPatchModelAsPatch, asPatchErr := vpnServerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNServerOptions model
				updateVPNServerOptionsModel := new(vpcv1.UpdateVPNServerOptions)
				updateVPNServerOptionsModel.ID = core.StringPtr("testString")
				updateVPNServerOptionsModel.VPNServerPatch = vpnServerPatchModelAsPatch
				updateVPNServerOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateVPNServer(updateVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateVPNServer(updateVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPNServer(updateVPNServerOptions *UpdateVPNServerOptions)`, func() {
		version := "2024-06-23"
		updateVPNServerPath := "/vpn_servers/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPNServerPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server's server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "id": "r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateVPNServer successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the VPNServerAuthenticationByUsernameIDProviderByIam model
				vpnServerAuthenticationByUsernameIDProviderModel := new(vpcv1.VPNServerAuthenticationByUsernameIDProviderByIam)
				vpnServerAuthenticationByUsernameIDProviderModel.ProviderType = core.StringPtr("iam")

				// Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
				vpnServerAuthenticationPrototypeModel := new(vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype)
				vpnServerAuthenticationPrototypeModel.Method = core.StringPtr("username")
				vpnServerAuthenticationPrototypeModel.IdentityProvider = vpnServerAuthenticationByUsernameIDProviderModel

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the VPNServerPatch model
				vpnServerPatchModel := new(vpcv1.VPNServerPatch)
				vpnServerPatchModel.Certificate = certificateInstanceIdentityModel
				vpnServerPatchModel.ClientAuthentication = []vpcv1.VPNServerAuthenticationPrototypeIntf{vpnServerAuthenticationPrototypeModel}
				vpnServerPatchModel.ClientDnsServerIps = []vpcv1.IP{*ipModel}
				vpnServerPatchModel.ClientIdleTimeout = core.Int64Ptr(int64(600))
				vpnServerPatchModel.ClientIPPool = core.StringPtr("172.16.0.0/16")
				vpnServerPatchModel.EnableSplitTunneling = core.BoolPtr(true)
				vpnServerPatchModel.Name = core.StringPtr("my-vpn-server-updated")
				vpnServerPatchModel.Port = core.Int64Ptr(int64(443))
				vpnServerPatchModel.Protocol = core.StringPtr("tcp")
				vpnServerPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				vpnServerPatchModelAsPatch, asPatchErr := vpnServerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNServerOptions model
				updateVPNServerOptionsModel := new(vpcv1.UpdateVPNServerOptions)
				updateVPNServerOptionsModel.ID = core.StringPtr("testString")
				updateVPNServerOptionsModel.VPNServerPatch = vpnServerPatchModelAsPatch
				updateVPNServerOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateVPNServerWithContext(ctx, updateVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateVPNServer(updateVPNServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateVPNServerWithContext(ctx, updateVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPNServerPath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.Header["If-Match"]).ToNot(BeNil())
					Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server's server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "id": "r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}`)
				}))
			})
			It(`Invoke UpdateVPNServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateVPNServer(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the VPNServerAuthenticationByUsernameIDProviderByIam model
				vpnServerAuthenticationByUsernameIDProviderModel := new(vpcv1.VPNServerAuthenticationByUsernameIDProviderByIam)
				vpnServerAuthenticationByUsernameIDProviderModel.ProviderType = core.StringPtr("iam")

				// Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
				vpnServerAuthenticationPrototypeModel := new(vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype)
				vpnServerAuthenticationPrototypeModel.Method = core.StringPtr("username")
				vpnServerAuthenticationPrototypeModel.IdentityProvider = vpnServerAuthenticationByUsernameIDProviderModel

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the VPNServerPatch model
				vpnServerPatchModel := new(vpcv1.VPNServerPatch)
				vpnServerPatchModel.Certificate = certificateInstanceIdentityModel
				vpnServerPatchModel.ClientAuthentication = []vpcv1.VPNServerAuthenticationPrototypeIntf{vpnServerAuthenticationPrototypeModel}
				vpnServerPatchModel.ClientDnsServerIps = []vpcv1.IP{*ipModel}
				vpnServerPatchModel.ClientIdleTimeout = core.Int64Ptr(int64(600))
				vpnServerPatchModel.ClientIPPool = core.StringPtr("172.16.0.0/16")
				vpnServerPatchModel.EnableSplitTunneling = core.BoolPtr(true)
				vpnServerPatchModel.Name = core.StringPtr("my-vpn-server-updated")
				vpnServerPatchModel.Port = core.Int64Ptr(int64(443))
				vpnServerPatchModel.Protocol = core.StringPtr("tcp")
				vpnServerPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				vpnServerPatchModelAsPatch, asPatchErr := vpnServerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNServerOptions model
				updateVPNServerOptionsModel := new(vpcv1.UpdateVPNServerOptions)
				updateVPNServerOptionsModel.ID = core.StringPtr("testString")
				updateVPNServerOptionsModel.VPNServerPatch = vpnServerPatchModelAsPatch
				updateVPNServerOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateVPNServer(updateVPNServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateVPNServer with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the VPNServerAuthenticationByUsernameIDProviderByIam model
				vpnServerAuthenticationByUsernameIDProviderModel := new(vpcv1.VPNServerAuthenticationByUsernameIDProviderByIam)
				vpnServerAuthenticationByUsernameIDProviderModel.ProviderType = core.StringPtr("iam")

				// Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
				vpnServerAuthenticationPrototypeModel := new(vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype)
				vpnServerAuthenticationPrototypeModel.Method = core.StringPtr("username")
				vpnServerAuthenticationPrototypeModel.IdentityProvider = vpnServerAuthenticationByUsernameIDProviderModel

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the VPNServerPatch model
				vpnServerPatchModel := new(vpcv1.VPNServerPatch)
				vpnServerPatchModel.Certificate = certificateInstanceIdentityModel
				vpnServerPatchModel.ClientAuthentication = []vpcv1.VPNServerAuthenticationPrototypeIntf{vpnServerAuthenticationPrototypeModel}
				vpnServerPatchModel.ClientDnsServerIps = []vpcv1.IP{*ipModel}
				vpnServerPatchModel.ClientIdleTimeout = core.Int64Ptr(int64(600))
				vpnServerPatchModel.ClientIPPool = core.StringPtr("172.16.0.0/16")
				vpnServerPatchModel.EnableSplitTunneling = core.BoolPtr(true)
				vpnServerPatchModel.Name = core.StringPtr("my-vpn-server-updated")
				vpnServerPatchModel.Port = core.Int64Ptr(int64(443))
				vpnServerPatchModel.Protocol = core.StringPtr("tcp")
				vpnServerPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				vpnServerPatchModelAsPatch, asPatchErr := vpnServerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNServerOptions model
				updateVPNServerOptionsModel := new(vpcv1.UpdateVPNServerOptions)
				updateVPNServerOptionsModel.ID = core.StringPtr("testString")
				updateVPNServerOptionsModel.VPNServerPatch = vpnServerPatchModelAsPatch
				updateVPNServerOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateVPNServer(updateVPNServerOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateVPNServerOptions model with no property values
				updateVPNServerOptionsModelNew := new(vpcv1.UpdateVPNServerOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateVPNServer(updateVPNServerOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateVPNServer successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

				// Construct an instance of the VPNServerAuthenticationByUsernameIDProviderByIam model
				vpnServerAuthenticationByUsernameIDProviderModel := new(vpcv1.VPNServerAuthenticationByUsernameIDProviderByIam)
				vpnServerAuthenticationByUsernameIDProviderModel.ProviderType = core.StringPtr("iam")

				// Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
				vpnServerAuthenticationPrototypeModel := new(vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype)
				vpnServerAuthenticationPrototypeModel.Method = core.StringPtr("username")
				vpnServerAuthenticationPrototypeModel.IdentityProvider = vpnServerAuthenticationByUsernameIDProviderModel

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				ipModel.Address = core.StringPtr("192.168.3.4")

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

				// Construct an instance of the VPNServerPatch model
				vpnServerPatchModel := new(vpcv1.VPNServerPatch)
				vpnServerPatchModel.Certificate = certificateInstanceIdentityModel
				vpnServerPatchModel.ClientAuthentication = []vpcv1.VPNServerAuthenticationPrototypeIntf{vpnServerAuthenticationPrototypeModel}
				vpnServerPatchModel.ClientDnsServerIps = []vpcv1.IP{*ipModel}
				vpnServerPatchModel.ClientIdleTimeout = core.Int64Ptr(int64(600))
				vpnServerPatchModel.ClientIPPool = core.StringPtr("172.16.0.0/16")
				vpnServerPatchModel.EnableSplitTunneling = core.BoolPtr(true)
				vpnServerPatchModel.Name = core.StringPtr("my-vpn-server-updated")
				vpnServerPatchModel.Port = core.Int64Ptr(int64(443))
				vpnServerPatchModel.Protocol = core.StringPtr("tcp")
				vpnServerPatchModel.Subnets = []vpcv1.SubnetIdentityIntf{subnetIdentityModel}
				vpnServerPatchModelAsPatch, asPatchErr := vpnServerPatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNServerOptions model
				updateVPNServerOptionsModel := new(vpcv1.UpdateVPNServerOptions)
				updateVPNServerOptionsModel.ID = core.StringPtr("testString")
				updateVPNServerOptionsModel.VPNServerPatch = vpnServerPatchModelAsPatch
				updateVPNServerOptionsModel.IfMatch = core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPNServerOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateVPNServer(updateVPNServerOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPNServerClientConfiguration(getVPNServerClientConfigurationOptions *GetVPNServerClientConfigurationOptions)`, func() {
		version := "2024-06-23"
		getVPNServerClientConfigurationPath := "/vpn_servers/testString/client_configuration"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNServerClientConfigurationPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "text/plain")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `"client\nproto udp\nremote a8506291.us-south.vpn-server.appdomain.cloud\nport 443\n\ndev tun\nnobind\n<ca>\n-----BEGIN CERTIFICATE-----\nxxxxxx\n-----END CERTIFICATE-----\n</ca>"`)
				}))
			})
			It(`Invoke GetVPNServerClientConfiguration successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPNServerClientConfigurationOptions model
				getVPNServerClientConfigurationOptionsModel := new(vpcv1.GetVPNServerClientConfigurationOptions)
				getVPNServerClientConfigurationOptionsModel.ID = core.StringPtr("testString")
				getVPNServerClientConfigurationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPNServerClientConfigurationWithContext(ctx, getVPNServerClientConfigurationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPNServerClientConfiguration(getVPNServerClientConfigurationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPNServerClientConfigurationWithContext(ctx, getVPNServerClientConfigurationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNServerClientConfigurationPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "text/plain")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `"client\nproto udp\nremote a8506291.us-south.vpn-server.appdomain.cloud\nport 443\n\ndev tun\nnobind\n<ca>\n-----BEGIN CERTIFICATE-----\nxxxxxx\n-----END CERTIFICATE-----\n</ca>"`)
				}))
			})
			It(`Invoke GetVPNServerClientConfiguration successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPNServerClientConfiguration(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPNServerClientConfigurationOptions model
				getVPNServerClientConfigurationOptionsModel := new(vpcv1.GetVPNServerClientConfigurationOptions)
				getVPNServerClientConfigurationOptionsModel.ID = core.StringPtr("testString")
				getVPNServerClientConfigurationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPNServerClientConfiguration(getVPNServerClientConfigurationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPNServerClientConfiguration with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNServerClientConfigurationOptions model
				getVPNServerClientConfigurationOptionsModel := new(vpcv1.GetVPNServerClientConfigurationOptions)
				getVPNServerClientConfigurationOptionsModel.ID = core.StringPtr("testString")
				getVPNServerClientConfigurationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPNServerClientConfiguration(getVPNServerClientConfigurationOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPNServerClientConfigurationOptions model with no property values
				getVPNServerClientConfigurationOptionsModelNew := new(vpcv1.GetVPNServerClientConfigurationOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPNServerClientConfiguration(getVPNServerClientConfigurationOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPNServerClientConfiguration successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNServerClientConfigurationOptions model
				getVPNServerClientConfigurationOptionsModel := new(vpcv1.GetVPNServerClientConfigurationOptions)
				getVPNServerClientConfigurationOptionsModel.ID = core.StringPtr("testString")
				getVPNServerClientConfigurationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPNServerClientConfiguration(getVPNServerClientConfigurationOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNServerClients(listVPNServerClientsOptions *ListVPNServerClientsOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVPNServerClientsPath := "/vpn_servers/testString/clients"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNServerClientsPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"created_at"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVPNServerClients with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNServerClientsOptions model
				listVPNServerClientsOptionsModel := new(vpcv1.ListVPNServerClientsOptions)
				listVPNServerClientsOptionsModel.VPNServerID = core.StringPtr("testString")
				listVPNServerClientsOptionsModel.Start = core.StringPtr("testString")
				listVPNServerClientsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServerClientsOptionsModel.Sort = core.StringPtr("created_at")
				listVPNServerClientsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVPNServerClients(listVPNServerClientsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVPNServerClients(listVPNServerClientsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNServerClients(listVPNServerClientsOptions *ListVPNServerClientsOptions)`, func() {
		version := "2024-06-23"
		listVPNServerClientsPath := "/vpn_servers/testString/clients"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNServerClientsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"created_at"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"clients": [{"client_ip": {"address": "192.168.3.4"}, "common_name": "CommonName", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6", "id": "r006-b37832e2-7abe-4b20-a292-c70b007569c6", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "Username"}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPNServerClients successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVPNServerClientsOptions model
				listVPNServerClientsOptionsModel := new(vpcv1.ListVPNServerClientsOptions)
				listVPNServerClientsOptionsModel.VPNServerID = core.StringPtr("testString")
				listVPNServerClientsOptionsModel.Start = core.StringPtr("testString")
				listVPNServerClientsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServerClientsOptionsModel.Sort = core.StringPtr("created_at")
				listVPNServerClientsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVPNServerClientsWithContext(ctx, listVPNServerClientsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVPNServerClients(listVPNServerClientsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVPNServerClientsWithContext(ctx, listVPNServerClientsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNServerClientsPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"created_at"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"clients": [{"client_ip": {"address": "192.168.3.4"}, "common_name": "CommonName", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6", "id": "r006-b37832e2-7abe-4b20-a292-c70b007569c6", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "Username"}], "first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPNServerClients successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVPNServerClients(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVPNServerClientsOptions model
				listVPNServerClientsOptionsModel := new(vpcv1.ListVPNServerClientsOptions)
				listVPNServerClientsOptionsModel.VPNServerID = core.StringPtr("testString")
				listVPNServerClientsOptionsModel.Start = core.StringPtr("testString")
				listVPNServerClientsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServerClientsOptionsModel.Sort = core.StringPtr("created_at")
				listVPNServerClientsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVPNServerClients(listVPNServerClientsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVPNServerClients with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNServerClientsOptions model
				listVPNServerClientsOptionsModel := new(vpcv1.ListVPNServerClientsOptions)
				listVPNServerClientsOptionsModel.VPNServerID = core.StringPtr("testString")
				listVPNServerClientsOptionsModel.Start = core.StringPtr("testString")
				listVPNServerClientsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServerClientsOptionsModel.Sort = core.StringPtr("created_at")
				listVPNServerClientsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVPNServerClients(listVPNServerClientsOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListVPNServerClientsOptions model with no property values
				listVPNServerClientsOptionsModelNew := new(vpcv1.ListVPNServerClientsOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListVPNServerClients(listVPNServerClientsOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVPNServerClients successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNServerClientsOptions model
				listVPNServerClientsOptionsModel := new(vpcv1.ListVPNServerClientsOptions)
				listVPNServerClientsOptionsModel.VPNServerID = core.StringPtr("testString")
				listVPNServerClientsOptionsModel.Start = core.StringPtr("testString")
				listVPNServerClientsOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServerClientsOptionsModel.Sort = core.StringPtr("created_at")
				listVPNServerClientsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVPNServerClients(listVPNServerClientsOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.VPNServerClientCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.VPNServerClientCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.VPNServerClientCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNServerClientsPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"CommonName","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6","id":"r006-b37832e2-7abe-4b20-a292-c70b007569c6","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"Username"}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"CommonName","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6","id":"r006-b37832e2-7abe-4b20-a292-c70b007569c6","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"Username"}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VPNServerClientsPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPNServerClientsOptionsModel := &vpcv1.ListVPNServerClientsOptions{
					VPNServerID: core.StringPtr("testString"),
					Limit:       core.Int64Ptr(int64(10)),
					Sort:        core.StringPtr("created_at"),
				}

				pager, err := vpcService.NewVPNServerClientsPager(listVPNServerClientsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.VPNServerClient
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VPNServerClientsPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPNServerClientsOptionsModel := &vpcv1.ListVPNServerClientsOptions{
					VPNServerID: core.StringPtr("testString"),
					Limit:       core.Int64Ptr(int64(10)),
					Sort:        core.StringPtr("created_at"),
				}

				pager, err := vpcService.NewVPNServerClientsPager(listVPNServerClientsOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`DeleteVPNServerClient(deleteVPNServerClientOptions *DeleteVPNServerClientOptions)`, func() {
		version := "2024-06-23"
		deleteVPNServerClientPath := "/vpn_servers/testString/clients/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVPNServerClientPath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteVPNServerClient successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteVPNServerClient(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteVPNServerClientOptions model
				deleteVPNServerClientOptionsModel := new(vpcv1.DeleteVPNServerClientOptions)
				deleteVPNServerClientOptionsModel.VPNServerID = core.StringPtr("testString")
				deleteVPNServerClientOptionsModel.ID = core.StringPtr("testString")
				deleteVPNServerClientOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteVPNServerClient(deleteVPNServerClientOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteVPNServerClient with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVPNServerClientOptions model
				deleteVPNServerClientOptionsModel := new(vpcv1.DeleteVPNServerClientOptions)
				deleteVPNServerClientOptionsModel.VPNServerID = core.StringPtr("testString")
				deleteVPNServerClientOptionsModel.ID = core.StringPtr("testString")
				deleteVPNServerClientOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteVPNServerClient(deleteVPNServerClientOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteVPNServerClientOptions model with no property values
				deleteVPNServerClientOptionsModelNew := new(vpcv1.DeleteVPNServerClientOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteVPNServerClient(deleteVPNServerClientOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPNServerClient(getVPNServerClientOptions *GetVPNServerClientOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPNServerClientPath := "/vpn_servers/testString/clients/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNServerClientPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPNServerClient with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNServerClientOptions model
				getVPNServerClientOptionsModel := new(vpcv1.GetVPNServerClientOptions)
				getVPNServerClientOptionsModel.VPNServerID = core.StringPtr("testString")
				getVPNServerClientOptionsModel.ID = core.StringPtr("testString")
				getVPNServerClientOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPNServerClient(getVPNServerClientOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPNServerClient(getVPNServerClientOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPNServerClient(getVPNServerClientOptions *GetVPNServerClientOptions)`, func() {
		version := "2024-06-23"
		getVPNServerClientPath := "/vpn_servers/testString/clients/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNServerClientPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"client_ip": {"address": "192.168.3.4"}, "common_name": "CommonName", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6", "id": "r006-b37832e2-7abe-4b20-a292-c70b007569c6", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "Username"}`)
				}))
			})
			It(`Invoke GetVPNServerClient successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPNServerClientOptions model
				getVPNServerClientOptionsModel := new(vpcv1.GetVPNServerClientOptions)
				getVPNServerClientOptionsModel.VPNServerID = core.StringPtr("testString")
				getVPNServerClientOptionsModel.ID = core.StringPtr("testString")
				getVPNServerClientOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPNServerClientWithContext(ctx, getVPNServerClientOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPNServerClient(getVPNServerClientOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPNServerClientWithContext(ctx, getVPNServerClientOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNServerClientPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"client_ip": {"address": "192.168.3.4"}, "common_name": "CommonName", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6", "id": "r006-b37832e2-7abe-4b20-a292-c70b007569c6", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "Username"}`)
				}))
			})
			It(`Invoke GetVPNServerClient successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPNServerClient(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPNServerClientOptions model
				getVPNServerClientOptionsModel := new(vpcv1.GetVPNServerClientOptions)
				getVPNServerClientOptionsModel.VPNServerID = core.StringPtr("testString")
				getVPNServerClientOptionsModel.ID = core.StringPtr("testString")
				getVPNServerClientOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPNServerClient(getVPNServerClientOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPNServerClient with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNServerClientOptions model
				getVPNServerClientOptionsModel := new(vpcv1.GetVPNServerClientOptions)
				getVPNServerClientOptionsModel.VPNServerID = core.StringPtr("testString")
				getVPNServerClientOptionsModel.ID = core.StringPtr("testString")
				getVPNServerClientOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPNServerClient(getVPNServerClientOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPNServerClientOptions model with no property values
				getVPNServerClientOptionsModelNew := new(vpcv1.GetVPNServerClientOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPNServerClient(getVPNServerClientOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPNServerClient successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNServerClientOptions model
				getVPNServerClientOptionsModel := new(vpcv1.GetVPNServerClientOptions)
				getVPNServerClientOptionsModel.VPNServerID = core.StringPtr("testString")
				getVPNServerClientOptionsModel.ID = core.StringPtr("testString")
				getVPNServerClientOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPNServerClient(getVPNServerClientOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DisconnectVPNClient(disconnectVPNClientOptions *DisconnectVPNClientOptions)`, func() {
		version := "2024-06-23"
		disconnectVPNClientPath := "/vpn_servers/testString/clients/testString/disconnect"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(disconnectVPNClientPath))
					Expect(req.Method).To(Equal("POST"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DisconnectVPNClient successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DisconnectVPNClient(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DisconnectVPNClientOptions model
				disconnectVPNClientOptionsModel := new(vpcv1.DisconnectVPNClientOptions)
				disconnectVPNClientOptionsModel.VPNServerID = core.StringPtr("testString")
				disconnectVPNClientOptionsModel.ID = core.StringPtr("testString")
				disconnectVPNClientOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DisconnectVPNClient(disconnectVPNClientOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DisconnectVPNClient with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DisconnectVPNClientOptions model
				disconnectVPNClientOptionsModel := new(vpcv1.DisconnectVPNClientOptions)
				disconnectVPNClientOptionsModel.VPNServerID = core.StringPtr("testString")
				disconnectVPNClientOptionsModel.ID = core.StringPtr("testString")
				disconnectVPNClientOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DisconnectVPNClient(disconnectVPNClientOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DisconnectVPNClientOptions model with no property values
				disconnectVPNClientOptionsModelNew := new(vpcv1.DisconnectVPNClientOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DisconnectVPNClient(disconnectVPNClientOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNServerRoutes(listVPNServerRoutesOptions *ListVPNServerRoutesOptions) - Operation response error`, func() {
		version := "2024-06-23"
		listVPNServerRoutesPath := "/vpn_servers/testString/routes"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNServerRoutesPath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke ListVPNServerRoutes with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNServerRoutesOptions model
				listVPNServerRoutesOptionsModel := new(vpcv1.ListVPNServerRoutesOptions)
				listVPNServerRoutesOptionsModel.VPNServerID = core.StringPtr("testString")
				listVPNServerRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPNServerRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServerRoutesOptionsModel.Sort = core.StringPtr("name")
				listVPNServerRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.ListVPNServerRoutes(listVPNServerRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.ListVPNServerRoutes(listVPNServerRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`ListVPNServerRoutes(listVPNServerRoutesOptions *ListVPNServerRoutesOptions)`, func() {
		version := "2024-06-23"
		listVPNServerRoutesPath := "/vpn_servers/testString/routes"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNServerRoutesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "routes": [{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPNServerRoutes successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the ListVPNServerRoutesOptions model
				listVPNServerRoutesOptionsModel := new(vpcv1.ListVPNServerRoutesOptions)
				listVPNServerRoutesOptionsModel.VPNServerID = core.StringPtr("testString")
				listVPNServerRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPNServerRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServerRoutesOptionsModel.Sort = core.StringPtr("name")
				listVPNServerRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.ListVPNServerRoutesWithContext(ctx, listVPNServerRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.ListVPNServerRoutes(listVPNServerRoutesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.ListVPNServerRoutesWithContext(ctx, listVPNServerRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNServerRoutesPath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"}))
					Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))}))
					Expect(req.URL.Query()["sort"]).To(Equal([]string{"name"}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"first": {"href": "Href"}, "limit": 20, "next": {"href": "Href"}, "routes": [{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}], "total_count": 132}`)
				}))
			})
			It(`Invoke ListVPNServerRoutes successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.ListVPNServerRoutes(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the ListVPNServerRoutesOptions model
				listVPNServerRoutesOptionsModel := new(vpcv1.ListVPNServerRoutesOptions)
				listVPNServerRoutesOptionsModel.VPNServerID = core.StringPtr("testString")
				listVPNServerRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPNServerRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServerRoutesOptionsModel.Sort = core.StringPtr("name")
				listVPNServerRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.ListVPNServerRoutes(listVPNServerRoutesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke ListVPNServerRoutes with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNServerRoutesOptions model
				listVPNServerRoutesOptionsModel := new(vpcv1.ListVPNServerRoutesOptions)
				listVPNServerRoutesOptionsModel.VPNServerID = core.StringPtr("testString")
				listVPNServerRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPNServerRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServerRoutesOptionsModel.Sort = core.StringPtr("name")
				listVPNServerRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.ListVPNServerRoutes(listVPNServerRoutesOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the ListVPNServerRoutesOptions model with no property values
				listVPNServerRoutesOptionsModelNew := new(vpcv1.ListVPNServerRoutesOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.ListVPNServerRoutes(listVPNServerRoutesOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke ListVPNServerRoutes successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the ListVPNServerRoutesOptions model
				listVPNServerRoutesOptionsModel := new(vpcv1.ListVPNServerRoutesOptions)
				listVPNServerRoutesOptionsModel.VPNServerID = core.StringPtr("testString")
				listVPNServerRoutesOptionsModel.Start = core.StringPtr("testString")
				listVPNServerRoutesOptionsModel.Limit = core.Int64Ptr(int64(10))
				listVPNServerRoutesOptionsModel.Sort = core.StringPtr("name")
				listVPNServerRoutesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.ListVPNServerRoutes(listVPNServerRoutesOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Test pagination helper method on response`, func() {
			It(`Invoke GetNextStart successfully`, func() {
				responseObject := new(vpcv1.VPNServerRouteCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com?start=abc-123")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(Equal(core.StringPtr("abc-123")))
			})
			It(`Invoke GetNextStart without a "Next" property in the response`, func() {
				responseObject := new(vpcv1.VPNServerRouteCollection)

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
			It(`Invoke GetNextStart without any query params in the "Next" URL`, func() {
				responseObject := new(vpcv1.VPNServerRouteCollection)
				nextObject := new(vpcv1.PageLink)
				nextObject.Href = core.StringPtr("ibm.com")
				responseObject.Next = nextObject

				value, err := responseObject.GetNextStart()
				Expect(err).To(BeNil())
				Expect(value).To(BeNil())
			})
		})
		Context(`Using mock server endpoint - paginated response`, func() {
			BeforeEach(func() {
				var requestNumber int = 0
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(listVPNServerRoutesPath))
					Expect(req.Method).To(Equal("GET"))

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					requestNumber++
					if requestNumber == 1 {
						fmt.Fprintf(res, "%s", `{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}`)
					} else if requestNumber == 2 {
						fmt.Fprintf(res, "%s", `{"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}`)
					} else {
						res.WriteHeader(400)
					}
				}))
			})
			It(`Use VPNServerRoutesPager.GetNext successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPNServerRoutesOptionsModel := &vpcv1.ListVPNServerRoutesOptions{
					VPNServerID: core.StringPtr("testString"),
					Limit:       core.Int64Ptr(int64(10)),
					Sort:        core.StringPtr("name"),
				}

				pager, err := vpcService.NewVPNServerRoutesPager(listVPNServerRoutesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				var allResults []vpcv1.VPNServerRoute
				for pager.HasNext() {
					nextPage, err := pager.GetNext()
					Expect(err).To(BeNil())
					Expect(nextPage).ToNot(BeNil())
					allResults = append(allResults, nextPage...)
				}
				Expect(len(allResults)).To(Equal(2))
			})
			It(`Use VPNServerRoutesPager.GetAll successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				listVPNServerRoutesOptionsModel := &vpcv1.ListVPNServerRoutesOptions{
					VPNServerID: core.StringPtr("testString"),
					Limit:       core.Int64Ptr(int64(10)),
					Sort:        core.StringPtr("name"),
				}

				pager, err := vpcService.NewVPNServerRoutesPager(listVPNServerRoutesOptionsModel)
				Expect(err).To(BeNil())
				Expect(pager).ToNot(BeNil())

				allResults, err := pager.GetAll()
				Expect(err).To(BeNil())
				Expect(allResults).ToNot(BeNil())
				Expect(len(allResults)).To(Equal(2))
			})
		})
	})
	Describe(`CreateVPNServerRoute(createVPNServerRouteOptions *CreateVPNServerRouteOptions) - Operation response error`, func() {
		version := "2024-06-23"
		createVPNServerRoutePath := "/vpn_servers/testString/routes"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPNServerRoutePath))
					Expect(req.Method).To(Equal("POST"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke CreateVPNServerRoute with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateVPNServerRouteOptions model
				createVPNServerRouteOptionsModel := new(vpcv1.CreateVPNServerRouteOptions)
				createVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				createVPNServerRouteOptionsModel.Destination = core.StringPtr("172.16.0.0/16")
				createVPNServerRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPNServerRouteOptionsModel.Name = core.StringPtr("my-vpn-route-2")
				createVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.CreateVPNServerRoute(createVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.CreateVPNServerRoute(createVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`CreateVPNServerRoute(createVPNServerRouteOptions *CreateVPNServerRouteOptions)`, func() {
		version := "2024-06-23"
		createVPNServerRoutePath := "/vpn_servers/testString/routes"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPNServerRoutePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}`)
				}))
			})
			It(`Invoke CreateVPNServerRoute successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the CreateVPNServerRouteOptions model
				createVPNServerRouteOptionsModel := new(vpcv1.CreateVPNServerRouteOptions)
				createVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				createVPNServerRouteOptionsModel.Destination = core.StringPtr("172.16.0.0/16")
				createVPNServerRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPNServerRouteOptionsModel.Name = core.StringPtr("my-vpn-route-2")
				createVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.CreateVPNServerRouteWithContext(ctx, createVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.CreateVPNServerRoute(createVPNServerRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.CreateVPNServerRouteWithContext(ctx, createVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(createVPNServerRoutePath))
					Expect(req.Method).To(Equal("POST"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(201)
					fmt.Fprintf(res, "%s", `{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}`)
				}))
			})
			It(`Invoke CreateVPNServerRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.CreateVPNServerRoute(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the CreateVPNServerRouteOptions model
				createVPNServerRouteOptionsModel := new(vpcv1.CreateVPNServerRouteOptions)
				createVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				createVPNServerRouteOptionsModel.Destination = core.StringPtr("172.16.0.0/16")
				createVPNServerRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPNServerRouteOptionsModel.Name = core.StringPtr("my-vpn-route-2")
				createVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.CreateVPNServerRoute(createVPNServerRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke CreateVPNServerRoute with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateVPNServerRouteOptions model
				createVPNServerRouteOptionsModel := new(vpcv1.CreateVPNServerRouteOptions)
				createVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				createVPNServerRouteOptionsModel.Destination = core.StringPtr("172.16.0.0/16")
				createVPNServerRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPNServerRouteOptionsModel.Name = core.StringPtr("my-vpn-route-2")
				createVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.CreateVPNServerRoute(createVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the CreateVPNServerRouteOptions model with no property values
				createVPNServerRouteOptionsModelNew := new(vpcv1.CreateVPNServerRouteOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.CreateVPNServerRoute(createVPNServerRouteOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(201)
				}))
			})
			It(`Invoke CreateVPNServerRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the CreateVPNServerRouteOptions model
				createVPNServerRouteOptionsModel := new(vpcv1.CreateVPNServerRouteOptions)
				createVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				createVPNServerRouteOptionsModel.Destination = core.StringPtr("172.16.0.0/16")
				createVPNServerRouteOptionsModel.Action = core.StringPtr("deliver")
				createVPNServerRouteOptionsModel.Name = core.StringPtr("my-vpn-route-2")
				createVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.CreateVPNServerRoute(createVPNServerRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`DeleteVPNServerRoute(deleteVPNServerRouteOptions *DeleteVPNServerRouteOptions)`, func() {
		version := "2024-06-23"
		deleteVPNServerRoutePath := "/vpn_servers/testString/routes/testString"
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(deleteVPNServerRoutePath))
					Expect(req.Method).To(Equal("DELETE"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.WriteHeader(202)
				}))
			})
			It(`Invoke DeleteVPNServerRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				response, operationErr := vpcService.DeleteVPNServerRoute(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())

				// Construct an instance of the DeleteVPNServerRouteOptions model
				deleteVPNServerRouteOptionsModel := new(vpcv1.DeleteVPNServerRouteOptions)
				deleteVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				deleteVPNServerRouteOptionsModel.ID = core.StringPtr("testString")
				deleteVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				response, operationErr = vpcService.DeleteVPNServerRoute(deleteVPNServerRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
			})
			It(`Invoke DeleteVPNServerRoute with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the DeleteVPNServerRouteOptions model
				deleteVPNServerRouteOptionsModel := new(vpcv1.DeleteVPNServerRouteOptions)
				deleteVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				deleteVPNServerRouteOptionsModel.ID = core.StringPtr("testString")
				deleteVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				response, operationErr := vpcService.DeleteVPNServerRoute(deleteVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				// Construct a second instance of the DeleteVPNServerRouteOptions model with no property values
				deleteVPNServerRouteOptionsModelNew := new(vpcv1.DeleteVPNServerRouteOptions)
				// Invoke operation with invalid model (negative test)
				response, operationErr = vpcService.DeleteVPNServerRoute(deleteVPNServerRouteOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPNServerRoute(getVPNServerRouteOptions *GetVPNServerRouteOptions) - Operation response error`, func() {
		version := "2024-06-23"
		getVPNServerRoutePath := "/vpn_servers/testString/routes/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNServerRoutePath))
					Expect(req.Method).To(Equal("GET"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke GetVPNServerRoute with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNServerRouteOptions model
				getVPNServerRouteOptionsModel := new(vpcv1.GetVPNServerRouteOptions)
				getVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				getVPNServerRouteOptionsModel.ID = core.StringPtr("testString")
				getVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.GetVPNServerRoute(getVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.GetVPNServerRoute(getVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`GetVPNServerRoute(getVPNServerRouteOptions *GetVPNServerRouteOptions)`, func() {
		version := "2024-06-23"
		getVPNServerRoutePath := "/vpn_servers/testString/routes/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNServerRoutePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}`)
				}))
			})
			It(`Invoke GetVPNServerRoute successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the GetVPNServerRouteOptions model
				getVPNServerRouteOptionsModel := new(vpcv1.GetVPNServerRouteOptions)
				getVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				getVPNServerRouteOptionsModel.ID = core.StringPtr("testString")
				getVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.GetVPNServerRouteWithContext(ctx, getVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.GetVPNServerRoute(getVPNServerRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.GetVPNServerRouteWithContext(ctx, getVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(getVPNServerRoutePath))
					Expect(req.Method).To(Equal("GET"))

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}`)
				}))
			})
			It(`Invoke GetVPNServerRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.GetVPNServerRoute(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the GetVPNServerRouteOptions model
				getVPNServerRouteOptionsModel := new(vpcv1.GetVPNServerRouteOptions)
				getVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				getVPNServerRouteOptionsModel.ID = core.StringPtr("testString")
				getVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.GetVPNServerRoute(getVPNServerRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke GetVPNServerRoute with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNServerRouteOptions model
				getVPNServerRouteOptionsModel := new(vpcv1.GetVPNServerRouteOptions)
				getVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				getVPNServerRouteOptionsModel.ID = core.StringPtr("testString")
				getVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.GetVPNServerRoute(getVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the GetVPNServerRouteOptions model with no property values
				getVPNServerRouteOptionsModelNew := new(vpcv1.GetVPNServerRouteOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.GetVPNServerRoute(getVPNServerRouteOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke GetVPNServerRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the GetVPNServerRouteOptions model
				getVPNServerRouteOptionsModel := new(vpcv1.GetVPNServerRouteOptions)
				getVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				getVPNServerRouteOptionsModel.ID = core.StringPtr("testString")
				getVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.GetVPNServerRoute(getVPNServerRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPNServerRoute(updateVPNServerRouteOptions *UpdateVPNServerRouteOptions) - Operation response error`, func() {
		version := "2024-06-23"
		updateVPNServerRoutePath := "/vpn_servers/testString/routes/testString"
		Context(`Using mock server endpoint with invalid JSON response`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPNServerRoutePath))
					Expect(req.Method).To(Equal("PATCH"))
					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprint(res, `} this is not valid json {`)
				}))
			})
			It(`Invoke UpdateVPNServerRoute with error: Operation response processing error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPNServerRoutePatch model
				vpnServerRoutePatchModel := new(vpcv1.VPNServerRoutePatch)
				vpnServerRoutePatchModel.Name = core.StringPtr("my-vpn-server-route-updated")
				vpnServerRoutePatchModelAsPatch, asPatchErr := vpnServerRoutePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNServerRouteOptions model
				updateVPNServerRouteOptionsModel := new(vpcv1.UpdateVPNServerRouteOptions)
				updateVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				updateVPNServerRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPNServerRouteOptionsModel.VPNServerRoutePatch = vpnServerRoutePatchModelAsPatch
				updateVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Expect response parsing to fail since we are receiving a text/plain response
				result, response, operationErr := vpcService.UpdateVPNServerRoute(updateVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())

				// Enable retries and test again
				vpcService.EnableRetries(0, 0)
				result, response, operationErr = vpcService.UpdateVPNServerRoute(updateVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`UpdateVPNServerRoute(updateVPNServerRouteOptions *UpdateVPNServerRouteOptions)`, func() {
		version := "2024-06-23"
		updateVPNServerRoutePath := "/vpn_servers/testString/routes/testString"
		Context(`Using mock server endpoint with timeout`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPNServerRoutePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Sleep a short time to support a timeout test
					time.Sleep(100 * time.Millisecond)

					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}`)
				}))
			})
			It(`Invoke UpdateVPNServerRoute successfully with retries`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())
				vpcService.EnableRetries(0, 0)

				// Construct an instance of the VPNServerRoutePatch model
				vpnServerRoutePatchModel := new(vpcv1.VPNServerRoutePatch)
				vpnServerRoutePatchModel.Name = core.StringPtr("my-vpn-server-route-updated")
				vpnServerRoutePatchModelAsPatch, asPatchErr := vpnServerRoutePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNServerRouteOptions model
				updateVPNServerRouteOptionsModel := new(vpcv1.UpdateVPNServerRouteOptions)
				updateVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				updateVPNServerRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPNServerRouteOptionsModel.VPNServerRoutePatch = vpnServerRoutePatchModelAsPatch
				updateVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with a Context to test a timeout error
				ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc()
				_, _, operationErr := vpcService.UpdateVPNServerRouteWithContext(ctx, updateVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))

				// Disable retries and test again
				vpcService.DisableRetries()
				result, response, operationErr := vpcService.UpdateVPNServerRoute(updateVPNServerRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

				// Re-test the timeout error with retries disabled
				ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond)
				defer cancelFunc2()
				_, _, operationErr = vpcService.UpdateVPNServerRouteWithContext(ctx, updateVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded"))
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Verify the contents of the request
					Expect(req.URL.EscapedPath()).To(Equal(updateVPNServerRoutePath))
					Expect(req.Method).To(Equal("PATCH"))

					// For gzip-disabled operation, verify Content-Encoding is not set.
					Expect(req.Header.Get("Content-Encoding")).To(BeEmpty())

					// If there is a body, then make sure we can read it
					bodyBuf := new(bytes.Buffer)
					if req.Header.Get("Content-Encoding") == "gzip" {
						body, err := core.NewGzipDecompressionReader(req.Body)
						Expect(err).To(BeNil())
						_, err = bodyBuf.ReadFrom(body)
						Expect(err).To(BeNil())
					} else {
						_, err := bodyBuf.ReadFrom(req.Body)
						Expect(err).To(BeNil())
					}
					fmt.Fprintf(GinkgoWriter, "  Request body: %s", bodyBuf.String())

					Expect(req.URL.Query()["version"]).To(Equal([]string{"2024-06-23"}))
					Expect(req.URL.Query()["generation"]).To(Equal([]string{fmt.Sprint(int64(2))}))
					// Set mock response
					res.Header().Set("Content-type", "application/json")
					res.WriteHeader(200)
					fmt.Fprintf(res, "%s", `{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}`)
				}))
			})
			It(`Invoke UpdateVPNServerRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Invoke operation with nil options model (negative test)
				result, response, operationErr := vpcService.UpdateVPNServerRoute(nil)
				Expect(operationErr).NotTo(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())

				// Construct an instance of the VPNServerRoutePatch model
				vpnServerRoutePatchModel := new(vpcv1.VPNServerRoutePatch)
				vpnServerRoutePatchModel.Name = core.StringPtr("my-vpn-server-route-updated")
				vpnServerRoutePatchModelAsPatch, asPatchErr := vpnServerRoutePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNServerRouteOptions model
				updateVPNServerRouteOptionsModel := new(vpcv1.UpdateVPNServerRouteOptions)
				updateVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				updateVPNServerRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPNServerRouteOptionsModel.VPNServerRoutePatch = vpnServerRoutePatchModelAsPatch
				updateVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation with valid options model (positive test)
				result, response, operationErr = vpcService.UpdateVPNServerRoute(updateVPNServerRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())
				Expect(result).ToNot(BeNil())

			})
			It(`Invoke UpdateVPNServerRoute with error: Operation validation and request error`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPNServerRoutePatch model
				vpnServerRoutePatchModel := new(vpcv1.VPNServerRoutePatch)
				vpnServerRoutePatchModel.Name = core.StringPtr("my-vpn-server-route-updated")
				vpnServerRoutePatchModelAsPatch, asPatchErr := vpnServerRoutePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNServerRouteOptions model
				updateVPNServerRouteOptionsModel := new(vpcv1.UpdateVPNServerRouteOptions)
				updateVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				updateVPNServerRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPNServerRouteOptionsModel.VPNServerRoutePatch = vpnServerRoutePatchModelAsPatch
				updateVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
				// Invoke operation with empty URL (negative test)
				err := vpcService.SetServiceURL("")
				Expect(err).To(BeNil())
				result, response, operationErr := vpcService.UpdateVPNServerRoute(updateVPNServerRouteOptionsModel)
				Expect(operationErr).ToNot(BeNil())
				Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING))
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
				// Construct a second instance of the UpdateVPNServerRouteOptions model with no property values
				updateVPNServerRouteOptionsModelNew := new(vpcv1.UpdateVPNServerRouteOptions)
				// Invoke operation with invalid model (negative test)
				result, response, operationErr = vpcService.UpdateVPNServerRoute(updateVPNServerRouteOptionsModelNew)
				Expect(operationErr).ToNot(BeNil())
				Expect(response).To(BeNil())
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
		Context(`Using mock server endpoint with missing response body`, func() {
			BeforeEach(func() {
				testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
					defer GinkgoRecover()

					// Set success status code with no respoonse body
					res.WriteHeader(200)
				}))
			})
			It(`Invoke UpdateVPNServerRoute successfully`, func() {
				vpcService, serviceErr := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
					URL:           testServer.URL,
					Authenticator: &core.NoAuthAuthenticator{},
					Version:       core.StringPtr(version),
				})
				Expect(serviceErr).To(BeNil())
				Expect(vpcService).ToNot(BeNil())

				// Construct an instance of the VPNServerRoutePatch model
				vpnServerRoutePatchModel := new(vpcv1.VPNServerRoutePatch)
				vpnServerRoutePatchModel.Name = core.StringPtr("my-vpn-server-route-updated")
				vpnServerRoutePatchModelAsPatch, asPatchErr := vpnServerRoutePatchModel.AsPatch()
				Expect(asPatchErr).To(BeNil())

				// Construct an instance of the UpdateVPNServerRouteOptions model
				updateVPNServerRouteOptionsModel := new(vpcv1.UpdateVPNServerRouteOptions)
				updateVPNServerRouteOptionsModel.VPNServerID = core.StringPtr("testString")
				updateVPNServerRouteOptionsModel.ID = core.StringPtr("testString")
				updateVPNServerRouteOptionsModel.VPNServerRoutePatch = vpnServerRoutePatchModelAsPatch
				updateVPNServerRouteOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

				// Invoke operation
				result, response, operationErr := vpcService.UpdateVPNServerRoute(updateVPNServerRouteOptionsModel)
				Expect(operationErr).To(BeNil())
				Expect(response).ToNot(BeNil())

				// Verify a nil result
				Expect(result).To(BeNil())
			})
			AfterEach(func() {
				testServer.Close()
			})
		})
	})
	Describe(`Model constructor tests`, func() {
		Context(`Using a service client instance`, func() {
			version := "2024-06-23"
			vpcService, _ := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{
				URL:           "http://vpcv1modelgenerator.com",
				Authenticator: &core.NoAuthAuthenticator{},
				Version:       core.StringPtr(version),
			})
			It(`Invoke NewActivateReservationOptions successfully`, func() {
				// Construct an instance of the ActivateReservationOptions model
				id := "testString"
				activateReservationOptionsModel := vpcService.NewActivateReservationOptions(id)
				activateReservationOptionsModel.SetID("testString")
				activateReservationOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(activateReservationOptionsModel).ToNot(BeNil())
				Expect(activateReservationOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(activateReservationOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewAddBareMetalServerNetworkInterfaceFloatingIPOptions successfully`, func() {
				// Construct an instance of the AddBareMetalServerNetworkInterfaceFloatingIPOptions model
				bareMetalServerID := "testString"
				networkInterfaceID := "testString"
				id := "testString"
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel := vpcService.NewAddBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID, networkInterfaceID, id)
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.SetBareMetalServerID("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.SetNetworkInterfaceID("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.SetID("testString")
				addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(addBareMetalServerNetworkInterfaceFloatingIPOptionsModel).ToNot(BeNil())
				Expect(addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(addBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewAddEndpointGatewayIPOptions successfully`, func() {
				// Construct an instance of the AddEndpointGatewayIPOptions model
				endpointGatewayID := "testString"
				id := "testString"
				addEndpointGatewayIPOptionsModel := vpcService.NewAddEndpointGatewayIPOptions(endpointGatewayID, id)
				addEndpointGatewayIPOptionsModel.SetEndpointGatewayID("testString")
				addEndpointGatewayIPOptionsModel.SetID("testString")
				addEndpointGatewayIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(addEndpointGatewayIPOptionsModel).ToNot(BeNil())
				Expect(addEndpointGatewayIPOptionsModel.EndpointGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(addEndpointGatewayIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(addEndpointGatewayIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewAddInstanceNetworkInterfaceFloatingIPOptions successfully`, func() {
				// Construct an instance of the AddInstanceNetworkInterfaceFloatingIPOptions model
				instanceID := "testString"
				networkInterfaceID := "testString"
				id := "testString"
				addInstanceNetworkInterfaceFloatingIPOptionsModel := vpcService.NewAddInstanceNetworkInterfaceFloatingIPOptions(instanceID, networkInterfaceID, id)
				addInstanceNetworkInterfaceFloatingIPOptionsModel.SetInstanceID("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.SetNetworkInterfaceID("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.SetID("testString")
				addInstanceNetworkInterfaceFloatingIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(addInstanceNetworkInterfaceFloatingIPOptionsModel).ToNot(BeNil())
				Expect(addInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(addInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(addInstanceNetworkInterfaceFloatingIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(addInstanceNetworkInterfaceFloatingIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewAddNetworkInterfaceFloatingIPOptions successfully`, func() {
				// Construct an instance of the AddNetworkInterfaceFloatingIPOptions model
				virtualNetworkInterfaceID := "testString"
				id := "testString"
				addNetworkInterfaceFloatingIPOptionsModel := vpcService.NewAddNetworkInterfaceFloatingIPOptions(virtualNetworkInterfaceID, id)
				addNetworkInterfaceFloatingIPOptionsModel.SetVirtualNetworkInterfaceID("testString")
				addNetworkInterfaceFloatingIPOptionsModel.SetID("testString")
				addNetworkInterfaceFloatingIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(addNetworkInterfaceFloatingIPOptionsModel).ToNot(BeNil())
				Expect(addNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(addNetworkInterfaceFloatingIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(addNetworkInterfaceFloatingIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewAddVirtualNetworkInterfaceIPOptions successfully`, func() {
				// Construct an instance of the AddVirtualNetworkInterfaceIPOptions model
				virtualNetworkInterfaceID := "testString"
				id := "testString"
				addVirtualNetworkInterfaceIPOptionsModel := vpcService.NewAddVirtualNetworkInterfaceIPOptions(virtualNetworkInterfaceID, id)
				addVirtualNetworkInterfaceIPOptionsModel.SetVirtualNetworkInterfaceID("testString")
				addVirtualNetworkInterfaceIPOptionsModel.SetID("testString")
				addVirtualNetworkInterfaceIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(addVirtualNetworkInterfaceIPOptionsModel).ToNot(BeNil())
				Expect(addVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(addVirtualNetworkInterfaceIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(addVirtualNetworkInterfaceIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewAddVPNGatewayAdvertisedCIDROptions successfully`, func() {
				// Construct an instance of the AddVPNGatewayAdvertisedCIDROptions model
				vpnGatewayID := "testString"
				cidr := "192.168.1.0/24"
				addVPNGatewayAdvertisedCIDROptionsModel := vpcService.NewAddVPNGatewayAdvertisedCIDROptions(vpnGatewayID, cidr)
				addVPNGatewayAdvertisedCIDROptionsModel.SetVPNGatewayID("testString")
				addVPNGatewayAdvertisedCIDROptionsModel.SetCIDR("192.168.1.0/24")
				addVPNGatewayAdvertisedCIDROptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(addVPNGatewayAdvertisedCIDROptionsModel).ToNot(BeNil())
				Expect(addVPNGatewayAdvertisedCIDROptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(addVPNGatewayAdvertisedCIDROptionsModel.CIDR).To(Equal(core.StringPtr("192.168.1.0/24")))
				Expect(addVPNGatewayAdvertisedCIDROptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewAddVPNGatewayConnectionsLocalCIDROptions successfully`, func() {
				// Construct an instance of the AddVPNGatewayConnectionsLocalCIDROptions model
				vpnGatewayID := "testString"
				id := "testString"
				cidr := "192.168.1.0/24"
				addVPNGatewayConnectionsLocalCIDROptionsModel := vpcService.NewAddVPNGatewayConnectionsLocalCIDROptions(vpnGatewayID, id, cidr)
				addVPNGatewayConnectionsLocalCIDROptionsModel.SetVPNGatewayID("testString")
				addVPNGatewayConnectionsLocalCIDROptionsModel.SetID("testString")
				addVPNGatewayConnectionsLocalCIDROptionsModel.SetCIDR("192.168.1.0/24")
				addVPNGatewayConnectionsLocalCIDROptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(addVPNGatewayConnectionsLocalCIDROptionsModel).ToNot(BeNil())
				Expect(addVPNGatewayConnectionsLocalCIDROptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(addVPNGatewayConnectionsLocalCIDROptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(addVPNGatewayConnectionsLocalCIDROptionsModel.CIDR).To(Equal(core.StringPtr("192.168.1.0/24")))
				Expect(addVPNGatewayConnectionsLocalCIDROptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewAddVPNGatewayConnectionsPeerCIDROptions successfully`, func() {
				// Construct an instance of the AddVPNGatewayConnectionsPeerCIDROptions model
				vpnGatewayID := "testString"
				id := "testString"
				cidr := "192.168.1.0/24"
				addVPNGatewayConnectionsPeerCIDROptionsModel := vpcService.NewAddVPNGatewayConnectionsPeerCIDROptions(vpnGatewayID, id, cidr)
				addVPNGatewayConnectionsPeerCIDROptionsModel.SetVPNGatewayID("testString")
				addVPNGatewayConnectionsPeerCIDROptionsModel.SetID("testString")
				addVPNGatewayConnectionsPeerCIDROptionsModel.SetCIDR("192.168.1.0/24")
				addVPNGatewayConnectionsPeerCIDROptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(addVPNGatewayConnectionsPeerCIDROptionsModel).ToNot(BeNil())
				Expect(addVPNGatewayConnectionsPeerCIDROptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(addVPNGatewayConnectionsPeerCIDROptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(addVPNGatewayConnectionsPeerCIDROptionsModel.CIDR).To(Equal(core.StringPtr("192.168.1.0/24")))
				Expect(addVPNGatewayConnectionsPeerCIDROptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewBackupPolicyPlanClonePolicyPrototype successfully`, func() {
				zones := []vpcv1.ZoneIdentityIntf{}
				_model, err := vpcService.NewBackupPolicyPlanClonePolicyPrototype(zones)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewBackupPolicyPlanPrototype successfully`, func() {
				cronSpec := "30 */2 * * 1-5"
				_model, err := vpcService.NewBackupPolicyPlanPrototype(cronSpec)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewBackupPolicyPlanRemoteRegionPolicyPrototype successfully`, func() {
				var region vpcv1.RegionIdentityIntf = nil
				_, err := vpcService.NewBackupPolicyPlanRemoteRegionPolicyPrototype(region)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewBareMetalServerInitializationDefaultTrustedProfilePrototype successfully`, func() {
				var target vpcv1.TrustedProfileIdentityIntf = nil
				_, err := vpcService.NewBareMetalServerInitializationDefaultTrustedProfilePrototype(target)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewBareMetalServerInitializationPrototype successfully`, func() {
				var image vpcv1.ImageIdentityIntf = nil
				keys := []vpcv1.KeyIdentityIntf{}
				_, err := vpcService.NewBareMetalServerInitializationPrototype(image, keys)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewBareMetalServerPrimaryNetworkInterfacePrototype successfully`, func() {
				var subnet vpcv1.SubnetIdentityIntf = nil
				_, err := vpcService.NewBareMetalServerPrimaryNetworkInterfacePrototype(subnet)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewCheckVPNGatewayAdvertisedCIDROptions successfully`, func() {
				// Construct an instance of the CheckVPNGatewayAdvertisedCIDROptions model
				vpnGatewayID := "testString"
				cidr := "192.168.1.0/24"
				checkVPNGatewayAdvertisedCIDROptionsModel := vpcService.NewCheckVPNGatewayAdvertisedCIDROptions(vpnGatewayID, cidr)
				checkVPNGatewayAdvertisedCIDROptionsModel.SetVPNGatewayID("testString")
				checkVPNGatewayAdvertisedCIDROptionsModel.SetCIDR("192.168.1.0/24")
				checkVPNGatewayAdvertisedCIDROptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(checkVPNGatewayAdvertisedCIDROptionsModel).ToNot(BeNil())
				Expect(checkVPNGatewayAdvertisedCIDROptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(checkVPNGatewayAdvertisedCIDROptionsModel.CIDR).To(Equal(core.StringPtr("192.168.1.0/24")))
				Expect(checkVPNGatewayAdvertisedCIDROptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCheckVPNGatewayConnectionsLocalCIDROptions successfully`, func() {
				// Construct an instance of the CheckVPNGatewayConnectionsLocalCIDROptions model
				vpnGatewayID := "testString"
				id := "testString"
				cidr := "192.168.1.0/24"
				checkVPNGatewayConnectionsLocalCIDROptionsModel := vpcService.NewCheckVPNGatewayConnectionsLocalCIDROptions(vpnGatewayID, id, cidr)
				checkVPNGatewayConnectionsLocalCIDROptionsModel.SetVPNGatewayID("testString")
				checkVPNGatewayConnectionsLocalCIDROptionsModel.SetID("testString")
				checkVPNGatewayConnectionsLocalCIDROptionsModel.SetCIDR("192.168.1.0/24")
				checkVPNGatewayConnectionsLocalCIDROptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(checkVPNGatewayConnectionsLocalCIDROptionsModel).ToNot(BeNil())
				Expect(checkVPNGatewayConnectionsLocalCIDROptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(checkVPNGatewayConnectionsLocalCIDROptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(checkVPNGatewayConnectionsLocalCIDROptionsModel.CIDR).To(Equal(core.StringPtr("192.168.1.0/24")))
				Expect(checkVPNGatewayConnectionsLocalCIDROptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCheckVPNGatewayConnectionsPeerCIDROptions successfully`, func() {
				// Construct an instance of the CheckVPNGatewayConnectionsPeerCIDROptions model
				vpnGatewayID := "testString"
				id := "testString"
				cidr := "192.168.1.0/24"
				checkVPNGatewayConnectionsPeerCIDROptionsModel := vpcService.NewCheckVPNGatewayConnectionsPeerCIDROptions(vpnGatewayID, id, cidr)
				checkVPNGatewayConnectionsPeerCIDROptionsModel.SetVPNGatewayID("testString")
				checkVPNGatewayConnectionsPeerCIDROptionsModel.SetID("testString")
				checkVPNGatewayConnectionsPeerCIDROptionsModel.SetCIDR("192.168.1.0/24")
				checkVPNGatewayConnectionsPeerCIDROptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(checkVPNGatewayConnectionsPeerCIDROptionsModel).ToNot(BeNil())
				Expect(checkVPNGatewayConnectionsPeerCIDROptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(checkVPNGatewayConnectionsPeerCIDROptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(checkVPNGatewayConnectionsPeerCIDROptionsModel.CIDR).To(Equal(core.StringPtr("192.168.1.0/24")))
				Expect(checkVPNGatewayConnectionsPeerCIDROptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateBackupPolicyOptions successfully`, func() {
				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the BackupPolicyPlanClonePolicyPrototype model
				backupPolicyPlanClonePolicyPrototypeModel := new(vpcv1.BackupPolicyPlanClonePolicyPrototype)
				Expect(backupPolicyPlanClonePolicyPrototypeModel).ToNot(BeNil())
				backupPolicyPlanClonePolicyPrototypeModel.MaxSnapshots = core.Int64Ptr(int64(5))
				backupPolicyPlanClonePolicyPrototypeModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}
				Expect(backupPolicyPlanClonePolicyPrototypeModel.MaxSnapshots).To(Equal(core.Int64Ptr(int64(5))))
				Expect(backupPolicyPlanClonePolicyPrototypeModel.Zones).To(Equal([]vpcv1.ZoneIdentityIntf{zoneIdentityModel}))

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model
				backupPolicyPlanDeletionTriggerPrototypeModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPrototype)
				Expect(backupPolicyPlanDeletionTriggerPrototypeModel).ToNot(BeNil())
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(20))
				Expect(backupPolicyPlanDeletionTriggerPrototypeModel.DeleteAfter).To(Equal(core.Int64Ptr(int64(20))))
				Expect(backupPolicyPlanDeletionTriggerPrototypeModel.DeleteOverCount).To(Equal(core.Int64Ptr(int64(20))))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				Expect(encryptionKeyIdentityModel).ToNot(BeNil())
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")
				Expect(encryptionKeyIdentityModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")))

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				Expect(regionIdentityModel).ToNot(BeNil())
				regionIdentityModel.Name = core.StringPtr("us-south")
				Expect(regionIdentityModel.Name).To(Equal(core.StringPtr("us-south")))

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				Expect(backupPolicyPlanRemoteRegionPolicyPrototypeModel).ToNot(BeNil())
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel
				Expect(backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount).To(Equal(core.Int64Ptr(int64(5))))
				Expect(backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey).To(Equal(encryptionKeyIdentityModel))
				Expect(backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region).To(Equal(regionIdentityModel))

				// Construct an instance of the BackupPolicyPlanPrototype model
				backupPolicyPlanPrototypeModel := new(vpcv1.BackupPolicyPlanPrototype)
				Expect(backupPolicyPlanPrototypeModel).ToNot(BeNil())
				backupPolicyPlanPrototypeModel.Active = core.BoolPtr(true)
				backupPolicyPlanPrototypeModel.AttachUserTags = []string{"my-daily-backup-plan"}
				backupPolicyPlanPrototypeModel.ClonePolicy = backupPolicyPlanClonePolicyPrototypeModel
				backupPolicyPlanPrototypeModel.CopyUserTags = core.BoolPtr(true)
				backupPolicyPlanPrototypeModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				backupPolicyPlanPrototypeModel.DeletionTrigger = backupPolicyPlanDeletionTriggerPrototypeModel
				backupPolicyPlanPrototypeModel.Name = core.StringPtr("my-policy-plan")
				backupPolicyPlanPrototypeModel.RemoteRegionPolicies = []vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}
				Expect(backupPolicyPlanPrototypeModel.Active).To(Equal(core.BoolPtr(true)))
				Expect(backupPolicyPlanPrototypeModel.AttachUserTags).To(Equal([]string{"my-daily-backup-plan"}))
				Expect(backupPolicyPlanPrototypeModel.ClonePolicy).To(Equal(backupPolicyPlanClonePolicyPrototypeModel))
				Expect(backupPolicyPlanPrototypeModel.CopyUserTags).To(Equal(core.BoolPtr(true)))
				Expect(backupPolicyPlanPrototypeModel.CronSpec).To(Equal(core.StringPtr("30 */2 * * 1-5")))
				Expect(backupPolicyPlanPrototypeModel.DeletionTrigger).To(Equal(backupPolicyPlanDeletionTriggerPrototypeModel))
				Expect(backupPolicyPlanPrototypeModel.Name).To(Equal(core.StringPtr("my-policy-plan")))
				Expect(backupPolicyPlanPrototypeModel.RemoteRegionPolicies).To(Equal([]vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN model
				backupPolicyScopePrototypeModel := new(vpcv1.BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN)
				Expect(backupPolicyScopePrototypeModel).ToNot(BeNil())
				backupPolicyScopePrototypeModel.CRN = core.StringPtr("crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce")
				Expect(backupPolicyScopePrototypeModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce")))

				// Construct an instance of the BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype model
				backupPolicyPrototypeModel := new(vpcv1.BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype)
				Expect(backupPolicyPrototypeModel).ToNot(BeNil())
				backupPolicyPrototypeModel.MatchUserTags = []string{"my-daily-backup-policy"}
				backupPolicyPrototypeModel.Name = core.StringPtr("my-backup-policy")
				backupPolicyPrototypeModel.Plans = []vpcv1.BackupPolicyPlanPrototype{*backupPolicyPlanPrototypeModel}
				backupPolicyPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				backupPolicyPrototypeModel.Scope = backupPolicyScopePrototypeModel
				backupPolicyPrototypeModel.MatchResourceType = core.StringPtr("volume")
				Expect(backupPolicyPrototypeModel.MatchUserTags).To(Equal([]string{"my-daily-backup-policy"}))
				Expect(backupPolicyPrototypeModel.Name).To(Equal(core.StringPtr("my-backup-policy")))
				Expect(backupPolicyPrototypeModel.Plans).To(Equal([]vpcv1.BackupPolicyPlanPrototype{*backupPolicyPlanPrototypeModel}))
				Expect(backupPolicyPrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(backupPolicyPrototypeModel.Scope).To(Equal(backupPolicyScopePrototypeModel))
				Expect(backupPolicyPrototypeModel.MatchResourceType).To(Equal(core.StringPtr("volume")))

				// Construct an instance of the CreateBackupPolicyOptions model
				var backupPolicyPrototype vpcv1.BackupPolicyPrototypeIntf = nil
				createBackupPolicyOptionsModel := vpcService.NewCreateBackupPolicyOptions(backupPolicyPrototype)
				createBackupPolicyOptionsModel.SetBackupPolicyPrototype(backupPolicyPrototypeModel)
				createBackupPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createBackupPolicyOptionsModel).ToNot(BeNil())
				Expect(createBackupPolicyOptionsModel.BackupPolicyPrototype).To(Equal(backupPolicyPrototypeModel))
				Expect(createBackupPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateBackupPolicyPlanOptions successfully`, func() {
				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the BackupPolicyPlanClonePolicyPrototype model
				backupPolicyPlanClonePolicyPrototypeModel := new(vpcv1.BackupPolicyPlanClonePolicyPrototype)
				Expect(backupPolicyPlanClonePolicyPrototypeModel).ToNot(BeNil())
				backupPolicyPlanClonePolicyPrototypeModel.MaxSnapshots = core.Int64Ptr(int64(5))
				backupPolicyPlanClonePolicyPrototypeModel.Zones = []vpcv1.ZoneIdentityIntf{zoneIdentityModel}
				Expect(backupPolicyPlanClonePolicyPrototypeModel.MaxSnapshots).To(Equal(core.Int64Ptr(int64(5))))
				Expect(backupPolicyPlanClonePolicyPrototypeModel.Zones).To(Equal([]vpcv1.ZoneIdentityIntf{zoneIdentityModel}))

				// Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model
				backupPolicyPlanDeletionTriggerPrototypeModel := new(vpcv1.BackupPolicyPlanDeletionTriggerPrototype)
				Expect(backupPolicyPlanDeletionTriggerPrototypeModel).ToNot(BeNil())
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteAfter = core.Int64Ptr(int64(20))
				backupPolicyPlanDeletionTriggerPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(20))
				Expect(backupPolicyPlanDeletionTriggerPrototypeModel.DeleteAfter).To(Equal(core.Int64Ptr(int64(20))))
				Expect(backupPolicyPlanDeletionTriggerPrototypeModel.DeleteOverCount).To(Equal(core.Int64Ptr(int64(20))))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				Expect(encryptionKeyIdentityModel).ToNot(BeNil())
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")
				Expect(encryptionKeyIdentityModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")))

				// Construct an instance of the RegionIdentityByName model
				regionIdentityModel := new(vpcv1.RegionIdentityByName)
				Expect(regionIdentityModel).ToNot(BeNil())
				regionIdentityModel.Name = core.StringPtr("us-south")
				Expect(regionIdentityModel.Name).To(Equal(core.StringPtr("us-south")))

				// Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model
				backupPolicyPlanRemoteRegionPolicyPrototypeModel := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
				Expect(backupPolicyPlanRemoteRegionPolicyPrototypeModel).ToNot(BeNil())
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount = core.Int64Ptr(int64(5))
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region = regionIdentityModel
				Expect(backupPolicyPlanRemoteRegionPolicyPrototypeModel.DeleteOverCount).To(Equal(core.Int64Ptr(int64(5))))
				Expect(backupPolicyPlanRemoteRegionPolicyPrototypeModel.EncryptionKey).To(Equal(encryptionKeyIdentityModel))
				Expect(backupPolicyPlanRemoteRegionPolicyPrototypeModel.Region).To(Equal(regionIdentityModel))

				// Construct an instance of the CreateBackupPolicyPlanOptions model
				backupPolicyID := "testString"
				createBackupPolicyPlanOptionsCronSpec := "30 */2 * * 1-5"
				createBackupPolicyPlanOptionsModel := vpcService.NewCreateBackupPolicyPlanOptions(backupPolicyID, createBackupPolicyPlanOptionsCronSpec)
				createBackupPolicyPlanOptionsModel.SetBackupPolicyID("testString")
				createBackupPolicyPlanOptionsModel.SetCronSpec("30 */2 * * 1-5")
				createBackupPolicyPlanOptionsModel.SetActive(true)
				createBackupPolicyPlanOptionsModel.SetAttachUserTags([]string{"my-daily-backup-plan"})
				createBackupPolicyPlanOptionsModel.SetClonePolicy(backupPolicyPlanClonePolicyPrototypeModel)
				createBackupPolicyPlanOptionsModel.SetCopyUserTags(true)
				createBackupPolicyPlanOptionsModel.SetDeletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel)
				createBackupPolicyPlanOptionsModel.SetName("my-policy-plan")
				createBackupPolicyPlanOptionsModel.SetRemoteRegionPolicies([]vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel})
				createBackupPolicyPlanOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createBackupPolicyPlanOptionsModel).ToNot(BeNil())
				Expect(createBackupPolicyPlanOptionsModel.BackupPolicyID).To(Equal(core.StringPtr("testString")))
				Expect(createBackupPolicyPlanOptionsModel.CronSpec).To(Equal(core.StringPtr("30 */2 * * 1-5")))
				Expect(createBackupPolicyPlanOptionsModel.Active).To(Equal(core.BoolPtr(true)))
				Expect(createBackupPolicyPlanOptionsModel.AttachUserTags).To(Equal([]string{"my-daily-backup-plan"}))
				Expect(createBackupPolicyPlanOptionsModel.ClonePolicy).To(Equal(backupPolicyPlanClonePolicyPrototypeModel))
				Expect(createBackupPolicyPlanOptionsModel.CopyUserTags).To(Equal(core.BoolPtr(true)))
				Expect(createBackupPolicyPlanOptionsModel.DeletionTrigger).To(Equal(backupPolicyPlanDeletionTriggerPrototypeModel))
				Expect(createBackupPolicyPlanOptionsModel.Name).To(Equal(core.StringPtr("my-policy-plan")))
				Expect(createBackupPolicyPlanOptionsModel.RemoteRegionPolicies).To(Equal([]vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype{*backupPolicyPlanRemoteRegionPolicyPrototypeModel}))
				Expect(createBackupPolicyPlanOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateBareMetalServerConsoleAccessTokenOptions successfully`, func() {
				// Construct an instance of the CreateBareMetalServerConsoleAccessTokenOptions model
				bareMetalServerID := "testString"
				createBareMetalServerConsoleAccessTokenOptionsConsoleType := "serial"
				createBareMetalServerConsoleAccessTokenOptionsModel := vpcService.NewCreateBareMetalServerConsoleAccessTokenOptions(bareMetalServerID, createBareMetalServerConsoleAccessTokenOptionsConsoleType)
				createBareMetalServerConsoleAccessTokenOptionsModel.SetBareMetalServerID("testString")
				createBareMetalServerConsoleAccessTokenOptionsModel.SetConsoleType("serial")
				createBareMetalServerConsoleAccessTokenOptionsModel.SetForce(false)
				createBareMetalServerConsoleAccessTokenOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createBareMetalServerConsoleAccessTokenOptionsModel).ToNot(BeNil())
				Expect(createBareMetalServerConsoleAccessTokenOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(createBareMetalServerConsoleAccessTokenOptionsModel.ConsoleType).To(Equal(core.StringPtr("serial")))
				Expect(createBareMetalServerConsoleAccessTokenOptionsModel.Force).To(Equal(core.BoolPtr(false)))
				Expect(createBareMetalServerConsoleAccessTokenOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateBareMetalServerNetworkAttachmentOptions successfully`, func() {
				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				Expect(virtualNetworkInterfaceIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(virtualNetworkInterfaceIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(virtualNetworkInterfaceIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(virtualNetworkInterfaceIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				Expect(securityGroupIdentityModel).ToNot(BeNil())
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
				Expect(securityGroupIdentityModel.ID).To(Equal(core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")))

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				Expect(subnetIdentityModel).ToNot(BeNil())
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
				Expect(subnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")))

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext)
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel).ToNot(BeNil())
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing).To(Equal(core.BoolPtr(true)))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat).To(Equal(core.BoolPtr(true)))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips).To(Equal([]vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name).To(Equal(core.StringPtr("my-virtual-network-interface")))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP).To(Equal(virtualNetworkInterfacePrimaryIPPrototypeModel))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode).To(Equal(core.StringPtr("auto")))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups).To(Equal([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet).To(Equal(subnetIdentityModel))

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype model
				bareMetalServerNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype)
				Expect(bareMetalServerNetworkAttachmentPrototypeModel).ToNot(BeNil())
				bareMetalServerNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")
				Expect(bareMetalServerNetworkAttachmentPrototypeModel.Name).To(Equal(core.StringPtr("my-bare-metal-server-network-attachment")))
				Expect(bareMetalServerNetworkAttachmentPrototypeModel.VirtualNetworkInterface).To(Equal(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel))
				Expect(bareMetalServerNetworkAttachmentPrototypeModel.AllowedVlans).To(Equal([]int64{}))
				Expect(bareMetalServerNetworkAttachmentPrototypeModel.InterfaceType).To(Equal(core.StringPtr("pci")))

				// Construct an instance of the CreateBareMetalServerNetworkAttachmentOptions model
				bareMetalServerID := "testString"
				var bareMetalServerNetworkAttachmentPrototype vpcv1.BareMetalServerNetworkAttachmentPrototypeIntf = nil
				createBareMetalServerNetworkAttachmentOptionsModel := vpcService.NewCreateBareMetalServerNetworkAttachmentOptions(bareMetalServerID, bareMetalServerNetworkAttachmentPrototype)
				createBareMetalServerNetworkAttachmentOptionsModel.SetBareMetalServerID("testString")
				createBareMetalServerNetworkAttachmentOptionsModel.SetBareMetalServerNetworkAttachmentPrototype(bareMetalServerNetworkAttachmentPrototypeModel)
				createBareMetalServerNetworkAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createBareMetalServerNetworkAttachmentOptionsModel).ToNot(BeNil())
				Expect(createBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(createBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerNetworkAttachmentPrototype).To(Equal(bareMetalServerNetworkAttachmentPrototypeModel))
				Expect(createBareMetalServerNetworkAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateBareMetalServerNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				Expect(networkInterfaceIPPrototypeModel).ToNot(BeNil())
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(networkInterfaceIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(networkInterfaceIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(networkInterfaceIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				Expect(securityGroupIdentityModel).ToNot(BeNil())
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
				Expect(securityGroupIdentityModel.ID).To(Equal(core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")))

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				Expect(subnetIdentityModel).ToNot(BeNil())
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
				Expect(subnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")))

				// Construct an instance of the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model
				bareMetalServerNetworkInterfacePrototypeModel := new(vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype)
				Expect(bareMetalServerNetworkInterfacePrototypeModel).ToNot(BeNil())
				bareMetalServerNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkInterfacePrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-interface")
				bareMetalServerNetworkInterfacePrototypeModel.PrimaryIP = networkInterfaceIPPrototypeModel
				bareMetalServerNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel
				bareMetalServerNetworkInterfacePrototypeModel.InterfaceType = core.StringPtr("hipersocket")
				Expect(bareMetalServerNetworkInterfacePrototypeModel.AllowIPSpoofing).To(Equal(core.BoolPtr(true)))
				Expect(bareMetalServerNetworkInterfacePrototypeModel.EnableInfrastructureNat).To(Equal(core.BoolPtr(true)))
				Expect(bareMetalServerNetworkInterfacePrototypeModel.Name).To(Equal(core.StringPtr("my-bare-metal-server-network-interface")))
				Expect(bareMetalServerNetworkInterfacePrototypeModel.PrimaryIP).To(Equal(networkInterfaceIPPrototypeModel))
				Expect(bareMetalServerNetworkInterfacePrototypeModel.SecurityGroups).To(Equal([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}))
				Expect(bareMetalServerNetworkInterfacePrototypeModel.Subnet).To(Equal(subnetIdentityModel))
				Expect(bareMetalServerNetworkInterfacePrototypeModel.InterfaceType).To(Equal(core.StringPtr("hipersocket")))

				// Construct an instance of the CreateBareMetalServerNetworkInterfaceOptions model
				bareMetalServerID := "testString"
				var bareMetalServerNetworkInterfacePrototype vpcv1.BareMetalServerNetworkInterfacePrototypeIntf = nil
				createBareMetalServerNetworkInterfaceOptionsModel := vpcService.NewCreateBareMetalServerNetworkInterfaceOptions(bareMetalServerID, bareMetalServerNetworkInterfacePrototype)
				createBareMetalServerNetworkInterfaceOptionsModel.SetBareMetalServerID("testString")
				createBareMetalServerNetworkInterfaceOptionsModel.SetBareMetalServerNetworkInterfacePrototype(bareMetalServerNetworkInterfacePrototypeModel)
				createBareMetalServerNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createBareMetalServerNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(createBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(createBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerNetworkInterfacePrototype).To(Equal(bareMetalServerNetworkInterfacePrototypeModel))
				Expect(createBareMetalServerNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateBareMetalServerOptions successfully`, func() {
				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				Expect(trustedProfileIdentityModel).ToNot(BeNil())
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")
				Expect(trustedProfileIdentityModel.ID).To(Equal(core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")))

				// Construct an instance of the BareMetalServerInitializationDefaultTrustedProfilePrototype model
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel := new(vpcv1.BareMetalServerInitializationDefaultTrustedProfilePrototype)
				Expect(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel).ToNot(BeNil())
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel
				Expect(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.AutoLink).To(Equal(core.BoolPtr(false)))
				Expect(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.Target).To(Equal(trustedProfileIdentityModel))

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				Expect(imageIdentityModel).ToNot(BeNil())
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")
				Expect(imageIdentityModel.ID).To(Equal(core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")))

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				Expect(keyIdentityModel).ToNot(BeNil())
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")
				Expect(keyIdentityModel.ID).To(Equal(core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")))

				// Construct an instance of the BareMetalServerInitializationPrototype model
				bareMetalServerInitializationPrototypeModel := new(vpcv1.BareMetalServerInitializationPrototype)
				Expect(bareMetalServerInitializationPrototypeModel).ToNot(BeNil())
				bareMetalServerInitializationPrototypeModel.DefaultTrustedProfile = bareMetalServerInitializationDefaultTrustedProfilePrototypeModel
				bareMetalServerInitializationPrototypeModel.Image = imageIdentityModel
				bareMetalServerInitializationPrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				bareMetalServerInitializationPrototypeModel.UserData = core.StringPtr("testString")
				Expect(bareMetalServerInitializationPrototypeModel.DefaultTrustedProfile).To(Equal(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel))
				Expect(bareMetalServerInitializationPrototypeModel.Image).To(Equal(imageIdentityModel))
				Expect(bareMetalServerInitializationPrototypeModel.Keys).To(Equal([]vpcv1.KeyIdentityIntf{keyIdentityModel}))
				Expect(bareMetalServerInitializationPrototypeModel.UserData).To(Equal(core.StringPtr("testString")))

				// Construct an instance of the BareMetalServerMetadataServicePrototype model
				bareMetalServerMetadataServicePrototypeModel := new(vpcv1.BareMetalServerMetadataServicePrototype)
				Expect(bareMetalServerMetadataServicePrototypeModel).ToNot(BeNil())
				bareMetalServerMetadataServicePrototypeModel.Enabled = core.BoolPtr(true)
				bareMetalServerMetadataServicePrototypeModel.Protocol = core.StringPtr("https")
				Expect(bareMetalServerMetadataServicePrototypeModel.Enabled).To(Equal(core.BoolPtr(true)))
				Expect(bareMetalServerMetadataServicePrototypeModel.Protocol).To(Equal(core.StringPtr("https")))

				// Construct an instance of the BareMetalServerProfileIdentityByName model
				bareMetalServerProfileIdentityModel := new(vpcv1.BareMetalServerProfileIdentityByName)
				Expect(bareMetalServerProfileIdentityModel).ToNot(BeNil())
				bareMetalServerProfileIdentityModel.Name = core.StringPtr("bx2-metal-192x768")
				Expect(bareMetalServerProfileIdentityModel.Name).To(Equal(core.StringPtr("bx2-metal-192x768")))

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				Expect(reservationIdentityModel).ToNot(BeNil())
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				Expect(reservationIdentityModel.ID).To(Equal(core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")))

				// Construct an instance of the BareMetalServerReservationAffinityPrototype model
				bareMetalServerReservationAffinityPrototypeModel := new(vpcv1.BareMetalServerReservationAffinityPrototype)
				Expect(bareMetalServerReservationAffinityPrototypeModel).ToNot(BeNil())
				bareMetalServerReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				bareMetalServerReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}
				Expect(bareMetalServerReservationAffinityPrototypeModel.Policy).To(Equal(core.StringPtr("automatic")))
				Expect(bareMetalServerReservationAffinityPrototypeModel.Pool).To(Equal([]vpcv1.ReservationIdentityIntf{reservationIdentityModel}))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the BareMetalServerTrustedPlatformModulePrototype model
				bareMetalServerTrustedPlatformModulePrototypeModel := new(vpcv1.BareMetalServerTrustedPlatformModulePrototype)
				Expect(bareMetalServerTrustedPlatformModulePrototypeModel).ToNot(BeNil())
				bareMetalServerTrustedPlatformModulePrototypeModel.Mode = core.StringPtr("disabled")
				Expect(bareMetalServerTrustedPlatformModulePrototypeModel.Mode).To(Equal(core.StringPtr("disabled")))

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				Expect(vpcIdentityModel).ToNot(BeNil())
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				Expect(vpcIdentityModel.ID).To(Equal(core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				Expect(virtualNetworkInterfaceIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(virtualNetworkInterfaceIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(virtualNetworkInterfaceIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(virtualNetworkInterfaceIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				Expect(securityGroupIdentityModel).ToNot(BeNil())
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
				Expect(securityGroupIdentityModel.ID).To(Equal(core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")))

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				Expect(subnetIdentityModel).ToNot(BeNil())
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
				Expect(subnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")))

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext)
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel).ToNot(BeNil())
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing).To(Equal(core.BoolPtr(true)))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat).To(Equal(core.BoolPtr(true)))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips).To(Equal([]vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name).To(Equal(core.StringPtr("my-virtual-network-interface")))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP).To(Equal(virtualNetworkInterfacePrimaryIPPrototypeModel))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode).To(Equal(core.StringPtr("auto")))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups).To(Equal([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}))
				Expect(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet).To(Equal(subnetIdentityModel))

				// Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype model
				bareMetalServerNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype)
				Expect(bareMetalServerNetworkAttachmentPrototypeModel).ToNot(BeNil())
				bareMetalServerNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")
				Expect(bareMetalServerNetworkAttachmentPrototypeModel.Name).To(Equal(core.StringPtr("my-bare-metal-server-network-attachment")))
				Expect(bareMetalServerNetworkAttachmentPrototypeModel.VirtualNetworkInterface).To(Equal(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel))
				Expect(bareMetalServerNetworkAttachmentPrototypeModel.AllowedVlans).To(Equal([]int64{}))
				Expect(bareMetalServerNetworkAttachmentPrototypeModel.InterfaceType).To(Equal(core.StringPtr("pci")))

				// Construct an instance of the BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype model
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel := new(vpcv1.BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype)
				Expect(bareMetalServerPrimaryNetworkAttachmentPrototypeModel).ToNot(BeNil())
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-bare-metal-server-network-attachment")
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.VirtualNetworkInterface = bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.AllowedVlans = []int64{}
				bareMetalServerPrimaryNetworkAttachmentPrototypeModel.InterfaceType = core.StringPtr("pci")
				Expect(bareMetalServerPrimaryNetworkAttachmentPrototypeModel.Name).To(Equal(core.StringPtr("my-bare-metal-server-network-attachment")))
				Expect(bareMetalServerPrimaryNetworkAttachmentPrototypeModel.VirtualNetworkInterface).To(Equal(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel))
				Expect(bareMetalServerPrimaryNetworkAttachmentPrototypeModel.AllowedVlans).To(Equal([]int64{}))
				Expect(bareMetalServerPrimaryNetworkAttachmentPrototypeModel.InterfaceType).To(Equal(core.StringPtr("pci")))

				// Construct an instance of the BareMetalServerPrototypeBareMetalServerByNetworkAttachment model
				bareMetalServerPrototypeModel := new(vpcv1.BareMetalServerPrototypeBareMetalServerByNetworkAttachment)
				Expect(bareMetalServerPrototypeModel).ToNot(BeNil())
				bareMetalServerPrototypeModel.Bandwidth = core.Int64Ptr(int64(20000))
				bareMetalServerPrototypeModel.EnableSecureBoot = core.BoolPtr(false)
				bareMetalServerPrototypeModel.Initialization = bareMetalServerInitializationPrototypeModel
				bareMetalServerPrototypeModel.MetadataService = bareMetalServerMetadataServicePrototypeModel
				bareMetalServerPrototypeModel.Name = core.StringPtr("my-bare-metal-server")
				bareMetalServerPrototypeModel.Profile = bareMetalServerProfileIdentityModel
				bareMetalServerPrototypeModel.ReservationAffinity = bareMetalServerReservationAffinityPrototypeModel
				bareMetalServerPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				bareMetalServerPrototypeModel.TrustedPlatformModule = bareMetalServerTrustedPlatformModulePrototypeModel
				bareMetalServerPrototypeModel.VPC = vpcIdentityModel
				bareMetalServerPrototypeModel.Zone = zoneIdentityModel
				bareMetalServerPrototypeModel.NetworkAttachments = []vpcv1.BareMetalServerNetworkAttachmentPrototypeIntf{bareMetalServerNetworkAttachmentPrototypeModel}
				bareMetalServerPrototypeModel.PrimaryNetworkAttachment = bareMetalServerPrimaryNetworkAttachmentPrototypeModel
				Expect(bareMetalServerPrototypeModel.Bandwidth).To(Equal(core.Int64Ptr(int64(20000))))
				Expect(bareMetalServerPrototypeModel.EnableSecureBoot).To(Equal(core.BoolPtr(false)))
				Expect(bareMetalServerPrototypeModel.Initialization).To(Equal(bareMetalServerInitializationPrototypeModel))
				Expect(bareMetalServerPrototypeModel.MetadataService).To(Equal(bareMetalServerMetadataServicePrototypeModel))
				Expect(bareMetalServerPrototypeModel.Name).To(Equal(core.StringPtr("my-bare-metal-server")))
				Expect(bareMetalServerPrototypeModel.Profile).To(Equal(bareMetalServerProfileIdentityModel))
				Expect(bareMetalServerPrototypeModel.ReservationAffinity).To(Equal(bareMetalServerReservationAffinityPrototypeModel))
				Expect(bareMetalServerPrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(bareMetalServerPrototypeModel.TrustedPlatformModule).To(Equal(bareMetalServerTrustedPlatformModulePrototypeModel))
				Expect(bareMetalServerPrototypeModel.VPC).To(Equal(vpcIdentityModel))
				Expect(bareMetalServerPrototypeModel.Zone).To(Equal(zoneIdentityModel))
				Expect(bareMetalServerPrototypeModel.NetworkAttachments).To(Equal([]vpcv1.BareMetalServerNetworkAttachmentPrototypeIntf{bareMetalServerNetworkAttachmentPrototypeModel}))
				Expect(bareMetalServerPrototypeModel.PrimaryNetworkAttachment).To(Equal(bareMetalServerPrimaryNetworkAttachmentPrototypeModel))

				// Construct an instance of the CreateBareMetalServerOptions model
				var bareMetalServerPrototype vpcv1.BareMetalServerPrototypeIntf = nil
				createBareMetalServerOptionsModel := vpcService.NewCreateBareMetalServerOptions(bareMetalServerPrototype)
				createBareMetalServerOptionsModel.SetBareMetalServerPrototype(bareMetalServerPrototypeModel)
				createBareMetalServerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createBareMetalServerOptionsModel).ToNot(BeNil())
				Expect(createBareMetalServerOptionsModel.BareMetalServerPrototype).To(Equal(bareMetalServerPrototypeModel))
				Expect(createBareMetalServerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateClusterNetworkAttachmentOptions successfully`, func() {
				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel).ToNot(BeNil())
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel.Name).To(Equal(core.StringPtr("my-cluster-network-subnet-reserved-ip")))

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				Expect(clusterNetworkSubnetIdentityModel).ToNot(BeNil())
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")
				Expect(clusterNetworkSubnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")))

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel).ToNot(BeNil())
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name).To(Equal(core.StringPtr("my-cluster-network-interface")))
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP).To(Equal(clusterNetworkInterfacePrimaryIPPrototypeModel))
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet).To(Equal(clusterNetworkSubnetIdentityModel))

				// Construct an instance of the InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID model
				instanceClusterNetworkAttachmentBeforePrototypeModel := new(vpcv1.InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID)
				Expect(instanceClusterNetworkAttachmentBeforePrototypeModel).ToNot(BeNil())
				instanceClusterNetworkAttachmentBeforePrototypeModel.ID = core.StringPtr("0717-fb880975-db45-4459-8548-64e3995ac213")
				Expect(instanceClusterNetworkAttachmentBeforePrototypeModel.ID).To(Equal(core.StringPtr("0717-fb880975-db45-4459-8548-64e3995ac213")))

				// Construct an instance of the CreateClusterNetworkAttachmentOptions model
				instanceID := "testString"
				var createClusterNetworkAttachmentOptionsClusterNetworkInterface vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceIntf = nil
				createClusterNetworkAttachmentOptionsModel := vpcService.NewCreateClusterNetworkAttachmentOptions(instanceID, createClusterNetworkAttachmentOptionsClusterNetworkInterface)
				createClusterNetworkAttachmentOptionsModel.SetInstanceID("testString")
				createClusterNetworkAttachmentOptionsModel.SetClusterNetworkInterface(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel)
				createClusterNetworkAttachmentOptionsModel.SetBefore(instanceClusterNetworkAttachmentBeforePrototypeModel)
				createClusterNetworkAttachmentOptionsModel.SetName("my-instance-network-attachment")
				createClusterNetworkAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createClusterNetworkAttachmentOptionsModel).ToNot(BeNil())
				Expect(createClusterNetworkAttachmentOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(createClusterNetworkAttachmentOptionsModel.ClusterNetworkInterface).To(Equal(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel))
				Expect(createClusterNetworkAttachmentOptionsModel.Before).To(Equal(instanceClusterNetworkAttachmentBeforePrototypeModel))
				Expect(createClusterNetworkAttachmentOptionsModel.Name).To(Equal(core.StringPtr("my-instance-network-attachment")))
				Expect(createClusterNetworkAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateClusterNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel).ToNot(BeNil())
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel.Name).To(Equal(core.StringPtr("my-cluster-network-subnet-reserved-ip")))

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				Expect(clusterNetworkSubnetIdentityModel).ToNot(BeNil())
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")
				Expect(clusterNetworkSubnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")))

				// Construct an instance of the CreateClusterNetworkInterfaceOptions model
				clusterNetworkID := "testString"
				createClusterNetworkInterfaceOptionsModel := vpcService.NewCreateClusterNetworkInterfaceOptions(clusterNetworkID)
				createClusterNetworkInterfaceOptionsModel.SetClusterNetworkID("testString")
				createClusterNetworkInterfaceOptionsModel.SetName("my-cluster-network-interface")
				createClusterNetworkInterfaceOptionsModel.SetPrimaryIP(clusterNetworkInterfacePrimaryIPPrototypeModel)
				createClusterNetworkInterfaceOptionsModel.SetSubnet(clusterNetworkSubnetIdentityModel)
				createClusterNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createClusterNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(createClusterNetworkInterfaceOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(createClusterNetworkInterfaceOptionsModel.Name).To(Equal(core.StringPtr("my-cluster-network-interface")))
				Expect(createClusterNetworkInterfaceOptionsModel.PrimaryIP).To(Equal(clusterNetworkInterfacePrimaryIPPrototypeModel))
				Expect(createClusterNetworkInterfaceOptionsModel.Subnet).To(Equal(clusterNetworkSubnetIdentityModel))
				Expect(createClusterNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateClusterNetworkOptions successfully`, func() {
				// Construct an instance of the ClusterNetworkProfileIdentityByName model
				clusterNetworkProfileIdentityModel := new(vpcv1.ClusterNetworkProfileIdentityByName)
				Expect(clusterNetworkProfileIdentityModel).ToNot(BeNil())
				clusterNetworkProfileIdentityModel.Name = core.StringPtr("h100")
				Expect(clusterNetworkProfileIdentityModel.Name).To(Equal(core.StringPtr("h100")))

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				Expect(vpcIdentityModel).ToNot(BeNil())
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				Expect(vpcIdentityModel.ID).To(Equal(core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the ClusterNetworkSubnetPrefixPrototype model
				clusterNetworkSubnetPrefixPrototypeModel := new(vpcv1.ClusterNetworkSubnetPrefixPrototype)
				Expect(clusterNetworkSubnetPrefixPrototypeModel).ToNot(BeNil())
				clusterNetworkSubnetPrefixPrototypeModel.CIDR = core.StringPtr("10.0.0.0/24")
				Expect(clusterNetworkSubnetPrefixPrototypeModel.CIDR).To(Equal(core.StringPtr("10.0.0.0/24")))

				// Construct an instance of the CreateClusterNetworkOptions model
				var createClusterNetworkOptionsProfile vpcv1.ClusterNetworkProfileIdentityIntf = nil
				var createClusterNetworkOptionsVPC vpcv1.VPCIdentityIntf = nil
				var createClusterNetworkOptionsZone vpcv1.ZoneIdentityIntf = nil
				createClusterNetworkOptionsModel := vpcService.NewCreateClusterNetworkOptions(createClusterNetworkOptionsProfile, createClusterNetworkOptionsVPC, createClusterNetworkOptionsZone)
				createClusterNetworkOptionsModel.SetProfile(clusterNetworkProfileIdentityModel)
				createClusterNetworkOptionsModel.SetVPC(vpcIdentityModel)
				createClusterNetworkOptionsModel.SetZone(zoneIdentityModel)
				createClusterNetworkOptionsModel.SetName("my-cluster-network")
				createClusterNetworkOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createClusterNetworkOptionsModel.SetSubnetPrefixes([]vpcv1.ClusterNetworkSubnetPrefixPrototype{*clusterNetworkSubnetPrefixPrototypeModel})
				createClusterNetworkOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createClusterNetworkOptionsModel).ToNot(BeNil())
				Expect(createClusterNetworkOptionsModel.Profile).To(Equal(clusterNetworkProfileIdentityModel))
				Expect(createClusterNetworkOptionsModel.VPC).To(Equal(vpcIdentityModel))
				Expect(createClusterNetworkOptionsModel.Zone).To(Equal(zoneIdentityModel))
				Expect(createClusterNetworkOptionsModel.Name).To(Equal(core.StringPtr("my-cluster-network")))
				Expect(createClusterNetworkOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createClusterNetworkOptionsModel.SubnetPrefixes).To(Equal([]vpcv1.ClusterNetworkSubnetPrefixPrototype{*clusterNetworkSubnetPrefixPrototypeModel}))
				Expect(createClusterNetworkOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateClusterNetworkSubnetOptions successfully`, func() {
				// Construct an instance of the ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype model
				clusterNetworkSubnetPrototypeModel := new(vpcv1.ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype)
				Expect(clusterNetworkSubnetPrototypeModel).ToNot(BeNil())
				clusterNetworkSubnetPrototypeModel.IPVersion = core.StringPtr("ipv4")
				clusterNetworkSubnetPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet")
				clusterNetworkSubnetPrototypeModel.TotalIpv4AddressCount = core.Int64Ptr(int64(256))
				Expect(clusterNetworkSubnetPrototypeModel.IPVersion).To(Equal(core.StringPtr("ipv4")))
				Expect(clusterNetworkSubnetPrototypeModel.Name).To(Equal(core.StringPtr("my-cluster-network-subnet")))
				Expect(clusterNetworkSubnetPrototypeModel.TotalIpv4AddressCount).To(Equal(core.Int64Ptr(int64(256))))

				// Construct an instance of the CreateClusterNetworkSubnetOptions model
				clusterNetworkID := "testString"
				var clusterNetworkSubnetPrototype vpcv1.ClusterNetworkSubnetPrototypeIntf = nil
				createClusterNetworkSubnetOptionsModel := vpcService.NewCreateClusterNetworkSubnetOptions(clusterNetworkID, clusterNetworkSubnetPrototype)
				createClusterNetworkSubnetOptionsModel.SetClusterNetworkID("testString")
				createClusterNetworkSubnetOptionsModel.SetClusterNetworkSubnetPrototype(clusterNetworkSubnetPrototypeModel)
				createClusterNetworkSubnetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createClusterNetworkSubnetOptionsModel).ToNot(BeNil())
				Expect(createClusterNetworkSubnetOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(createClusterNetworkSubnetOptionsModel.ClusterNetworkSubnetPrototype).To(Equal(clusterNetworkSubnetPrototypeModel))
				Expect(createClusterNetworkSubnetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateClusterNetworkSubnetReservedIPOptions successfully`, func() {
				// Construct an instance of the CreateClusterNetworkSubnetReservedIPOptions model
				clusterNetworkID := "testString"
				clusterNetworkSubnetID := "testString"
				createClusterNetworkSubnetReservedIPOptionsModel := vpcService.NewCreateClusterNetworkSubnetReservedIPOptions(clusterNetworkID, clusterNetworkSubnetID)
				createClusterNetworkSubnetReservedIPOptionsModel.SetClusterNetworkID("testString")
				createClusterNetworkSubnetReservedIPOptionsModel.SetClusterNetworkSubnetID("testString")
				createClusterNetworkSubnetReservedIPOptionsModel.SetAddress("192.168.3.4")
				createClusterNetworkSubnetReservedIPOptionsModel.SetName("my-cluster-network-subnet-reserved-ip")
				createClusterNetworkSubnetReservedIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createClusterNetworkSubnetReservedIPOptionsModel).ToNot(BeNil())
				Expect(createClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(createClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID).To(Equal(core.StringPtr("testString")))
				Expect(createClusterNetworkSubnetReservedIPOptionsModel.Address).To(Equal(core.StringPtr("192.168.3.4")))
				Expect(createClusterNetworkSubnetReservedIPOptionsModel.Name).To(Equal(core.StringPtr("my-cluster-network-subnet-reserved-ip")))
				Expect(createClusterNetworkSubnetReservedIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateDedicatedHostGroupOptions successfully`, func() {
				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the CreateDedicatedHostGroupOptions model
				createDedicatedHostGroupOptionsClass := "mx2"
				createDedicatedHostGroupOptionsFamily := "balanced"
				var createDedicatedHostGroupOptionsZone vpcv1.ZoneIdentityIntf = nil
				createDedicatedHostGroupOptionsModel := vpcService.NewCreateDedicatedHostGroupOptions(createDedicatedHostGroupOptionsClass, createDedicatedHostGroupOptionsFamily, createDedicatedHostGroupOptionsZone)
				createDedicatedHostGroupOptionsModel.SetClass("mx2")
				createDedicatedHostGroupOptionsModel.SetFamily("balanced")
				createDedicatedHostGroupOptionsModel.SetZone(zoneIdentityModel)
				createDedicatedHostGroupOptionsModel.SetName("testString")
				createDedicatedHostGroupOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createDedicatedHostGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createDedicatedHostGroupOptionsModel).ToNot(BeNil())
				Expect(createDedicatedHostGroupOptionsModel.Class).To(Equal(core.StringPtr("mx2")))
				Expect(createDedicatedHostGroupOptionsModel.Family).To(Equal(core.StringPtr("balanced")))
				Expect(createDedicatedHostGroupOptionsModel.Zone).To(Equal(zoneIdentityModel))
				Expect(createDedicatedHostGroupOptionsModel.Name).To(Equal(core.StringPtr("testString")))
				Expect(createDedicatedHostGroupOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createDedicatedHostGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateDedicatedHostOptions successfully`, func() {
				// Construct an instance of the DedicatedHostProfileIdentityByName model
				dedicatedHostProfileIdentityModel := new(vpcv1.DedicatedHostProfileIdentityByName)
				Expect(dedicatedHostProfileIdentityModel).ToNot(BeNil())
				dedicatedHostProfileIdentityModel.Name = core.StringPtr("mx2-host-152x1216")
				Expect(dedicatedHostProfileIdentityModel.Name).To(Equal(core.StringPtr("mx2-host-152x1216")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the DedicatedHostGroupIdentityByID model
				dedicatedHostGroupIdentityModel := new(vpcv1.DedicatedHostGroupIdentityByID)
				Expect(dedicatedHostGroupIdentityModel).ToNot(BeNil())
				dedicatedHostGroupIdentityModel.ID = core.StringPtr("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")
				Expect(dedicatedHostGroupIdentityModel.ID).To(Equal(core.StringPtr("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")))

				// Construct an instance of the DedicatedHostPrototypeDedicatedHostByGroup model
				dedicatedHostPrototypeModel := new(vpcv1.DedicatedHostPrototypeDedicatedHostByGroup)
				Expect(dedicatedHostPrototypeModel).ToNot(BeNil())
				dedicatedHostPrototypeModel.InstancePlacementEnabled = core.BoolPtr(true)
				dedicatedHostPrototypeModel.Name = core.StringPtr("my-host")
				dedicatedHostPrototypeModel.Profile = dedicatedHostProfileIdentityModel
				dedicatedHostPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				dedicatedHostPrototypeModel.Group = dedicatedHostGroupIdentityModel
				Expect(dedicatedHostPrototypeModel.InstancePlacementEnabled).To(Equal(core.BoolPtr(true)))
				Expect(dedicatedHostPrototypeModel.Name).To(Equal(core.StringPtr("my-host")))
				Expect(dedicatedHostPrototypeModel.Profile).To(Equal(dedicatedHostProfileIdentityModel))
				Expect(dedicatedHostPrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(dedicatedHostPrototypeModel.Group).To(Equal(dedicatedHostGroupIdentityModel))

				// Construct an instance of the CreateDedicatedHostOptions model
				var dedicatedHostPrototype vpcv1.DedicatedHostPrototypeIntf = nil
				createDedicatedHostOptionsModel := vpcService.NewCreateDedicatedHostOptions(dedicatedHostPrototype)
				createDedicatedHostOptionsModel.SetDedicatedHostPrototype(dedicatedHostPrototypeModel)
				createDedicatedHostOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createDedicatedHostOptionsModel).ToNot(BeNil())
				Expect(createDedicatedHostOptionsModel.DedicatedHostPrototype).To(Equal(dedicatedHostPrototypeModel))
				Expect(createDedicatedHostOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateEndpointGatewayOptions successfully`, func() {
				// Construct an instance of the EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype model
				endpointGatewayTargetPrototypeModel := new(vpcv1.EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype)
				Expect(endpointGatewayTargetPrototypeModel).ToNot(BeNil())
				endpointGatewayTargetPrototypeModel.Name = core.StringPtr("ibm-ntp-server")
				endpointGatewayTargetPrototypeModel.ResourceType = core.StringPtr("provider_infrastructure_service")
				Expect(endpointGatewayTargetPrototypeModel.Name).To(Equal(core.StringPtr("ibm-ntp-server")))
				Expect(endpointGatewayTargetPrototypeModel.ResourceType).To(Equal(core.StringPtr("provider_infrastructure_service")))

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				Expect(vpcIdentityModel).ToNot(BeNil())
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				Expect(vpcIdentityModel.ID).To(Equal(core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))

				// Construct an instance of the EndpointGatewayReservedIPReservedIPIdentityByID model
				endpointGatewayReservedIPModel := new(vpcv1.EndpointGatewayReservedIPReservedIPIdentityByID)
				Expect(endpointGatewayReservedIPModel).ToNot(BeNil())
				endpointGatewayReservedIPModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
				Expect(endpointGatewayReservedIPModel.ID).To(Equal(core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				Expect(securityGroupIdentityModel).ToNot(BeNil())
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
				Expect(securityGroupIdentityModel.ID).To(Equal(core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")))

				// Construct an instance of the CreateEndpointGatewayOptions model
				var createEndpointGatewayOptionsTarget vpcv1.EndpointGatewayTargetPrototypeIntf = nil
				var createEndpointGatewayOptionsVPC vpcv1.VPCIdentityIntf = nil
				createEndpointGatewayOptionsModel := vpcService.NewCreateEndpointGatewayOptions(createEndpointGatewayOptionsTarget, createEndpointGatewayOptionsVPC)
				createEndpointGatewayOptionsModel.SetTarget(endpointGatewayTargetPrototypeModel)
				createEndpointGatewayOptionsModel.SetVPC(vpcIdentityModel)
				createEndpointGatewayOptionsModel.SetAllowDnsResolutionBinding(true)
				createEndpointGatewayOptionsModel.SetAllowResourceBinding(false)
				createEndpointGatewayOptionsModel.SetIps([]vpcv1.EndpointGatewayReservedIPIntf{endpointGatewayReservedIPModel})
				createEndpointGatewayOptionsModel.SetName("testString")
				createEndpointGatewayOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createEndpointGatewayOptionsModel.SetSecurityGroups([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel})
				createEndpointGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createEndpointGatewayOptionsModel).ToNot(BeNil())
				Expect(createEndpointGatewayOptionsModel.Target).To(Equal(endpointGatewayTargetPrototypeModel))
				Expect(createEndpointGatewayOptionsModel.VPC).To(Equal(vpcIdentityModel))
				Expect(createEndpointGatewayOptionsModel.AllowDnsResolutionBinding).To(Equal(core.BoolPtr(true)))
				Expect(createEndpointGatewayOptionsModel.AllowResourceBinding).To(Equal(core.BoolPtr(false)))
				Expect(createEndpointGatewayOptionsModel.Ips).To(Equal([]vpcv1.EndpointGatewayReservedIPIntf{endpointGatewayReservedIPModel}))
				Expect(createEndpointGatewayOptionsModel.Name).To(Equal(core.StringPtr("testString")))
				Expect(createEndpointGatewayOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createEndpointGatewayOptionsModel.SecurityGroups).To(Equal([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}))
				Expect(createEndpointGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateEndpointGatewayResourceBindingOptions successfully`, func() {
				// Construct an instance of the EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN model
				endpointGatewayResourceBindingTargetPrototypeModel := new(vpcv1.EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN)
				Expect(endpointGatewayResourceBindingTargetPrototypeModel).ToNot(BeNil())
				endpointGatewayResourceBindingTargetPrototypeModel.CRN = core.StringPtr("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue")
				Expect(endpointGatewayResourceBindingTargetPrototypeModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue")))

				// Construct an instance of the CreateEndpointGatewayResourceBindingOptions model
				endpointGatewayID := "testString"
				var createEndpointGatewayResourceBindingOptionsTarget vpcv1.EndpointGatewayResourceBindingTargetPrototypeIntf = nil
				createEndpointGatewayResourceBindingOptionsModel := vpcService.NewCreateEndpointGatewayResourceBindingOptions(endpointGatewayID, createEndpointGatewayResourceBindingOptionsTarget)
				createEndpointGatewayResourceBindingOptionsModel.SetEndpointGatewayID("testString")
				createEndpointGatewayResourceBindingOptionsModel.SetTarget(endpointGatewayResourceBindingTargetPrototypeModel)
				createEndpointGatewayResourceBindingOptionsModel.SetName("my-resource-binding")
				createEndpointGatewayResourceBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createEndpointGatewayResourceBindingOptionsModel).ToNot(BeNil())
				Expect(createEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(createEndpointGatewayResourceBindingOptionsModel.Target).To(Equal(endpointGatewayResourceBindingTargetPrototypeModel))
				Expect(createEndpointGatewayResourceBindingOptionsModel.Name).To(Equal(core.StringPtr("my-resource-binding")))
				Expect(createEndpointGatewayResourceBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateFloatingIPOptions successfully`, func() {
				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the FloatingIPPrototypeFloatingIPByZone model
				floatingIPPrototypeModel := new(vpcv1.FloatingIPPrototypeFloatingIPByZone)
				Expect(floatingIPPrototypeModel).ToNot(BeNil())
				floatingIPPrototypeModel.Name = core.StringPtr("my-floating-ip")
				floatingIPPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				floatingIPPrototypeModel.Zone = zoneIdentityModel
				Expect(floatingIPPrototypeModel.Name).To(Equal(core.StringPtr("my-floating-ip")))
				Expect(floatingIPPrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(floatingIPPrototypeModel.Zone).To(Equal(zoneIdentityModel))

				// Construct an instance of the CreateFloatingIPOptions model
				var floatingIPPrototype vpcv1.FloatingIPPrototypeIntf = nil
				createFloatingIPOptionsModel := vpcService.NewCreateFloatingIPOptions(floatingIPPrototype)
				createFloatingIPOptionsModel.SetFloatingIPPrototype(floatingIPPrototypeModel)
				createFloatingIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createFloatingIPOptionsModel).ToNot(BeNil())
				Expect(createFloatingIPOptionsModel.FloatingIPPrototype).To(Equal(floatingIPPrototypeModel))
				Expect(createFloatingIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateFlowLogCollectorOptions successfully`, func() {
				// Construct an instance of the LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
				legacyCloudObjectStorageBucketIdentityModel := new(vpcv1.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName)
				Expect(legacyCloudObjectStorageBucketIdentityModel).ToNot(BeNil())
				legacyCloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue")
				Expect(legacyCloudObjectStorageBucketIdentityModel.Name).To(Equal(core.StringPtr("bucket-27200-lwx4cfvcue")))

				// Construct an instance of the FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID model
				flowLogCollectorTargetPrototypeModel := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID)
				Expect(flowLogCollectorTargetPrototypeModel).ToNot(BeNil())
				flowLogCollectorTargetPrototypeModel.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")
				Expect(flowLogCollectorTargetPrototypeModel.ID).To(Equal(core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the CreateFlowLogCollectorOptions model
				var createFlowLogCollectorOptionsStorageBucket vpcv1.LegacyCloudObjectStorageBucketIdentityIntf = nil
				var createFlowLogCollectorOptionsTarget vpcv1.FlowLogCollectorTargetPrototypeIntf = nil
				createFlowLogCollectorOptionsModel := vpcService.NewCreateFlowLogCollectorOptions(createFlowLogCollectorOptionsStorageBucket, createFlowLogCollectorOptionsTarget)
				createFlowLogCollectorOptionsModel.SetStorageBucket(legacyCloudObjectStorageBucketIdentityModel)
				createFlowLogCollectorOptionsModel.SetTarget(flowLogCollectorTargetPrototypeModel)
				createFlowLogCollectorOptionsModel.SetActive(false)
				createFlowLogCollectorOptionsModel.SetName("my-flow-log-collector")
				createFlowLogCollectorOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createFlowLogCollectorOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createFlowLogCollectorOptionsModel).ToNot(BeNil())
				Expect(createFlowLogCollectorOptionsModel.StorageBucket).To(Equal(legacyCloudObjectStorageBucketIdentityModel))
				Expect(createFlowLogCollectorOptionsModel.Target).To(Equal(flowLogCollectorTargetPrototypeModel))
				Expect(createFlowLogCollectorOptionsModel.Active).To(Equal(core.BoolPtr(false)))
				Expect(createFlowLogCollectorOptionsModel.Name).To(Equal(core.StringPtr("my-flow-log-collector")))
				Expect(createFlowLogCollectorOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createFlowLogCollectorOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateIkePolicyOptions successfully`, func() {
				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the CreateIkePolicyOptions model
				createIkePolicyOptionsAuthenticationAlgorithm := "sha256"
				createIkePolicyOptionsDhGroup := int64(14)
				createIkePolicyOptionsEncryptionAlgorithm := "aes128"
				createIkePolicyOptionsIkeVersion := int64(1)
				createIkePolicyOptionsModel := vpcService.NewCreateIkePolicyOptions(createIkePolicyOptionsAuthenticationAlgorithm, createIkePolicyOptionsDhGroup, createIkePolicyOptionsEncryptionAlgorithm, createIkePolicyOptionsIkeVersion)
				createIkePolicyOptionsModel.SetAuthenticationAlgorithm("sha256")
				createIkePolicyOptionsModel.SetDhGroup(int64(14))
				createIkePolicyOptionsModel.SetEncryptionAlgorithm("aes128")
				createIkePolicyOptionsModel.SetIkeVersion(int64(1))
				createIkePolicyOptionsModel.SetKeyLifetime(int64(28800))
				createIkePolicyOptionsModel.SetName("my-ike-policy")
				createIkePolicyOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createIkePolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createIkePolicyOptionsModel).ToNot(BeNil())
				Expect(createIkePolicyOptionsModel.AuthenticationAlgorithm).To(Equal(core.StringPtr("sha256")))
				Expect(createIkePolicyOptionsModel.DhGroup).To(Equal(core.Int64Ptr(int64(14))))
				Expect(createIkePolicyOptionsModel.EncryptionAlgorithm).To(Equal(core.StringPtr("aes128")))
				Expect(createIkePolicyOptionsModel.IkeVersion).To(Equal(core.Int64Ptr(int64(1))))
				Expect(createIkePolicyOptionsModel.KeyLifetime).To(Equal(core.Int64Ptr(int64(28800))))
				Expect(createIkePolicyOptionsModel.Name).To(Equal(core.StringPtr("my-ike-policy")))
				Expect(createIkePolicyOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createIkePolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateImageExportJobOptions successfully`, func() {
				// Construct an instance of the CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
				cloudObjectStorageBucketIdentityModel := new(vpcv1.CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName)
				Expect(cloudObjectStorageBucketIdentityModel).ToNot(BeNil())
				cloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue")
				Expect(cloudObjectStorageBucketIdentityModel.Name).To(Equal(core.StringPtr("bucket-27200-lwx4cfvcue")))

				// Construct an instance of the CreateImageExportJobOptions model
				imageID := "testString"
				var createImageExportJobOptionsStorageBucket vpcv1.CloudObjectStorageBucketIdentityIntf = nil
				createImageExportJobOptionsModel := vpcService.NewCreateImageExportJobOptions(imageID, createImageExportJobOptionsStorageBucket)
				createImageExportJobOptionsModel.SetImageID("testString")
				createImageExportJobOptionsModel.SetStorageBucket(cloudObjectStorageBucketIdentityModel)
				createImageExportJobOptionsModel.SetFormat("qcow2")
				createImageExportJobOptionsModel.SetName("my-image-export")
				createImageExportJobOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createImageExportJobOptionsModel).ToNot(BeNil())
				Expect(createImageExportJobOptionsModel.ImageID).To(Equal(core.StringPtr("testString")))
				Expect(createImageExportJobOptionsModel.StorageBucket).To(Equal(cloudObjectStorageBucketIdentityModel))
				Expect(createImageExportJobOptionsModel.Format).To(Equal(core.StringPtr("qcow2")))
				Expect(createImageExportJobOptionsModel.Name).To(Equal(core.StringPtr("my-image-export")))
				Expect(createImageExportJobOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateImageOptions successfully`, func() {
				// Construct an instance of the ImageAllowedUsePrototype model
				imageAllowedUsePrototypeModel := new(vpcv1.ImageAllowedUsePrototype)
				Expect(imageAllowedUsePrototypeModel).ToNot(BeNil())
				imageAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				imageAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				imageAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")
				Expect(imageAllowedUsePrototypeModel.ApiVersion).To(Equal(core.StringPtr("2024-06-23")))
				Expect(imageAllowedUsePrototypeModel.BareMetalServer).To(Equal(core.StringPtr("enable_secure_boot == true")))
				Expect(imageAllowedUsePrototypeModel.Instance).To(Equal(core.StringPtr("gpu.count > 0 && enable_secure_boot == true")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				Expect(encryptionKeyIdentityModel).ToNot(BeNil())
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")
				Expect(encryptionKeyIdentityModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")))

				// Construct an instance of the ImageFilePrototype model
				imageFilePrototypeModel := new(vpcv1.ImageFilePrototype)
				Expect(imageFilePrototypeModel).ToNot(BeNil())
				imageFilePrototypeModel.Href = core.StringPtr("cos://us-south/custom-image-vpc-bucket/customImage-0.vhd")
				Expect(imageFilePrototypeModel.Href).To(Equal(core.StringPtr("cos://us-south/custom-image-vpc-bucket/customImage-0.vhd")))

				// Construct an instance of the OperatingSystemIdentityByName model
				operatingSystemIdentityModel := new(vpcv1.OperatingSystemIdentityByName)
				Expect(operatingSystemIdentityModel).ToNot(BeNil())
				operatingSystemIdentityModel.Name = core.StringPtr("ubuntu-24-04-amd64")
				Expect(operatingSystemIdentityModel.Name).To(Equal(core.StringPtr("ubuntu-24-04-amd64")))

				// Construct an instance of the ImagePrototypeImageByFile model
				imagePrototypeModel := new(vpcv1.ImagePrototypeImageByFile)
				Expect(imagePrototypeModel).ToNot(BeNil())
				imagePrototypeModel.AllowedUse = imageAllowedUsePrototypeModel
				imagePrototypeModel.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePrototypeModel.Name = core.StringPtr("my-image")
				imagePrototypeModel.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
				imagePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				imagePrototypeModel.EncryptedDataKey = core.StringPtr("testString")
				imagePrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				imagePrototypeModel.File = imageFilePrototypeModel
				imagePrototypeModel.OperatingSystem = operatingSystemIdentityModel
				Expect(imagePrototypeModel.AllowedUse).To(Equal(imageAllowedUsePrototypeModel))
				Expect(imagePrototypeModel.DeprecationAt).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z")))
				Expect(imagePrototypeModel.Name).To(Equal(core.StringPtr("my-image")))
				Expect(imagePrototypeModel.ObsolescenceAt).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z")))
				Expect(imagePrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(imagePrototypeModel.EncryptedDataKey).To(Equal(core.StringPtr("testString")))
				Expect(imagePrototypeModel.EncryptionKey).To(Equal(encryptionKeyIdentityModel))
				Expect(imagePrototypeModel.File).To(Equal(imageFilePrototypeModel))
				Expect(imagePrototypeModel.OperatingSystem).To(Equal(operatingSystemIdentityModel))

				// Construct an instance of the CreateImageOptions model
				var imagePrototype vpcv1.ImagePrototypeIntf = nil
				createImageOptionsModel := vpcService.NewCreateImageOptions(imagePrototype)
				createImageOptionsModel.SetImagePrototype(imagePrototypeModel)
				createImageOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createImageOptionsModel).ToNot(BeNil())
				Expect(createImageOptionsModel.ImagePrototype).To(Equal(imagePrototypeModel))
				Expect(createImageOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateInstanceActionOptions successfully`, func() {
				// Construct an instance of the CreateInstanceActionOptions model
				instanceID := "testString"
				createInstanceActionOptionsType := "reboot"
				createInstanceActionOptionsModel := vpcService.NewCreateInstanceActionOptions(instanceID, createInstanceActionOptionsType)
				createInstanceActionOptionsModel.SetInstanceID("testString")
				createInstanceActionOptionsModel.SetType("reboot")
				createInstanceActionOptionsModel.SetForce(true)
				createInstanceActionOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createInstanceActionOptionsModel).ToNot(BeNil())
				Expect(createInstanceActionOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(createInstanceActionOptionsModel.Type).To(Equal(core.StringPtr("reboot")))
				Expect(createInstanceActionOptionsModel.Force).To(Equal(core.BoolPtr(true)))
				Expect(createInstanceActionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateInstanceConsoleAccessTokenOptions successfully`, func() {
				// Construct an instance of the CreateInstanceConsoleAccessTokenOptions model
				instanceID := "testString"
				createInstanceConsoleAccessTokenOptionsConsoleType := "serial"
				createInstanceConsoleAccessTokenOptionsModel := vpcService.NewCreateInstanceConsoleAccessTokenOptions(instanceID, createInstanceConsoleAccessTokenOptionsConsoleType)
				createInstanceConsoleAccessTokenOptionsModel.SetInstanceID("testString")
				createInstanceConsoleAccessTokenOptionsModel.SetConsoleType("serial")
				createInstanceConsoleAccessTokenOptionsModel.SetForce(false)
				createInstanceConsoleAccessTokenOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createInstanceConsoleAccessTokenOptionsModel).ToNot(BeNil())
				Expect(createInstanceConsoleAccessTokenOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(createInstanceConsoleAccessTokenOptionsModel.ConsoleType).To(Equal(core.StringPtr("serial")))
				Expect(createInstanceConsoleAccessTokenOptionsModel.Force).To(Equal(core.BoolPtr(false)))
				Expect(createInstanceConsoleAccessTokenOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateInstanceGroupManagerActionOptions successfully`, func() {
				// Construct an instance of the InstanceGroupManagerScheduledActionGroupPrototype model
				instanceGroupManagerScheduledActionGroupPrototypeModel := new(vpcv1.InstanceGroupManagerScheduledActionGroupPrototype)
				Expect(instanceGroupManagerScheduledActionGroupPrototypeModel).ToNot(BeNil())
				instanceGroupManagerScheduledActionGroupPrototypeModel.MembershipCount = core.Int64Ptr(int64(10))
				Expect(instanceGroupManagerScheduledActionGroupPrototypeModel.MembershipCount).To(Equal(core.Int64Ptr(int64(10))))

				// Construct an instance of the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup model
				instanceGroupManagerActionPrototypeModel := new(vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup)
				Expect(instanceGroupManagerActionPrototypeModel).ToNot(BeNil())
				instanceGroupManagerActionPrototypeModel.Name = core.StringPtr("my-instance-group-manager-action")
				instanceGroupManagerActionPrototypeModel.CronSpec = core.StringPtr("30 */2 * * 1-5")
				instanceGroupManagerActionPrototypeModel.Group = instanceGroupManagerScheduledActionGroupPrototypeModel
				Expect(instanceGroupManagerActionPrototypeModel.Name).To(Equal(core.StringPtr("my-instance-group-manager-action")))
				Expect(instanceGroupManagerActionPrototypeModel.CronSpec).To(Equal(core.StringPtr("30 */2 * * 1-5")))
				Expect(instanceGroupManagerActionPrototypeModel.Group).To(Equal(instanceGroupManagerScheduledActionGroupPrototypeModel))

				// Construct an instance of the CreateInstanceGroupManagerActionOptions model
				instanceGroupID := "testString"
				instanceGroupManagerID := "testString"
				var instanceGroupManagerActionPrototype vpcv1.InstanceGroupManagerActionPrototypeIntf = nil
				createInstanceGroupManagerActionOptionsModel := vpcService.NewCreateInstanceGroupManagerActionOptions(instanceGroupID, instanceGroupManagerID, instanceGroupManagerActionPrototype)
				createInstanceGroupManagerActionOptionsModel.SetInstanceGroupID("testString")
				createInstanceGroupManagerActionOptionsModel.SetInstanceGroupManagerID("testString")
				createInstanceGroupManagerActionOptionsModel.SetInstanceGroupManagerActionPrototype(instanceGroupManagerActionPrototypeModel)
				createInstanceGroupManagerActionOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createInstanceGroupManagerActionOptionsModel).ToNot(BeNil())
				Expect(createInstanceGroupManagerActionOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(createInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID).To(Equal(core.StringPtr("testString")))
				Expect(createInstanceGroupManagerActionOptionsModel.InstanceGroupManagerActionPrototype).To(Equal(instanceGroupManagerActionPrototypeModel))
				Expect(createInstanceGroupManagerActionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateInstanceGroupManagerOptions successfully`, func() {
				// Construct an instance of the InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype model
				instanceGroupManagerPrototypeModel := new(vpcv1.InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype)
				Expect(instanceGroupManagerPrototypeModel).ToNot(BeNil())
				instanceGroupManagerPrototypeModel.ManagementEnabled = core.BoolPtr(true)
				instanceGroupManagerPrototypeModel.Name = core.StringPtr("my-instance-group-manager")
				instanceGroupManagerPrototypeModel.AggregationWindow = core.Int64Ptr(int64(120))
				instanceGroupManagerPrototypeModel.Cooldown = core.Int64Ptr(int64(210))
				instanceGroupManagerPrototypeModel.ManagerType = core.StringPtr("autoscale")
				instanceGroupManagerPrototypeModel.MaxMembershipCount = core.Int64Ptr(int64(10))
				instanceGroupManagerPrototypeModel.MinMembershipCount = core.Int64Ptr(int64(10))
				Expect(instanceGroupManagerPrototypeModel.ManagementEnabled).To(Equal(core.BoolPtr(true)))
				Expect(instanceGroupManagerPrototypeModel.Name).To(Equal(core.StringPtr("my-instance-group-manager")))
				Expect(instanceGroupManagerPrototypeModel.AggregationWindow).To(Equal(core.Int64Ptr(int64(120))))
				Expect(instanceGroupManagerPrototypeModel.Cooldown).To(Equal(core.Int64Ptr(int64(210))))
				Expect(instanceGroupManagerPrototypeModel.ManagerType).To(Equal(core.StringPtr("autoscale")))
				Expect(instanceGroupManagerPrototypeModel.MaxMembershipCount).To(Equal(core.Int64Ptr(int64(10))))
				Expect(instanceGroupManagerPrototypeModel.MinMembershipCount).To(Equal(core.Int64Ptr(int64(10))))

				// Construct an instance of the CreateInstanceGroupManagerOptions model
				instanceGroupID := "testString"
				var instanceGroupManagerPrototype vpcv1.InstanceGroupManagerPrototypeIntf = nil
				createInstanceGroupManagerOptionsModel := vpcService.NewCreateInstanceGroupManagerOptions(instanceGroupID, instanceGroupManagerPrototype)
				createInstanceGroupManagerOptionsModel.SetInstanceGroupID("testString")
				createInstanceGroupManagerOptionsModel.SetInstanceGroupManagerPrototype(instanceGroupManagerPrototypeModel)
				createInstanceGroupManagerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createInstanceGroupManagerOptionsModel).ToNot(BeNil())
				Expect(createInstanceGroupManagerOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(createInstanceGroupManagerOptionsModel.InstanceGroupManagerPrototype).To(Equal(instanceGroupManagerPrototypeModel))
				Expect(createInstanceGroupManagerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateInstanceGroupManagerPolicyOptions successfully`, func() {
				// Construct an instance of the InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model
				instanceGroupManagerPolicyPrototypeModel := new(vpcv1.InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype)
				Expect(instanceGroupManagerPolicyPrototypeModel).ToNot(BeNil())
				instanceGroupManagerPolicyPrototypeModel.Name = core.StringPtr("my-instance-group-manager-policy")
				instanceGroupManagerPolicyPrototypeModel.MetricType = core.StringPtr("cpu")
				instanceGroupManagerPolicyPrototypeModel.MetricValue = core.Int64Ptr(int64(0))
				instanceGroupManagerPolicyPrototypeModel.PolicyType = core.StringPtr("target")
				Expect(instanceGroupManagerPolicyPrototypeModel.Name).To(Equal(core.StringPtr("my-instance-group-manager-policy")))
				Expect(instanceGroupManagerPolicyPrototypeModel.MetricType).To(Equal(core.StringPtr("cpu")))
				Expect(instanceGroupManagerPolicyPrototypeModel.MetricValue).To(Equal(core.Int64Ptr(int64(0))))
				Expect(instanceGroupManagerPolicyPrototypeModel.PolicyType).To(Equal(core.StringPtr("target")))

				// Construct an instance of the CreateInstanceGroupManagerPolicyOptions model
				instanceGroupID := "testString"
				instanceGroupManagerID := "testString"
				var instanceGroupManagerPolicyPrototype vpcv1.InstanceGroupManagerPolicyPrototypeIntf = nil
				createInstanceGroupManagerPolicyOptionsModel := vpcService.NewCreateInstanceGroupManagerPolicyOptions(instanceGroupID, instanceGroupManagerID, instanceGroupManagerPolicyPrototype)
				createInstanceGroupManagerPolicyOptionsModel.SetInstanceGroupID("testString")
				createInstanceGroupManagerPolicyOptionsModel.SetInstanceGroupManagerID("testString")
				createInstanceGroupManagerPolicyOptionsModel.SetInstanceGroupManagerPolicyPrototype(instanceGroupManagerPolicyPrototypeModel)
				createInstanceGroupManagerPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createInstanceGroupManagerPolicyOptionsModel).ToNot(BeNil())
				Expect(createInstanceGroupManagerPolicyOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(createInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID).To(Equal(core.StringPtr("testString")))
				Expect(createInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerPolicyPrototype).To(Equal(instanceGroupManagerPolicyPrototypeModel))
				Expect(createInstanceGroupManagerPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateInstanceGroupOptions successfully`, func() {
				// Construct an instance of the InstanceTemplateIdentityByID model
				instanceTemplateIdentityModel := new(vpcv1.InstanceTemplateIdentityByID)
				Expect(instanceTemplateIdentityModel).ToNot(BeNil())
				instanceTemplateIdentityModel.ID = core.StringPtr("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")
				Expect(instanceTemplateIdentityModel.ID).To(Equal(core.StringPtr("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")))

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				Expect(subnetIdentityModel).ToNot(BeNil())
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
				Expect(subnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")))

				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				Expect(loadBalancerIdentityModel).ToNot(BeNil())
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
				Expect(loadBalancerIdentityModel.ID).To(Equal(core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")))

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				Expect(loadBalancerPoolIdentityModel).ToNot(BeNil())
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")
				Expect(loadBalancerPoolIdentityModel.ID).To(Equal(core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the CreateInstanceGroupOptions model
				var createInstanceGroupOptionsInstanceTemplate vpcv1.InstanceTemplateIdentityIntf = nil
				createInstanceGroupOptionsSubnets := []vpcv1.SubnetIdentityIntf{}
				createInstanceGroupOptionsModel := vpcService.NewCreateInstanceGroupOptions(createInstanceGroupOptionsInstanceTemplate, createInstanceGroupOptionsSubnets)
				createInstanceGroupOptionsModel.SetInstanceTemplate(instanceTemplateIdentityModel)
				createInstanceGroupOptionsModel.SetSubnets([]vpcv1.SubnetIdentityIntf{subnetIdentityModel})
				createInstanceGroupOptionsModel.SetApplicationPort(int64(22))
				createInstanceGroupOptionsModel.SetLoadBalancer(loadBalancerIdentityModel)
				createInstanceGroupOptionsModel.SetLoadBalancerPool(loadBalancerPoolIdentityModel)
				createInstanceGroupOptionsModel.SetMembershipCount(int64(10))
				createInstanceGroupOptionsModel.SetName("my-instance-group")
				createInstanceGroupOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createInstanceGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createInstanceGroupOptionsModel).ToNot(BeNil())
				Expect(createInstanceGroupOptionsModel.InstanceTemplate).To(Equal(instanceTemplateIdentityModel))
				Expect(createInstanceGroupOptionsModel.Subnets).To(Equal([]vpcv1.SubnetIdentityIntf{subnetIdentityModel}))
				Expect(createInstanceGroupOptionsModel.ApplicationPort).To(Equal(core.Int64Ptr(int64(22))))
				Expect(createInstanceGroupOptionsModel.LoadBalancer).To(Equal(loadBalancerIdentityModel))
				Expect(createInstanceGroupOptionsModel.LoadBalancerPool).To(Equal(loadBalancerPoolIdentityModel))
				Expect(createInstanceGroupOptionsModel.MembershipCount).To(Equal(core.Int64Ptr(int64(10))))
				Expect(createInstanceGroupOptionsModel.Name).To(Equal(core.StringPtr("my-instance-group")))
				Expect(createInstanceGroupOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createInstanceGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateInstanceNetworkAttachmentOptions successfully`, func() {
				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				Expect(virtualNetworkInterfaceIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(virtualNetworkInterfaceIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(virtualNetworkInterfaceIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(virtualNetworkInterfaceIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.7")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.7")))
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				Expect(securityGroupIdentityModel).ToNot(BeNil())
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
				Expect(securityGroupIdentityModel.ID).To(Equal(core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")))

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				Expect(subnetIdentityModel).ToNot(BeNil())
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
				Expect(subnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")))

				// Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext)
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel).ToNot(BeNil())
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing).To(Equal(core.BoolPtr(true)))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat).To(Equal(core.BoolPtr(true)))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips).To(Equal([]vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name).To(Equal(core.StringPtr("my-virtual-network-interface")))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP).To(Equal(virtualNetworkInterfacePrimaryIPPrototypeModel))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode).To(Equal(core.StringPtr("auto")))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups).To(Equal([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet).To(Equal(subnetIdentityModel))

				// Construct an instance of the CreateInstanceNetworkAttachmentOptions model
				instanceID := "testString"
				var createInstanceNetworkAttachmentOptionsVirtualNetworkInterface vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf = nil
				createInstanceNetworkAttachmentOptionsModel := vpcService.NewCreateInstanceNetworkAttachmentOptions(instanceID, createInstanceNetworkAttachmentOptionsVirtualNetworkInterface)
				createInstanceNetworkAttachmentOptionsModel.SetInstanceID("testString")
				createInstanceNetworkAttachmentOptionsModel.SetVirtualNetworkInterface(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel)
				createInstanceNetworkAttachmentOptionsModel.SetName("testString")
				createInstanceNetworkAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createInstanceNetworkAttachmentOptionsModel).ToNot(BeNil())
				Expect(createInstanceNetworkAttachmentOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(createInstanceNetworkAttachmentOptionsModel.VirtualNetworkInterface).To(Equal(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel))
				Expect(createInstanceNetworkAttachmentOptionsModel.Name).To(Equal(core.StringPtr("testString")))
				Expect(createInstanceNetworkAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateInstanceNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				Expect(subnetIdentityModel).ToNot(BeNil())
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
				Expect(subnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")))

				// Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
				networkInterfaceIPPrototypeModel := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
				Expect(networkInterfaceIPPrototypeModel).ToNot(BeNil())
				networkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				networkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				networkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(networkInterfaceIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(networkInterfaceIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(networkInterfaceIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				Expect(securityGroupIdentityModel).ToNot(BeNil())
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
				Expect(securityGroupIdentityModel.ID).To(Equal(core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")))

				// Construct an instance of the CreateInstanceNetworkInterfaceOptions model
				instanceID := "testString"
				var createInstanceNetworkInterfaceOptionsSubnet vpcv1.SubnetIdentityIntf = nil
				createInstanceNetworkInterfaceOptionsModel := vpcService.NewCreateInstanceNetworkInterfaceOptions(instanceID, createInstanceNetworkInterfaceOptionsSubnet)
				createInstanceNetworkInterfaceOptionsModel.SetInstanceID("testString")
				createInstanceNetworkInterfaceOptionsModel.SetSubnet(subnetIdentityModel)
				createInstanceNetworkInterfaceOptionsModel.SetAllowIPSpoofing(true)
				createInstanceNetworkInterfaceOptionsModel.SetName("my-instance-network-interface")
				createInstanceNetworkInterfaceOptionsModel.SetPrimaryIP(networkInterfaceIPPrototypeModel)
				createInstanceNetworkInterfaceOptionsModel.SetSecurityGroups([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel})
				createInstanceNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createInstanceNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(createInstanceNetworkInterfaceOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(createInstanceNetworkInterfaceOptionsModel.Subnet).To(Equal(subnetIdentityModel))
				Expect(createInstanceNetworkInterfaceOptionsModel.AllowIPSpoofing).To(Equal(core.BoolPtr(true)))
				Expect(createInstanceNetworkInterfaceOptionsModel.Name).To(Equal(core.StringPtr("my-instance-network-interface")))
				Expect(createInstanceNetworkInterfaceOptionsModel.PrimaryIP).To(Equal(networkInterfaceIPPrototypeModel))
				Expect(createInstanceNetworkInterfaceOptionsModel.SecurityGroups).To(Equal([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}))
				Expect(createInstanceNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateInstanceOptions successfully`, func() {
				// Construct an instance of the InstanceAvailabilityPolicyPrototype model
				instanceAvailabilityPolicyPrototypeModel := new(vpcv1.InstanceAvailabilityPolicyPrototype)
				Expect(instanceAvailabilityPolicyPrototypeModel).ToNot(BeNil())
				instanceAvailabilityPolicyPrototypeModel.HostFailure = core.StringPtr("restart")
				Expect(instanceAvailabilityPolicyPrototypeModel.HostFailure).To(Equal(core.StringPtr("restart")))

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel).ToNot(BeNil())
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel.Name).To(Equal(core.StringPtr("my-cluster-network-subnet-reserved-ip")))

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				Expect(clusterNetworkSubnetIdentityModel).ToNot(BeNil())
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")
				Expect(clusterNetworkSubnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")))

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel).ToNot(BeNil())
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name).To(Equal(core.StringPtr("my-cluster-network-interface")))
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP).To(Equal(clusterNetworkInterfacePrimaryIPPrototypeModel))
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet).To(Equal(clusterNetworkSubnetIdentityModel))

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext)
				Expect(instanceClusterNetworkAttachmentPrototypeInstanceContextModel).ToNot(BeNil())
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.Name = core.StringPtr("my-instance-network-attachment")
				Expect(instanceClusterNetworkAttachmentPrototypeInstanceContextModel.ClusterNetworkInterface).To(Equal(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel))
				Expect(instanceClusterNetworkAttachmentPrototypeInstanceContextModel.Name).To(Equal(core.StringPtr("my-instance-network-attachment")))

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				Expect(trustedProfileIdentityModel).ToNot(BeNil())
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")
				Expect(trustedProfileIdentityModel.ID).To(Equal(core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")))

				// Construct an instance of the InstanceDefaultTrustedProfilePrototype model
				instanceDefaultTrustedProfilePrototypeModel := new(vpcv1.InstanceDefaultTrustedProfilePrototype)
				Expect(instanceDefaultTrustedProfilePrototypeModel).ToNot(BeNil())
				instanceDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				instanceDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel
				Expect(instanceDefaultTrustedProfilePrototypeModel.AutoLink).To(Equal(core.BoolPtr(false)))
				Expect(instanceDefaultTrustedProfilePrototypeModel.Target).To(Equal(trustedProfileIdentityModel))

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				Expect(keyIdentityModel).ToNot(BeNil())
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")
				Expect(keyIdentityModel.ID).To(Equal(core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")))

				// Construct an instance of the InstanceMetadataServicePrototype model
				instanceMetadataServicePrototypeModel := new(vpcv1.InstanceMetadataServicePrototype)
				Expect(instanceMetadataServicePrototypeModel).ToNot(BeNil())
				instanceMetadataServicePrototypeModel.Enabled = core.BoolPtr(false)
				instanceMetadataServicePrototypeModel.Protocol = core.StringPtr("https")
				instanceMetadataServicePrototypeModel.ResponseHopLimit = core.Int64Ptr(int64(2))
				Expect(instanceMetadataServicePrototypeModel.Enabled).To(Equal(core.BoolPtr(false)))
				Expect(instanceMetadataServicePrototypeModel.Protocol).To(Equal(core.StringPtr("https")))
				Expect(instanceMetadataServicePrototypeModel.ResponseHopLimit).To(Equal(core.Int64Ptr(int64(2))))

				// Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPrototypeModel := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID)
				Expect(instancePlacementTargetPrototypeModel).ToNot(BeNil())
				instancePlacementTargetPrototypeModel.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
				Expect(instancePlacementTargetPrototypeModel.ID).To(Equal(core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")))

				// Construct an instance of the InstanceProfileIdentityByName model
				instanceProfileIdentityModel := new(vpcv1.InstanceProfileIdentityByName)
				Expect(instanceProfileIdentityModel).ToNot(BeNil())
				instanceProfileIdentityModel.Name = core.StringPtr("cx2-16x32")
				Expect(instanceProfileIdentityModel.Name).To(Equal(core.StringPtr("cx2-16x32")))

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				Expect(reservationIdentityModel).ToNot(BeNil())
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				Expect(reservationIdentityModel.ID).To(Equal(core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")))

				// Construct an instance of the InstanceReservationAffinityPrototype model
				instanceReservationAffinityPrototypeModel := new(vpcv1.InstanceReservationAffinityPrototype)
				Expect(instanceReservationAffinityPrototypeModel).ToNot(BeNil())
				instanceReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}
				Expect(instanceReservationAffinityPrototypeModel.Policy).To(Equal(core.StringPtr("automatic")))
				Expect(instanceReservationAffinityPrototypeModel.Pool).To(Equal([]vpcv1.ReservationIdentityIntf{reservationIdentityModel}))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID)
				Expect(volumeAttachmentPrototypeVolumeModel).ToNot(BeNil())
				volumeAttachmentPrototypeVolumeModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
				Expect(volumeAttachmentPrototypeVolumeModel.ID).To(Equal(core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")))

				// Construct an instance of the VolumeAttachmentPrototype model
				volumeAttachmentPrototypeModel := new(vpcv1.VolumeAttachmentPrototype)
				Expect(volumeAttachmentPrototypeModel).ToNot(BeNil())
				volumeAttachmentPrototypeModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				volumeAttachmentPrototypeModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeModel.Volume = volumeAttachmentPrototypeVolumeModel
				Expect(volumeAttachmentPrototypeModel.DeleteVolumeOnInstanceDelete).To(Equal(core.BoolPtr(false)))
				Expect(volumeAttachmentPrototypeModel.Name).To(Equal(core.StringPtr("my-volume-attachment")))
				Expect(volumeAttachmentPrototypeModel.Volume).To(Equal(volumeAttachmentPrototypeVolumeModel))

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				Expect(vpcIdentityModel).ToNot(BeNil())
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				Expect(vpcIdentityModel.ID).To(Equal(core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))

				// Construct an instance of the VolumeAllowedUsePrototype model
				volumeAllowedUsePrototypeModel := new(vpcv1.VolumeAllowedUsePrototype)
				Expect(volumeAllowedUsePrototypeModel).ToNot(BeNil())
				volumeAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")
				Expect(volumeAllowedUsePrototypeModel.ApiVersion).To(Equal(core.StringPtr("2024-06-23")))
				Expect(volumeAllowedUsePrototypeModel.BareMetalServer).To(Equal(core.StringPtr("enable_secure_boot == true")))
				Expect(volumeAllowedUsePrototypeModel.Instance).To(Equal(core.StringPtr("gpu.count > 0 && enable_secure_boot == true")))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				Expect(encryptionKeyIdentityModel).ToNot(BeNil())
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")
				Expect(encryptionKeyIdentityModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")))

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				Expect(volumeProfileIdentityModel).ToNot(BeNil())
				volumeProfileIdentityModel.Name = core.StringPtr("general-purpose")
				Expect(volumeProfileIdentityModel.Name).To(Equal(core.StringPtr("general-purpose")))

				// Construct an instance of the VolumePrototypeInstanceByImageContext model
				volumePrototypeInstanceByImageContextModel := new(vpcv1.VolumePrototypeInstanceByImageContext)
				Expect(volumePrototypeInstanceByImageContextModel).ToNot(BeNil())
				volumePrototypeInstanceByImageContextModel.AllowedUse = volumeAllowedUsePrototypeModel
				volumePrototypeInstanceByImageContextModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeInstanceByImageContextModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeInstanceByImageContextModel.EncryptionKey = encryptionKeyIdentityModel
				volumePrototypeInstanceByImageContextModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeInstanceByImageContextModel.Name = core.StringPtr("my-volume")
				volumePrototypeInstanceByImageContextModel.Profile = volumeProfileIdentityModel
				volumePrototypeInstanceByImageContextModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeInstanceByImageContextModel.UserTags = []string{}
				Expect(volumePrototypeInstanceByImageContextModel.AllowedUse).To(Equal(volumeAllowedUsePrototypeModel))
				Expect(volumePrototypeInstanceByImageContextModel.Bandwidth).To(Equal(core.Int64Ptr(int64(1000))))
				Expect(volumePrototypeInstanceByImageContextModel.Capacity).To(Equal(core.Int64Ptr(int64(100))))
				Expect(volumePrototypeInstanceByImageContextModel.EncryptionKey).To(Equal(encryptionKeyIdentityModel))
				Expect(volumePrototypeInstanceByImageContextModel.Iops).To(Equal(core.Int64Ptr(int64(10000))))
				Expect(volumePrototypeInstanceByImageContextModel.Name).To(Equal(core.StringPtr("my-volume")))
				Expect(volumePrototypeInstanceByImageContextModel.Profile).To(Equal(volumeProfileIdentityModel))
				Expect(volumePrototypeInstanceByImageContextModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(volumePrototypeInstanceByImageContextModel.UserTags).To(Equal([]string{}))

				// Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model
				volumeAttachmentPrototypeInstanceByImageContextModel := new(vpcv1.VolumeAttachmentPrototypeInstanceByImageContext)
				Expect(volumeAttachmentPrototypeInstanceByImageContextModel).ToNot(BeNil())
				volumeAttachmentPrototypeInstanceByImageContextModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPrototypeInstanceByImageContextModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeInstanceByImageContextModel.Volume = volumePrototypeInstanceByImageContextModel
				Expect(volumeAttachmentPrototypeInstanceByImageContextModel.DeleteVolumeOnInstanceDelete).To(Equal(core.BoolPtr(true)))
				Expect(volumeAttachmentPrototypeInstanceByImageContextModel.Name).To(Equal(core.StringPtr("my-volume-attachment")))
				Expect(volumeAttachmentPrototypeInstanceByImageContextModel.Volume).To(Equal(volumePrototypeInstanceByImageContextModel))

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				Expect(imageIdentityModel).ToNot(BeNil())
				imageIdentityModel.ID = core.StringPtr("r006-02c73baf-9abb-493d-9e41-d0f1866f4051")
				Expect(imageIdentityModel.ID).To(Equal(core.StringPtr("r006-02c73baf-9abb-493d-9e41-d0f1866f4051")))

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				Expect(virtualNetworkInterfaceIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(virtualNetworkInterfaceIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(virtualNetworkInterfaceIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(virtualNetworkInterfaceIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				Expect(securityGroupIdentityModel).ToNot(BeNil())
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
				Expect(securityGroupIdentityModel.ID).To(Equal(core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")))

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				Expect(subnetIdentityModel).ToNot(BeNil())
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
				Expect(subnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")))

				// Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext)
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel).ToNot(BeNil())
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing).To(Equal(core.BoolPtr(true)))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat).To(Equal(core.BoolPtr(true)))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips).To(Equal([]vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name).To(Equal(core.StringPtr("my-virtual-network-interface")))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP).To(Equal(virtualNetworkInterfacePrimaryIPPrototypeModel))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode).To(Equal(core.StringPtr("auto")))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups).To(Equal([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet).To(Equal(subnetIdentityModel))

				// Construct an instance of the InstanceNetworkAttachmentPrototype model
				instanceNetworkAttachmentPrototypeModel := new(vpcv1.InstanceNetworkAttachmentPrototype)
				Expect(instanceNetworkAttachmentPrototypeModel).ToNot(BeNil())
				instanceNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-instance-network-attachment")
				instanceNetworkAttachmentPrototypeModel.VirtualNetworkInterface = instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				Expect(instanceNetworkAttachmentPrototypeModel.Name).To(Equal(core.StringPtr("my-instance-network-attachment")))
				Expect(instanceNetworkAttachmentPrototypeModel.VirtualNetworkInterface).To(Equal(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel))

				// Construct an instance of the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment model
				instancePrototypeModel := new(vpcv1.InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment)
				Expect(instancePrototypeModel).ToNot(BeNil())
				instancePrototypeModel.AvailabilityPolicy = instanceAvailabilityPolicyPrototypeModel
				instancePrototypeModel.ClusterNetworkAttachments = []vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext{*instanceClusterNetworkAttachmentPrototypeInstanceContextModel}
				instancePrototypeModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instancePrototypeModel.DefaultTrustedProfile = instanceDefaultTrustedProfilePrototypeModel
				instancePrototypeModel.EnableSecureBoot = core.BoolPtr(true)
				instancePrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				instancePrototypeModel.MetadataService = instanceMetadataServicePrototypeModel
				instancePrototypeModel.Name = core.StringPtr("my-instance")
				instancePrototypeModel.PlacementTarget = instancePlacementTargetPrototypeModel
				instancePrototypeModel.Profile = instanceProfileIdentityModel
				instancePrototypeModel.ReservationAffinity = instanceReservationAffinityPrototypeModel
				instancePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				instancePrototypeModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instancePrototypeModel.UserData = core.StringPtr("testString")
				instancePrototypeModel.VolumeAttachments = []vpcv1.VolumeAttachmentPrototype{*volumeAttachmentPrototypeModel}
				instancePrototypeModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instancePrototypeModel.VPC = vpcIdentityModel
				instancePrototypeModel.BootVolumeAttachment = volumeAttachmentPrototypeInstanceByImageContextModel
				instancePrototypeModel.Image = imageIdentityModel
				instancePrototypeModel.Zone = zoneIdentityModel
				instancePrototypeModel.NetworkAttachments = []vpcv1.InstanceNetworkAttachmentPrototype{*instanceNetworkAttachmentPrototypeModel}
				instancePrototypeModel.PrimaryNetworkAttachment = instanceNetworkAttachmentPrototypeModel
				Expect(instancePrototypeModel.AvailabilityPolicy).To(Equal(instanceAvailabilityPolicyPrototypeModel))
				Expect(instancePrototypeModel.ClusterNetworkAttachments).To(Equal([]vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext{*instanceClusterNetworkAttachmentPrototypeInstanceContextModel}))
				Expect(instancePrototypeModel.ConfidentialComputeMode).To(Equal(core.StringPtr("disabled")))
				Expect(instancePrototypeModel.DefaultTrustedProfile).To(Equal(instanceDefaultTrustedProfilePrototypeModel))
				Expect(instancePrototypeModel.EnableSecureBoot).To(Equal(core.BoolPtr(true)))
				Expect(instancePrototypeModel.Keys).To(Equal([]vpcv1.KeyIdentityIntf{keyIdentityModel}))
				Expect(instancePrototypeModel.MetadataService).To(Equal(instanceMetadataServicePrototypeModel))
				Expect(instancePrototypeModel.Name).To(Equal(core.StringPtr("my-instance")))
				Expect(instancePrototypeModel.PlacementTarget).To(Equal(instancePlacementTargetPrototypeModel))
				Expect(instancePrototypeModel.Profile).To(Equal(instanceProfileIdentityModel))
				Expect(instancePrototypeModel.ReservationAffinity).To(Equal(instanceReservationAffinityPrototypeModel))
				Expect(instancePrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(instancePrototypeModel.TotalVolumeBandwidth).To(Equal(core.Int64Ptr(int64(500))))
				Expect(instancePrototypeModel.UserData).To(Equal(core.StringPtr("testString")))
				Expect(instancePrototypeModel.VolumeAttachments).To(Equal([]vpcv1.VolumeAttachmentPrototype{*volumeAttachmentPrototypeModel}))
				Expect(instancePrototypeModel.VolumeBandwidthQosMode).To(Equal(core.StringPtr("pooled")))
				Expect(instancePrototypeModel.VPC).To(Equal(vpcIdentityModel))
				Expect(instancePrototypeModel.BootVolumeAttachment).To(Equal(volumeAttachmentPrototypeInstanceByImageContextModel))
				Expect(instancePrototypeModel.Image).To(Equal(imageIdentityModel))
				Expect(instancePrototypeModel.Zone).To(Equal(zoneIdentityModel))
				Expect(instancePrototypeModel.NetworkAttachments).To(Equal([]vpcv1.InstanceNetworkAttachmentPrototype{*instanceNetworkAttachmentPrototypeModel}))
				Expect(instancePrototypeModel.PrimaryNetworkAttachment).To(Equal(instanceNetworkAttachmentPrototypeModel))

				// Construct an instance of the CreateInstanceOptions model
				var instancePrototype vpcv1.InstancePrototypeIntf = nil
				createInstanceOptionsModel := vpcService.NewCreateInstanceOptions(instancePrototype)
				createInstanceOptionsModel.SetInstancePrototype(instancePrototypeModel)
				createInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createInstanceOptionsModel).ToNot(BeNil())
				Expect(createInstanceOptionsModel.InstancePrototype).To(Equal(instancePrototypeModel))
				Expect(createInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateInstanceTemplateOptions successfully`, func() {
				// Construct an instance of the InstanceAvailabilityPolicyPrototype model
				instanceAvailabilityPolicyPrototypeModel := new(vpcv1.InstanceAvailabilityPolicyPrototype)
				Expect(instanceAvailabilityPolicyPrototypeModel).ToNot(BeNil())
				instanceAvailabilityPolicyPrototypeModel.HostFailure = core.StringPtr("restart")
				Expect(instanceAvailabilityPolicyPrototypeModel.HostFailure).To(Equal(core.StringPtr("restart")))

				// Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model
				clusterNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel).ToNot(BeNil())
				clusterNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				clusterNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(clusterNetworkInterfacePrimaryIPPrototypeModel.Name).To(Equal(core.StringPtr("my-cluster-network-subnet-reserved-ip")))

				// Construct an instance of the ClusterNetworkSubnetIdentityByID model
				clusterNetworkSubnetIdentityModel := new(vpcv1.ClusterNetworkSubnetIdentityByID)
				Expect(clusterNetworkSubnetIdentityModel).ToNot(BeNil())
				clusterNetworkSubnetIdentityModel.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")
				Expect(clusterNetworkSubnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")))

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel).ToNot(BeNil())
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name = core.StringPtr("my-cluster-network-interface")
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP = clusterNetworkInterfacePrimaryIPPrototypeModel
				instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet = clusterNetworkSubnetIdentityModel
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Name).To(Equal(core.StringPtr("my-cluster-network-interface")))
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.PrimaryIP).To(Equal(clusterNetworkInterfacePrimaryIPPrototypeModel))
				Expect(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel.Subnet).To(Equal(clusterNetworkSubnetIdentityModel))

				// Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext)
				Expect(instanceClusterNetworkAttachmentPrototypeInstanceContextModel).ToNot(BeNil())
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.ClusterNetworkInterface = instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel
				instanceClusterNetworkAttachmentPrototypeInstanceContextModel.Name = core.StringPtr("my-instance-network-attachment")
				Expect(instanceClusterNetworkAttachmentPrototypeInstanceContextModel.ClusterNetworkInterface).To(Equal(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel))
				Expect(instanceClusterNetworkAttachmentPrototypeInstanceContextModel.Name).To(Equal(core.StringPtr("my-instance-network-attachment")))

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				Expect(trustedProfileIdentityModel).ToNot(BeNil())
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")
				Expect(trustedProfileIdentityModel.ID).To(Equal(core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")))

				// Construct an instance of the InstanceDefaultTrustedProfilePrototype model
				instanceDefaultTrustedProfilePrototypeModel := new(vpcv1.InstanceDefaultTrustedProfilePrototype)
				Expect(instanceDefaultTrustedProfilePrototypeModel).ToNot(BeNil())
				instanceDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				instanceDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel
				Expect(instanceDefaultTrustedProfilePrototypeModel.AutoLink).To(Equal(core.BoolPtr(false)))
				Expect(instanceDefaultTrustedProfilePrototypeModel.Target).To(Equal(trustedProfileIdentityModel))

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				Expect(keyIdentityModel).ToNot(BeNil())
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")
				Expect(keyIdentityModel.ID).To(Equal(core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")))

				// Construct an instance of the InstanceMetadataServicePrototype model
				instanceMetadataServicePrototypeModel := new(vpcv1.InstanceMetadataServicePrototype)
				Expect(instanceMetadataServicePrototypeModel).ToNot(BeNil())
				instanceMetadataServicePrototypeModel.Enabled = core.BoolPtr(false)
				instanceMetadataServicePrototypeModel.Protocol = core.StringPtr("https")
				instanceMetadataServicePrototypeModel.ResponseHopLimit = core.Int64Ptr(int64(2))
				Expect(instanceMetadataServicePrototypeModel.Enabled).To(Equal(core.BoolPtr(false)))
				Expect(instanceMetadataServicePrototypeModel.Protocol).To(Equal(core.StringPtr("https")))
				Expect(instanceMetadataServicePrototypeModel.ResponseHopLimit).To(Equal(core.Int64Ptr(int64(2))))

				// Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID model
				instancePlacementTargetPrototypeModel := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID)
				Expect(instancePlacementTargetPrototypeModel).ToNot(BeNil())
				instancePlacementTargetPrototypeModel.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
				Expect(instancePlacementTargetPrototypeModel.ID).To(Equal(core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")))

				// Construct an instance of the InstanceProfileIdentityByName model
				instanceProfileIdentityModel := new(vpcv1.InstanceProfileIdentityByName)
				Expect(instanceProfileIdentityModel).ToNot(BeNil())
				instanceProfileIdentityModel.Name = core.StringPtr("cx2-16x32")
				Expect(instanceProfileIdentityModel.Name).To(Equal(core.StringPtr("cx2-16x32")))

				// Construct an instance of the ReservationIdentityByID model
				reservationIdentityModel := new(vpcv1.ReservationIdentityByID)
				Expect(reservationIdentityModel).ToNot(BeNil())
				reservationIdentityModel.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				Expect(reservationIdentityModel.ID).To(Equal(core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")))

				// Construct an instance of the InstanceReservationAffinityPrototype model
				instanceReservationAffinityPrototypeModel := new(vpcv1.InstanceReservationAffinityPrototype)
				Expect(instanceReservationAffinityPrototypeModel).ToNot(BeNil())
				instanceReservationAffinityPrototypeModel.Policy = core.StringPtr("automatic")
				instanceReservationAffinityPrototypeModel.Pool = []vpcv1.ReservationIdentityIntf{reservationIdentityModel}
				Expect(instanceReservationAffinityPrototypeModel.Policy).To(Equal(core.StringPtr("automatic")))
				Expect(instanceReservationAffinityPrototypeModel.Pool).To(Equal([]vpcv1.ReservationIdentityIntf{reservationIdentityModel}))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID)
				Expect(volumeAttachmentPrototypeVolumeModel).ToNot(BeNil())
				volumeAttachmentPrototypeVolumeModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
				Expect(volumeAttachmentPrototypeVolumeModel.ID).To(Equal(core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")))

				// Construct an instance of the VolumeAttachmentPrototype model
				volumeAttachmentPrototypeModel := new(vpcv1.VolumeAttachmentPrototype)
				Expect(volumeAttachmentPrototypeModel).ToNot(BeNil())
				volumeAttachmentPrototypeModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
				volumeAttachmentPrototypeModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeModel.Volume = volumeAttachmentPrototypeVolumeModel
				Expect(volumeAttachmentPrototypeModel.DeleteVolumeOnInstanceDelete).To(Equal(core.BoolPtr(false)))
				Expect(volumeAttachmentPrototypeModel.Name).To(Equal(core.StringPtr("my-volume-attachment")))
				Expect(volumeAttachmentPrototypeModel.Volume).To(Equal(volumeAttachmentPrototypeVolumeModel))

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				Expect(vpcIdentityModel).ToNot(BeNil())
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				Expect(vpcIdentityModel.ID).To(Equal(core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))

				// Construct an instance of the VolumeAllowedUsePrototype model
				volumeAllowedUsePrototypeModel := new(vpcv1.VolumeAllowedUsePrototype)
				Expect(volumeAllowedUsePrototypeModel).ToNot(BeNil())
				volumeAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				volumeAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				volumeAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")
				Expect(volumeAllowedUsePrototypeModel.ApiVersion).To(Equal(core.StringPtr("2024-06-23")))
				Expect(volumeAllowedUsePrototypeModel.BareMetalServer).To(Equal(core.StringPtr("enable_secure_boot == true")))
				Expect(volumeAllowedUsePrototypeModel.Instance).To(Equal(core.StringPtr("gpu.count > 0 && enable_secure_boot == true")))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				Expect(encryptionKeyIdentityModel).ToNot(BeNil())
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")
				Expect(encryptionKeyIdentityModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")))

				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				Expect(volumeProfileIdentityModel).ToNot(BeNil())
				volumeProfileIdentityModel.Name = core.StringPtr("general-purpose")
				Expect(volumeProfileIdentityModel.Name).To(Equal(core.StringPtr("general-purpose")))

				// Construct an instance of the VolumePrototypeInstanceByImageContext model
				volumePrototypeInstanceByImageContextModel := new(vpcv1.VolumePrototypeInstanceByImageContext)
				Expect(volumePrototypeInstanceByImageContextModel).ToNot(BeNil())
				volumePrototypeInstanceByImageContextModel.AllowedUse = volumeAllowedUsePrototypeModel
				volumePrototypeInstanceByImageContextModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeInstanceByImageContextModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeInstanceByImageContextModel.EncryptionKey = encryptionKeyIdentityModel
				volumePrototypeInstanceByImageContextModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeInstanceByImageContextModel.Name = core.StringPtr("my-volume")
				volumePrototypeInstanceByImageContextModel.Profile = volumeProfileIdentityModel
				volumePrototypeInstanceByImageContextModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeInstanceByImageContextModel.UserTags = []string{}
				Expect(volumePrototypeInstanceByImageContextModel.AllowedUse).To(Equal(volumeAllowedUsePrototypeModel))
				Expect(volumePrototypeInstanceByImageContextModel.Bandwidth).To(Equal(core.Int64Ptr(int64(1000))))
				Expect(volumePrototypeInstanceByImageContextModel.Capacity).To(Equal(core.Int64Ptr(int64(100))))
				Expect(volumePrototypeInstanceByImageContextModel.EncryptionKey).To(Equal(encryptionKeyIdentityModel))
				Expect(volumePrototypeInstanceByImageContextModel.Iops).To(Equal(core.Int64Ptr(int64(10000))))
				Expect(volumePrototypeInstanceByImageContextModel.Name).To(Equal(core.StringPtr("my-volume")))
				Expect(volumePrototypeInstanceByImageContextModel.Profile).To(Equal(volumeProfileIdentityModel))
				Expect(volumePrototypeInstanceByImageContextModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(volumePrototypeInstanceByImageContextModel.UserTags).To(Equal([]string{}))

				// Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model
				volumeAttachmentPrototypeInstanceByImageContextModel := new(vpcv1.VolumeAttachmentPrototypeInstanceByImageContext)
				Expect(volumeAttachmentPrototypeInstanceByImageContextModel).ToNot(BeNil())
				volumeAttachmentPrototypeInstanceByImageContextModel.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
				volumeAttachmentPrototypeInstanceByImageContextModel.Name = core.StringPtr("my-volume-attachment")
				volumeAttachmentPrototypeInstanceByImageContextModel.Volume = volumePrototypeInstanceByImageContextModel
				Expect(volumeAttachmentPrototypeInstanceByImageContextModel.DeleteVolumeOnInstanceDelete).To(Equal(core.BoolPtr(true)))
				Expect(volumeAttachmentPrototypeInstanceByImageContextModel.Name).To(Equal(core.StringPtr("my-volume-attachment")))
				Expect(volumeAttachmentPrototypeInstanceByImageContextModel.Volume).To(Equal(volumePrototypeInstanceByImageContextModel))

				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				Expect(imageIdentityModel).ToNot(BeNil())
				imageIdentityModel.ID = core.StringPtr("r006-02c73baf-9abb-493d-9e41-d0f1866f4051")
				Expect(imageIdentityModel.ID).To(Equal(core.StringPtr("r006-02c73baf-9abb-493d-9e41-d0f1866f4051")))

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				Expect(virtualNetworkInterfaceIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(virtualNetworkInterfaceIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(virtualNetworkInterfaceIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(virtualNetworkInterfaceIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				Expect(securityGroupIdentityModel).ToNot(BeNil())
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
				Expect(securityGroupIdentityModel.ID).To(Equal(core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")))

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				Expect(subnetIdentityModel).ToNot(BeNil())
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
				Expect(subnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")))

				// Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext)
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel).ToNot(BeNil())
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete = core.BoolPtr(false)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat = core.BoolPtr(true)
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name = core.StringPtr("my-virtual-network-interface")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup = resourceGroupIdentityModel
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet = subnetIdentityModel
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AllowIPSpoofing).To(Equal(core.BoolPtr(true)))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.EnableInfrastructureNat).To(Equal(core.BoolPtr(true)))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Ips).To(Equal([]vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Name).To(Equal(core.StringPtr("my-virtual-network-interface")))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.PrimaryIP).To(Equal(virtualNetworkInterfacePrimaryIPPrototypeModel))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ProtocolStateFilteringMode).To(Equal(core.StringPtr("auto")))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.SecurityGroups).To(Equal([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}))
				Expect(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel.Subnet).To(Equal(subnetIdentityModel))

				// Construct an instance of the InstanceNetworkAttachmentPrototype model
				instanceNetworkAttachmentPrototypeModel := new(vpcv1.InstanceNetworkAttachmentPrototype)
				Expect(instanceNetworkAttachmentPrototypeModel).ToNot(BeNil())
				instanceNetworkAttachmentPrototypeModel.Name = core.StringPtr("my-instance-network-attachment")
				instanceNetworkAttachmentPrototypeModel.VirtualNetworkInterface = instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel
				Expect(instanceNetworkAttachmentPrototypeModel.Name).To(Equal(core.StringPtr("my-instance-network-attachment")))
				Expect(instanceNetworkAttachmentPrototypeModel.VirtualNetworkInterface).To(Equal(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel))

				// Construct an instance of the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment model
				instanceTemplatePrototypeModel := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment)
				Expect(instanceTemplatePrototypeModel).ToNot(BeNil())
				instanceTemplatePrototypeModel.AvailabilityPolicy = instanceAvailabilityPolicyPrototypeModel
				instanceTemplatePrototypeModel.ClusterNetworkAttachments = []vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext{*instanceClusterNetworkAttachmentPrototypeInstanceContextModel}
				instanceTemplatePrototypeModel.ConfidentialComputeMode = core.StringPtr("disabled")
				instanceTemplatePrototypeModel.DefaultTrustedProfile = instanceDefaultTrustedProfilePrototypeModel
				instanceTemplatePrototypeModel.EnableSecureBoot = core.BoolPtr(true)
				instanceTemplatePrototypeModel.Keys = []vpcv1.KeyIdentityIntf{keyIdentityModel}
				instanceTemplatePrototypeModel.MetadataService = instanceMetadataServicePrototypeModel
				instanceTemplatePrototypeModel.Name = core.StringPtr("my-instance")
				instanceTemplatePrototypeModel.PlacementTarget = instancePlacementTargetPrototypeModel
				instanceTemplatePrototypeModel.Profile = instanceProfileIdentityModel
				instanceTemplatePrototypeModel.ReservationAffinity = instanceReservationAffinityPrototypeModel
				instanceTemplatePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				instanceTemplatePrototypeModel.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
				instanceTemplatePrototypeModel.UserData = core.StringPtr("testString")
				instanceTemplatePrototypeModel.VolumeAttachments = []vpcv1.VolumeAttachmentPrototype{*volumeAttachmentPrototypeModel}
				instanceTemplatePrototypeModel.VolumeBandwidthQosMode = core.StringPtr("pooled")
				instanceTemplatePrototypeModel.VPC = vpcIdentityModel
				instanceTemplatePrototypeModel.BootVolumeAttachment = volumeAttachmentPrototypeInstanceByImageContextModel
				instanceTemplatePrototypeModel.Image = imageIdentityModel
				instanceTemplatePrototypeModel.Zone = zoneIdentityModel
				instanceTemplatePrototypeModel.NetworkAttachments = []vpcv1.InstanceNetworkAttachmentPrototype{*instanceNetworkAttachmentPrototypeModel}
				instanceTemplatePrototypeModel.PrimaryNetworkAttachment = instanceNetworkAttachmentPrototypeModel
				Expect(instanceTemplatePrototypeModel.AvailabilityPolicy).To(Equal(instanceAvailabilityPolicyPrototypeModel))
				Expect(instanceTemplatePrototypeModel.ClusterNetworkAttachments).To(Equal([]vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext{*instanceClusterNetworkAttachmentPrototypeInstanceContextModel}))
				Expect(instanceTemplatePrototypeModel.ConfidentialComputeMode).To(Equal(core.StringPtr("disabled")))
				Expect(instanceTemplatePrototypeModel.DefaultTrustedProfile).To(Equal(instanceDefaultTrustedProfilePrototypeModel))
				Expect(instanceTemplatePrototypeModel.EnableSecureBoot).To(Equal(core.BoolPtr(true)))
				Expect(instanceTemplatePrototypeModel.Keys).To(Equal([]vpcv1.KeyIdentityIntf{keyIdentityModel}))
				Expect(instanceTemplatePrototypeModel.MetadataService).To(Equal(instanceMetadataServicePrototypeModel))
				Expect(instanceTemplatePrototypeModel.Name).To(Equal(core.StringPtr("my-instance")))
				Expect(instanceTemplatePrototypeModel.PlacementTarget).To(Equal(instancePlacementTargetPrototypeModel))
				Expect(instanceTemplatePrototypeModel.Profile).To(Equal(instanceProfileIdentityModel))
				Expect(instanceTemplatePrototypeModel.ReservationAffinity).To(Equal(instanceReservationAffinityPrototypeModel))
				Expect(instanceTemplatePrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(instanceTemplatePrototypeModel.TotalVolumeBandwidth).To(Equal(core.Int64Ptr(int64(500))))
				Expect(instanceTemplatePrototypeModel.UserData).To(Equal(core.StringPtr("testString")))
				Expect(instanceTemplatePrototypeModel.VolumeAttachments).To(Equal([]vpcv1.VolumeAttachmentPrototype{*volumeAttachmentPrototypeModel}))
				Expect(instanceTemplatePrototypeModel.VolumeBandwidthQosMode).To(Equal(core.StringPtr("pooled")))
				Expect(instanceTemplatePrototypeModel.VPC).To(Equal(vpcIdentityModel))
				Expect(instanceTemplatePrototypeModel.BootVolumeAttachment).To(Equal(volumeAttachmentPrototypeInstanceByImageContextModel))
				Expect(instanceTemplatePrototypeModel.Image).To(Equal(imageIdentityModel))
				Expect(instanceTemplatePrototypeModel.Zone).To(Equal(zoneIdentityModel))
				Expect(instanceTemplatePrototypeModel.NetworkAttachments).To(Equal([]vpcv1.InstanceNetworkAttachmentPrototype{*instanceNetworkAttachmentPrototypeModel}))
				Expect(instanceTemplatePrototypeModel.PrimaryNetworkAttachment).To(Equal(instanceNetworkAttachmentPrototypeModel))

				// Construct an instance of the CreateInstanceTemplateOptions model
				var instanceTemplatePrototype vpcv1.InstanceTemplatePrototypeIntf = nil
				createInstanceTemplateOptionsModel := vpcService.NewCreateInstanceTemplateOptions(instanceTemplatePrototype)
				createInstanceTemplateOptionsModel.SetInstanceTemplatePrototype(instanceTemplatePrototypeModel)
				createInstanceTemplateOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createInstanceTemplateOptionsModel).ToNot(BeNil())
				Expect(createInstanceTemplateOptionsModel.InstanceTemplatePrototype).To(Equal(instanceTemplatePrototypeModel))
				Expect(createInstanceTemplateOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateInstanceVolumeAttachmentOptions successfully`, func() {
				// Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID model
				volumeAttachmentPrototypeVolumeModel := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID)
				Expect(volumeAttachmentPrototypeVolumeModel).ToNot(BeNil())
				volumeAttachmentPrototypeVolumeModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
				Expect(volumeAttachmentPrototypeVolumeModel.ID).To(Equal(core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")))

				// Construct an instance of the CreateInstanceVolumeAttachmentOptions model
				instanceID := "testString"
				var createInstanceVolumeAttachmentOptionsVolume vpcv1.VolumeAttachmentPrototypeVolumeIntf = nil
				createInstanceVolumeAttachmentOptionsModel := vpcService.NewCreateInstanceVolumeAttachmentOptions(instanceID, createInstanceVolumeAttachmentOptionsVolume)
				createInstanceVolumeAttachmentOptionsModel.SetInstanceID("testString")
				createInstanceVolumeAttachmentOptionsModel.SetVolume(volumeAttachmentPrototypeVolumeModel)
				createInstanceVolumeAttachmentOptionsModel.SetDeleteVolumeOnInstanceDelete(false)
				createInstanceVolumeAttachmentOptionsModel.SetName("my-volume-attachment")
				createInstanceVolumeAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createInstanceVolumeAttachmentOptionsModel).ToNot(BeNil())
				Expect(createInstanceVolumeAttachmentOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(createInstanceVolumeAttachmentOptionsModel.Volume).To(Equal(volumeAttachmentPrototypeVolumeModel))
				Expect(createInstanceVolumeAttachmentOptionsModel.DeleteVolumeOnInstanceDelete).To(Equal(core.BoolPtr(false)))
				Expect(createInstanceVolumeAttachmentOptionsModel.Name).To(Equal(core.StringPtr("my-volume-attachment")))
				Expect(createInstanceVolumeAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateIpsecPolicyOptions successfully`, func() {
				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the CreateIpsecPolicyOptions model
				createIpsecPolicyOptionsAuthenticationAlgorithm := "disabled"
				createIpsecPolicyOptionsEncryptionAlgorithm := "aes128"
				createIpsecPolicyOptionsPfs := "disabled"
				createIpsecPolicyOptionsModel := vpcService.NewCreateIpsecPolicyOptions(createIpsecPolicyOptionsAuthenticationAlgorithm, createIpsecPolicyOptionsEncryptionAlgorithm, createIpsecPolicyOptionsPfs)
				createIpsecPolicyOptionsModel.SetAuthenticationAlgorithm("disabled")
				createIpsecPolicyOptionsModel.SetEncryptionAlgorithm("aes128")
				createIpsecPolicyOptionsModel.SetPfs("disabled")
				createIpsecPolicyOptionsModel.SetKeyLifetime(int64(3600))
				createIpsecPolicyOptionsModel.SetName("my-ipsec-policy")
				createIpsecPolicyOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createIpsecPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createIpsecPolicyOptionsModel).ToNot(BeNil())
				Expect(createIpsecPolicyOptionsModel.AuthenticationAlgorithm).To(Equal(core.StringPtr("disabled")))
				Expect(createIpsecPolicyOptionsModel.EncryptionAlgorithm).To(Equal(core.StringPtr("aes128")))
				Expect(createIpsecPolicyOptionsModel.Pfs).To(Equal(core.StringPtr("disabled")))
				Expect(createIpsecPolicyOptionsModel.KeyLifetime).To(Equal(core.Int64Ptr(int64(3600))))
				Expect(createIpsecPolicyOptionsModel.Name).To(Equal(core.StringPtr("my-ipsec-policy")))
				Expect(createIpsecPolicyOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createIpsecPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateKeyOptions successfully`, func() {
				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the CreateKeyOptions model
				createKeyOptionsPublicKey := "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En"
				createKeyOptionsModel := vpcService.NewCreateKeyOptions(createKeyOptionsPublicKey)
				createKeyOptionsModel.SetPublicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En")
				createKeyOptionsModel.SetName("my-key-1")
				createKeyOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createKeyOptionsModel.SetType("rsa")
				createKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createKeyOptionsModel).ToNot(BeNil())
				Expect(createKeyOptionsModel.PublicKey).To(Equal(core.StringPtr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En")))
				Expect(createKeyOptionsModel.Name).To(Equal(core.StringPtr("my-key-1")))
				Expect(createKeyOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createKeyOptionsModel.Type).To(Equal(core.StringPtr("rsa")))
				Expect(createKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateLoadBalancerListenerOptions successfully`, func() {
				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				Expect(certificateInstanceIdentityModel).ToNot(BeNil())
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")
				Expect(certificateInstanceIdentityModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")))

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				Expect(loadBalancerPoolIdentityModel).ToNot(BeNil())
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")
				Expect(loadBalancerPoolIdentityModel.ID).To(Equal(core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")))

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				Expect(loadBalancerListenerIdentityModel).ToNot(BeNil())
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")
				Expect(loadBalancerListenerIdentityModel.ID).To(Equal(core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")))

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model
				loadBalancerListenerHTTPSRedirectPrototypeModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPrototype)
				Expect(loadBalancerListenerHTTPSRedirectPrototypeModel).ToNot(BeNil())
				loadBalancerListenerHTTPSRedirectPrototypeModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPrototypeModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPrototypeModel.URI = core.StringPtr("/example?doc=get")
				Expect(loadBalancerListenerHTTPSRedirectPrototypeModel.HTTPStatusCode).To(Equal(core.Int64Ptr(int64(301))))
				Expect(loadBalancerListenerHTTPSRedirectPrototypeModel.Listener).To(Equal(loadBalancerListenerIdentityModel))
				Expect(loadBalancerListenerHTTPSRedirectPrototypeModel.URI).To(Equal(core.StringPtr("/example?doc=get")))

				// Construct an instance of the LoadBalancerListenerPolicyRulePrototype model
				loadBalancerListenerPolicyRulePrototypeModel := new(vpcv1.LoadBalancerListenerPolicyRulePrototype)
				Expect(loadBalancerListenerPolicyRulePrototypeModel).ToNot(BeNil())
				loadBalancerListenerPolicyRulePrototypeModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePrototypeModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePrototypeModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePrototypeModel.Value = core.StringPtr("testString")
				Expect(loadBalancerListenerPolicyRulePrototypeModel.Condition).To(Equal(core.StringPtr("contains")))
				Expect(loadBalancerListenerPolicyRulePrototypeModel.Field).To(Equal(core.StringPtr("MY-APP-HEADER")))
				Expect(loadBalancerListenerPolicyRulePrototypeModel.Type).To(Equal(core.StringPtr("body")))
				Expect(loadBalancerListenerPolicyRulePrototypeModel.Value).To(Equal(core.StringPtr("testString")))

				// Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				Expect(loadBalancerListenerPolicyTargetPrototypeModel).ToNot(BeNil())
				loadBalancerListenerPolicyTargetPrototypeModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")
				Expect(loadBalancerListenerPolicyTargetPrototypeModel.ID).To(Equal(core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")))

				// Construct an instance of the LoadBalancerListenerPolicyPrototype model
				loadBalancerListenerPolicyPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyPrototype)
				Expect(loadBalancerListenerPolicyPrototypeModel).ToNot(BeNil())
				loadBalancerListenerPolicyPrototypeModel.Action = core.StringPtr("forward_to_listener")
				loadBalancerListenerPolicyPrototypeModel.Name = core.StringPtr("my-load-balancer-listener-policy")
				loadBalancerListenerPolicyPrototypeModel.Priority = core.Int64Ptr(int64(5))
				loadBalancerListenerPolicyPrototypeModel.Rules = []vpcv1.LoadBalancerListenerPolicyRulePrototype{*loadBalancerListenerPolicyRulePrototypeModel}
				loadBalancerListenerPolicyPrototypeModel.Target = loadBalancerListenerPolicyTargetPrototypeModel
				Expect(loadBalancerListenerPolicyPrototypeModel.Action).To(Equal(core.StringPtr("forward_to_listener")))
				Expect(loadBalancerListenerPolicyPrototypeModel.Name).To(Equal(core.StringPtr("my-load-balancer-listener-policy")))
				Expect(loadBalancerListenerPolicyPrototypeModel.Priority).To(Equal(core.Int64Ptr(int64(5))))
				Expect(loadBalancerListenerPolicyPrototypeModel.Rules).To(Equal([]vpcv1.LoadBalancerListenerPolicyRulePrototype{*loadBalancerListenerPolicyRulePrototypeModel}))
				Expect(loadBalancerListenerPolicyPrototypeModel.Target).To(Equal(loadBalancerListenerPolicyTargetPrototypeModel))

				// Construct an instance of the CreateLoadBalancerListenerOptions model
				loadBalancerID := "testString"
				createLoadBalancerListenerOptionsProtocol := "http"
				createLoadBalancerListenerOptionsModel := vpcService.NewCreateLoadBalancerListenerOptions(loadBalancerID, createLoadBalancerListenerOptionsProtocol)
				createLoadBalancerListenerOptionsModel.SetLoadBalancerID("testString")
				createLoadBalancerListenerOptionsModel.SetProtocol("http")
				createLoadBalancerListenerOptionsModel.SetAcceptProxyProtocol(true)
				createLoadBalancerListenerOptionsModel.SetCertificateInstance(certificateInstanceIdentityModel)
				createLoadBalancerListenerOptionsModel.SetConnectionLimit(int64(2000))
				createLoadBalancerListenerOptionsModel.SetDefaultPool(loadBalancerPoolIdentityModel)
				createLoadBalancerListenerOptionsModel.SetHTTPSRedirect(loadBalancerListenerHTTPSRedirectPrototypeModel)
				createLoadBalancerListenerOptionsModel.SetIdleConnectionTimeout(int64(100))
				createLoadBalancerListenerOptionsModel.SetPolicies([]vpcv1.LoadBalancerListenerPolicyPrototype{*loadBalancerListenerPolicyPrototypeModel})
				createLoadBalancerListenerOptionsModel.SetPort(int64(443))
				createLoadBalancerListenerOptionsModel.SetPortMax(int64(499))
				createLoadBalancerListenerOptionsModel.SetPortMin(int64(443))
				createLoadBalancerListenerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createLoadBalancerListenerOptionsModel).ToNot(BeNil())
				Expect(createLoadBalancerListenerOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(createLoadBalancerListenerOptionsModel.Protocol).To(Equal(core.StringPtr("http")))
				Expect(createLoadBalancerListenerOptionsModel.AcceptProxyProtocol).To(Equal(core.BoolPtr(true)))
				Expect(createLoadBalancerListenerOptionsModel.CertificateInstance).To(Equal(certificateInstanceIdentityModel))
				Expect(createLoadBalancerListenerOptionsModel.ConnectionLimit).To(Equal(core.Int64Ptr(int64(2000))))
				Expect(createLoadBalancerListenerOptionsModel.DefaultPool).To(Equal(loadBalancerPoolIdentityModel))
				Expect(createLoadBalancerListenerOptionsModel.HTTPSRedirect).To(Equal(loadBalancerListenerHTTPSRedirectPrototypeModel))
				Expect(createLoadBalancerListenerOptionsModel.IdleConnectionTimeout).To(Equal(core.Int64Ptr(int64(100))))
				Expect(createLoadBalancerListenerOptionsModel.Policies).To(Equal([]vpcv1.LoadBalancerListenerPolicyPrototype{*loadBalancerListenerPolicyPrototypeModel}))
				Expect(createLoadBalancerListenerOptionsModel.Port).To(Equal(core.Int64Ptr(int64(443))))
				Expect(createLoadBalancerListenerOptionsModel.PortMax).To(Equal(core.Int64Ptr(int64(499))))
				Expect(createLoadBalancerListenerOptionsModel.PortMin).To(Equal(core.Int64Ptr(int64(443))))
				Expect(createLoadBalancerListenerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateLoadBalancerListenerPolicyOptions successfully`, func() {
				// Construct an instance of the LoadBalancerListenerPolicyRulePrototype model
				loadBalancerListenerPolicyRulePrototypeModel := new(vpcv1.LoadBalancerListenerPolicyRulePrototype)
				Expect(loadBalancerListenerPolicyRulePrototypeModel).ToNot(BeNil())
				loadBalancerListenerPolicyRulePrototypeModel.Condition = core.StringPtr("contains")
				loadBalancerListenerPolicyRulePrototypeModel.Field = core.StringPtr("MY-APP-HEADER")
				loadBalancerListenerPolicyRulePrototypeModel.Type = core.StringPtr("body")
				loadBalancerListenerPolicyRulePrototypeModel.Value = core.StringPtr("testString")
				Expect(loadBalancerListenerPolicyRulePrototypeModel.Condition).To(Equal(core.StringPtr("contains")))
				Expect(loadBalancerListenerPolicyRulePrototypeModel.Field).To(Equal(core.StringPtr("MY-APP-HEADER")))
				Expect(loadBalancerListenerPolicyRulePrototypeModel.Type).To(Equal(core.StringPtr("body")))
				Expect(loadBalancerListenerPolicyRulePrototypeModel.Value).To(Equal(core.StringPtr("testString")))

				// Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerListenerPolicyTargetPrototypeModel := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				Expect(loadBalancerListenerPolicyTargetPrototypeModel).ToNot(BeNil())
				loadBalancerListenerPolicyTargetPrototypeModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")
				Expect(loadBalancerListenerPolicyTargetPrototypeModel.ID).To(Equal(core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")))

				// Construct an instance of the CreateLoadBalancerListenerPolicyOptions model
				loadBalancerID := "testString"
				listenerID := "testString"
				createLoadBalancerListenerPolicyOptionsAction := "forward_to_listener"
				createLoadBalancerListenerPolicyOptionsPriority := int64(5)
				createLoadBalancerListenerPolicyOptionsModel := vpcService.NewCreateLoadBalancerListenerPolicyOptions(loadBalancerID, listenerID, createLoadBalancerListenerPolicyOptionsAction, createLoadBalancerListenerPolicyOptionsPriority)
				createLoadBalancerListenerPolicyOptionsModel.SetLoadBalancerID("testString")
				createLoadBalancerListenerPolicyOptionsModel.SetListenerID("testString")
				createLoadBalancerListenerPolicyOptionsModel.SetAction("forward_to_listener")
				createLoadBalancerListenerPolicyOptionsModel.SetPriority(int64(5))
				createLoadBalancerListenerPolicyOptionsModel.SetName("my-load-balancer-listener-policy")
				createLoadBalancerListenerPolicyOptionsModel.SetRules([]vpcv1.LoadBalancerListenerPolicyRulePrototype{*loadBalancerListenerPolicyRulePrototypeModel})
				createLoadBalancerListenerPolicyOptionsModel.SetTarget(loadBalancerListenerPolicyTargetPrototypeModel)
				createLoadBalancerListenerPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createLoadBalancerListenerPolicyOptionsModel).ToNot(BeNil())
				Expect(createLoadBalancerListenerPolicyOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(createLoadBalancerListenerPolicyOptionsModel.ListenerID).To(Equal(core.StringPtr("testString")))
				Expect(createLoadBalancerListenerPolicyOptionsModel.Action).To(Equal(core.StringPtr("forward_to_listener")))
				Expect(createLoadBalancerListenerPolicyOptionsModel.Priority).To(Equal(core.Int64Ptr(int64(5))))
				Expect(createLoadBalancerListenerPolicyOptionsModel.Name).To(Equal(core.StringPtr("my-load-balancer-listener-policy")))
				Expect(createLoadBalancerListenerPolicyOptionsModel.Rules).To(Equal([]vpcv1.LoadBalancerListenerPolicyRulePrototype{*loadBalancerListenerPolicyRulePrototypeModel}))
				Expect(createLoadBalancerListenerPolicyOptionsModel.Target).To(Equal(loadBalancerListenerPolicyTargetPrototypeModel))
				Expect(createLoadBalancerListenerPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateLoadBalancerListenerPolicyRuleOptions successfully`, func() {
				// Construct an instance of the CreateLoadBalancerListenerPolicyRuleOptions model
				loadBalancerID := "testString"
				listenerID := "testString"
				policyID := "testString"
				createLoadBalancerListenerPolicyRuleOptionsCondition := "contains"
				createLoadBalancerListenerPolicyRuleOptionsType := "body"
				createLoadBalancerListenerPolicyRuleOptionsValue := "testString"
				createLoadBalancerListenerPolicyRuleOptionsModel := vpcService.NewCreateLoadBalancerListenerPolicyRuleOptions(loadBalancerID, listenerID, policyID, createLoadBalancerListenerPolicyRuleOptionsCondition, createLoadBalancerListenerPolicyRuleOptionsType, createLoadBalancerListenerPolicyRuleOptionsValue)
				createLoadBalancerListenerPolicyRuleOptionsModel.SetLoadBalancerID("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.SetListenerID("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.SetPolicyID("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.SetCondition("contains")
				createLoadBalancerListenerPolicyRuleOptionsModel.SetType("body")
				createLoadBalancerListenerPolicyRuleOptionsModel.SetValue("testString")
				createLoadBalancerListenerPolicyRuleOptionsModel.SetField("MY-APP-HEADER")
				createLoadBalancerListenerPolicyRuleOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createLoadBalancerListenerPolicyRuleOptionsModel).ToNot(BeNil())
				Expect(createLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(createLoadBalancerListenerPolicyRuleOptionsModel.ListenerID).To(Equal(core.StringPtr("testString")))
				Expect(createLoadBalancerListenerPolicyRuleOptionsModel.PolicyID).To(Equal(core.StringPtr("testString")))
				Expect(createLoadBalancerListenerPolicyRuleOptionsModel.Condition).To(Equal(core.StringPtr("contains")))
				Expect(createLoadBalancerListenerPolicyRuleOptionsModel.Type).To(Equal(core.StringPtr("body")))
				Expect(createLoadBalancerListenerPolicyRuleOptionsModel.Value).To(Equal(core.StringPtr("testString")))
				Expect(createLoadBalancerListenerPolicyRuleOptionsModel.Field).To(Equal(core.StringPtr("MY-APP-HEADER")))
				Expect(createLoadBalancerListenerPolicyRuleOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateLoadBalancerOptions successfully`, func() {
				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				Expect(subnetIdentityModel).ToNot(BeNil())
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
				Expect(subnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")))

				// Construct an instance of the DnsInstanceIdentityByCRN model
				dnsInstanceIdentityModel := new(vpcv1.DnsInstanceIdentityByCRN)
				Expect(dnsInstanceIdentityModel).ToNot(BeNil())
				dnsInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::")
				Expect(dnsInstanceIdentityModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::")))

				// Construct an instance of the DnsZoneIdentityByID model
				dnsZoneIdentityModel := new(vpcv1.DnsZoneIdentityByID)
				Expect(dnsZoneIdentityModel).ToNot(BeNil())
				dnsZoneIdentityModel.ID = core.StringPtr("d66662cc-aa23-4fe1-9987-858487a61f45")
				Expect(dnsZoneIdentityModel.ID).To(Equal(core.StringPtr("d66662cc-aa23-4fe1-9987-858487a61f45")))

				// Construct an instance of the LoadBalancerDnsPrototype model
				loadBalancerDnsPrototypeModel := new(vpcv1.LoadBalancerDnsPrototype)
				Expect(loadBalancerDnsPrototypeModel).ToNot(BeNil())
				loadBalancerDnsPrototypeModel.Instance = dnsInstanceIdentityModel
				loadBalancerDnsPrototypeModel.Zone = dnsZoneIdentityModel
				Expect(loadBalancerDnsPrototypeModel.Instance).To(Equal(dnsInstanceIdentityModel))
				Expect(loadBalancerDnsPrototypeModel.Zone).To(Equal(dnsZoneIdentityModel))

				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				Expect(certificateInstanceIdentityModel).ToNot(BeNil())
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")
				Expect(certificateInstanceIdentityModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")))

				// Construct an instance of the LoadBalancerPoolIdentityByName model
				loadBalancerPoolIdentityByNameModel := new(vpcv1.LoadBalancerPoolIdentityByName)
				Expect(loadBalancerPoolIdentityByNameModel).ToNot(BeNil())
				loadBalancerPoolIdentityByNameModel.Name = core.StringPtr("my-load-balancer-pool")
				Expect(loadBalancerPoolIdentityByNameModel.Name).To(Equal(core.StringPtr("my-load-balancer-pool")))

				// Construct an instance of the LoadBalancerListenerIdentityByID model
				loadBalancerListenerIdentityModel := new(vpcv1.LoadBalancerListenerIdentityByID)
				Expect(loadBalancerListenerIdentityModel).ToNot(BeNil())
				loadBalancerListenerIdentityModel.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")
				Expect(loadBalancerListenerIdentityModel.ID).To(Equal(core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")))

				// Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model
				loadBalancerListenerHTTPSRedirectPrototypeModel := new(vpcv1.LoadBalancerListenerHTTPSRedirectPrototype)
				Expect(loadBalancerListenerHTTPSRedirectPrototypeModel).ToNot(BeNil())
				loadBalancerListenerHTTPSRedirectPrototypeModel.HTTPStatusCode = core.Int64Ptr(int64(301))
				loadBalancerListenerHTTPSRedirectPrototypeModel.Listener = loadBalancerListenerIdentityModel
				loadBalancerListenerHTTPSRedirectPrototypeModel.URI = core.StringPtr("/example?doc=get")
				Expect(loadBalancerListenerHTTPSRedirectPrototypeModel.HTTPStatusCode).To(Equal(core.Int64Ptr(int64(301))))
				Expect(loadBalancerListenerHTTPSRedirectPrototypeModel.Listener).To(Equal(loadBalancerListenerIdentityModel))
				Expect(loadBalancerListenerHTTPSRedirectPrototypeModel.URI).To(Equal(core.StringPtr("/example?doc=get")))

				// Construct an instance of the LoadBalancerListenerPrototypeLoadBalancerContext model
				loadBalancerListenerPrototypeLoadBalancerContextModel := new(vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext)
				Expect(loadBalancerListenerPrototypeLoadBalancerContextModel).ToNot(BeNil())
				loadBalancerListenerPrototypeLoadBalancerContextModel.AcceptProxyProtocol = core.BoolPtr(true)
				loadBalancerListenerPrototypeLoadBalancerContextModel.CertificateInstance = certificateInstanceIdentityModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.ConnectionLimit = core.Int64Ptr(int64(2000))
				loadBalancerListenerPrototypeLoadBalancerContextModel.DefaultPool = loadBalancerPoolIdentityByNameModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.HTTPSRedirect = loadBalancerListenerHTTPSRedirectPrototypeModel
				loadBalancerListenerPrototypeLoadBalancerContextModel.IdleConnectionTimeout = core.Int64Ptr(int64(100))
				loadBalancerListenerPrototypeLoadBalancerContextModel.Port = core.Int64Ptr(int64(443))
				loadBalancerListenerPrototypeLoadBalancerContextModel.PortMax = core.Int64Ptr(int64(499))
				loadBalancerListenerPrototypeLoadBalancerContextModel.PortMin = core.Int64Ptr(int64(443))
				loadBalancerListenerPrototypeLoadBalancerContextModel.Protocol = core.StringPtr("http")
				Expect(loadBalancerListenerPrototypeLoadBalancerContextModel.AcceptProxyProtocol).To(Equal(core.BoolPtr(true)))
				Expect(loadBalancerListenerPrototypeLoadBalancerContextModel.CertificateInstance).To(Equal(certificateInstanceIdentityModel))
				Expect(loadBalancerListenerPrototypeLoadBalancerContextModel.ConnectionLimit).To(Equal(core.Int64Ptr(int64(2000))))
				Expect(loadBalancerListenerPrototypeLoadBalancerContextModel.DefaultPool).To(Equal(loadBalancerPoolIdentityByNameModel))
				Expect(loadBalancerListenerPrototypeLoadBalancerContextModel.HTTPSRedirect).To(Equal(loadBalancerListenerHTTPSRedirectPrototypeModel))
				Expect(loadBalancerListenerPrototypeLoadBalancerContextModel.IdleConnectionTimeout).To(Equal(core.Int64Ptr(int64(100))))
				Expect(loadBalancerListenerPrototypeLoadBalancerContextModel.Port).To(Equal(core.Int64Ptr(int64(443))))
				Expect(loadBalancerListenerPrototypeLoadBalancerContextModel.PortMax).To(Equal(core.Int64Ptr(int64(499))))
				Expect(loadBalancerListenerPrototypeLoadBalancerContextModel.PortMin).To(Equal(core.Int64Ptr(int64(443))))
				Expect(loadBalancerListenerPrototypeLoadBalancerContextModel.Protocol).To(Equal(core.StringPtr("http")))

				// Construct an instance of the LoadBalancerLoggingDatapathPrototype model
				loadBalancerLoggingDatapathPrototypeModel := new(vpcv1.LoadBalancerLoggingDatapathPrototype)
				Expect(loadBalancerLoggingDatapathPrototypeModel).ToNot(BeNil())
				loadBalancerLoggingDatapathPrototypeModel.Active = core.BoolPtr(true)
				Expect(loadBalancerLoggingDatapathPrototypeModel.Active).To(Equal(core.BoolPtr(true)))

				// Construct an instance of the LoadBalancerLoggingPrototype model
				loadBalancerLoggingPrototypeModel := new(vpcv1.LoadBalancerLoggingPrototype)
				Expect(loadBalancerLoggingPrototypeModel).ToNot(BeNil())
				loadBalancerLoggingPrototypeModel.Datapath = loadBalancerLoggingDatapathPrototypeModel
				Expect(loadBalancerLoggingPrototypeModel.Datapath).To(Equal(loadBalancerLoggingDatapathPrototypeModel))

				// Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model
				loadBalancerPoolHealthMonitorPrototypeModel := new(vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype)
				Expect(loadBalancerPoolHealthMonitorPrototypeModel).ToNot(BeNil())
				loadBalancerPoolHealthMonitorPrototypeModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPrototypeModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPrototypeModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Type = core.StringPtr("tcp")
				Expect(loadBalancerPoolHealthMonitorPrototypeModel.Delay).To(Equal(core.Int64Ptr(int64(5))))
				Expect(loadBalancerPoolHealthMonitorPrototypeModel.MaxRetries).To(Equal(core.Int64Ptr(int64(2))))
				Expect(loadBalancerPoolHealthMonitorPrototypeModel.Port).To(Equal(core.Int64Ptr(int64(22))))
				Expect(loadBalancerPoolHealthMonitorPrototypeModel.Timeout).To(Equal(core.Int64Ptr(int64(2))))
				Expect(loadBalancerPoolHealthMonitorPrototypeModel.Type).To(Equal(core.StringPtr("tcp")))

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				Expect(loadBalancerPoolMemberTargetPrototypeModel).ToNot(BeNil())
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")
				Expect(loadBalancerPoolMemberTargetPrototypeModel.ID).To(Equal(core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")))

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				Expect(loadBalancerPoolMemberPrototypeModel).ToNot(BeNil())
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))
				Expect(loadBalancerPoolMemberPrototypeModel.Port).To(Equal(core.Int64Ptr(int64(80))))
				Expect(loadBalancerPoolMemberPrototypeModel.Target).To(Equal(loadBalancerPoolMemberTargetPrototypeModel))
				Expect(loadBalancerPoolMemberPrototypeModel.Weight).To(Equal(core.Int64Ptr(int64(50))))

				// Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model
				loadBalancerPoolSessionPersistencePrototypeModel := new(vpcv1.LoadBalancerPoolSessionPersistencePrototype)
				Expect(loadBalancerPoolSessionPersistencePrototypeModel).ToNot(BeNil())
				loadBalancerPoolSessionPersistencePrototypeModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePrototypeModel.Type = core.StringPtr("app_cookie")
				Expect(loadBalancerPoolSessionPersistencePrototypeModel.CookieName).To(Equal(core.StringPtr("my-cookie-name")))
				Expect(loadBalancerPoolSessionPersistencePrototypeModel.Type).To(Equal(core.StringPtr("app_cookie")))

				// Construct an instance of the LoadBalancerPoolPrototypeLoadBalancerContext model
				loadBalancerPoolPrototypeLoadBalancerContextModel := new(vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext)
				Expect(loadBalancerPoolPrototypeLoadBalancerContextModel).ToNot(BeNil())
				loadBalancerPoolPrototypeLoadBalancerContextModel.Algorithm = core.StringPtr("least_connections")
				loadBalancerPoolPrototypeLoadBalancerContextModel.HealthMonitor = loadBalancerPoolHealthMonitorPrototypeModel
				loadBalancerPoolPrototypeLoadBalancerContextModel.Members = []vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}
				loadBalancerPoolPrototypeLoadBalancerContextModel.Name = core.StringPtr("my-load-balancer-pool")
				loadBalancerPoolPrototypeLoadBalancerContextModel.Protocol = core.StringPtr("http")
				loadBalancerPoolPrototypeLoadBalancerContextModel.ProxyProtocol = core.StringPtr("disabled")
				loadBalancerPoolPrototypeLoadBalancerContextModel.SessionPersistence = loadBalancerPoolSessionPersistencePrototypeModel
				Expect(loadBalancerPoolPrototypeLoadBalancerContextModel.Algorithm).To(Equal(core.StringPtr("least_connections")))
				Expect(loadBalancerPoolPrototypeLoadBalancerContextModel.HealthMonitor).To(Equal(loadBalancerPoolHealthMonitorPrototypeModel))
				Expect(loadBalancerPoolPrototypeLoadBalancerContextModel.Members).To(Equal([]vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}))
				Expect(loadBalancerPoolPrototypeLoadBalancerContextModel.Name).To(Equal(core.StringPtr("my-load-balancer-pool")))
				Expect(loadBalancerPoolPrototypeLoadBalancerContextModel.Protocol).To(Equal(core.StringPtr("http")))
				Expect(loadBalancerPoolPrototypeLoadBalancerContextModel.ProxyProtocol).To(Equal(core.StringPtr("disabled")))
				Expect(loadBalancerPoolPrototypeLoadBalancerContextModel.SessionPersistence).To(Equal(loadBalancerPoolSessionPersistencePrototypeModel))

				// Construct an instance of the LoadBalancerProfileIdentityByName model
				loadBalancerProfileIdentityModel := new(vpcv1.LoadBalancerProfileIdentityByName)
				Expect(loadBalancerProfileIdentityModel).ToNot(BeNil())
				loadBalancerProfileIdentityModel.Name = core.StringPtr("network-fixed")
				Expect(loadBalancerProfileIdentityModel.Name).To(Equal(core.StringPtr("network-fixed")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				Expect(securityGroupIdentityModel).ToNot(BeNil())
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
				Expect(securityGroupIdentityModel.ID).To(Equal(core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")))

				// Construct an instance of the CreateLoadBalancerOptions model
				createLoadBalancerOptionsIsPublic := true
				createLoadBalancerOptionsSubnets := []vpcv1.SubnetIdentityIntf{}
				createLoadBalancerOptionsModel := vpcService.NewCreateLoadBalancerOptions(createLoadBalancerOptionsIsPublic, createLoadBalancerOptionsSubnets)
				createLoadBalancerOptionsModel.SetIsPublic(true)
				createLoadBalancerOptionsModel.SetSubnets([]vpcv1.SubnetIdentityIntf{subnetIdentityModel})
				createLoadBalancerOptionsModel.SetDns(loadBalancerDnsPrototypeModel)
				createLoadBalancerOptionsModel.SetIsPrivatePath(true)
				createLoadBalancerOptionsModel.SetListeners([]vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext{*loadBalancerListenerPrototypeLoadBalancerContextModel})
				createLoadBalancerOptionsModel.SetLogging(loadBalancerLoggingPrototypeModel)
				createLoadBalancerOptionsModel.SetName("my-load-balancer")
				createLoadBalancerOptionsModel.SetPools([]vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext{*loadBalancerPoolPrototypeLoadBalancerContextModel})
				createLoadBalancerOptionsModel.SetProfile(loadBalancerProfileIdentityModel)
				createLoadBalancerOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createLoadBalancerOptionsModel.SetRouteMode(true)
				createLoadBalancerOptionsModel.SetSecurityGroups([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel})
				createLoadBalancerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createLoadBalancerOptionsModel).ToNot(BeNil())
				Expect(createLoadBalancerOptionsModel.IsPublic).To(Equal(core.BoolPtr(true)))
				Expect(createLoadBalancerOptionsModel.Subnets).To(Equal([]vpcv1.SubnetIdentityIntf{subnetIdentityModel}))
				Expect(createLoadBalancerOptionsModel.Dns).To(Equal(loadBalancerDnsPrototypeModel))
				Expect(createLoadBalancerOptionsModel.IsPrivatePath).To(Equal(core.BoolPtr(true)))
				Expect(createLoadBalancerOptionsModel.Listeners).To(Equal([]vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext{*loadBalancerListenerPrototypeLoadBalancerContextModel}))
				Expect(createLoadBalancerOptionsModel.Logging).To(Equal(loadBalancerLoggingPrototypeModel))
				Expect(createLoadBalancerOptionsModel.Name).To(Equal(core.StringPtr("my-load-balancer")))
				Expect(createLoadBalancerOptionsModel.Pools).To(Equal([]vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext{*loadBalancerPoolPrototypeLoadBalancerContextModel}))
				Expect(createLoadBalancerOptionsModel.Profile).To(Equal(loadBalancerProfileIdentityModel))
				Expect(createLoadBalancerOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createLoadBalancerOptionsModel.RouteMode).To(Equal(core.BoolPtr(true)))
				Expect(createLoadBalancerOptionsModel.SecurityGroups).To(Equal([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}))
				Expect(createLoadBalancerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateLoadBalancerPoolMemberOptions successfully`, func() {
				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				Expect(loadBalancerPoolMemberTargetPrototypeModel).ToNot(BeNil())
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")
				Expect(loadBalancerPoolMemberTargetPrototypeModel.ID).To(Equal(core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")))

				// Construct an instance of the CreateLoadBalancerPoolMemberOptions model
				loadBalancerID := "testString"
				poolID := "testString"
				createLoadBalancerPoolMemberOptionsPort := int64(80)
				var createLoadBalancerPoolMemberOptionsTarget vpcv1.LoadBalancerPoolMemberTargetPrototypeIntf = nil
				createLoadBalancerPoolMemberOptionsModel := vpcService.NewCreateLoadBalancerPoolMemberOptions(loadBalancerID, poolID, createLoadBalancerPoolMemberOptionsPort, createLoadBalancerPoolMemberOptionsTarget)
				createLoadBalancerPoolMemberOptionsModel.SetLoadBalancerID("testString")
				createLoadBalancerPoolMemberOptionsModel.SetPoolID("testString")
				createLoadBalancerPoolMemberOptionsModel.SetPort(int64(80))
				createLoadBalancerPoolMemberOptionsModel.SetTarget(loadBalancerPoolMemberTargetPrototypeModel)
				createLoadBalancerPoolMemberOptionsModel.SetWeight(int64(50))
				createLoadBalancerPoolMemberOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createLoadBalancerPoolMemberOptionsModel).ToNot(BeNil())
				Expect(createLoadBalancerPoolMemberOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(createLoadBalancerPoolMemberOptionsModel.PoolID).To(Equal(core.StringPtr("testString")))
				Expect(createLoadBalancerPoolMemberOptionsModel.Port).To(Equal(core.Int64Ptr(int64(80))))
				Expect(createLoadBalancerPoolMemberOptionsModel.Target).To(Equal(loadBalancerPoolMemberTargetPrototypeModel))
				Expect(createLoadBalancerPoolMemberOptionsModel.Weight).To(Equal(core.Int64Ptr(int64(50))))
				Expect(createLoadBalancerPoolMemberOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateLoadBalancerPoolOptions successfully`, func() {
				// Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model
				loadBalancerPoolHealthMonitorPrototypeModel := new(vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype)
				Expect(loadBalancerPoolHealthMonitorPrototypeModel).ToNot(BeNil())
				loadBalancerPoolHealthMonitorPrototypeModel.Delay = core.Int64Ptr(int64(5))
				loadBalancerPoolHealthMonitorPrototypeModel.MaxRetries = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Port = core.Int64Ptr(int64(22))
				loadBalancerPoolHealthMonitorPrototypeModel.Timeout = core.Int64Ptr(int64(2))
				loadBalancerPoolHealthMonitorPrototypeModel.Type = core.StringPtr("tcp")
				Expect(loadBalancerPoolHealthMonitorPrototypeModel.Delay).To(Equal(core.Int64Ptr(int64(5))))
				Expect(loadBalancerPoolHealthMonitorPrototypeModel.MaxRetries).To(Equal(core.Int64Ptr(int64(2))))
				Expect(loadBalancerPoolHealthMonitorPrototypeModel.Port).To(Equal(core.Int64Ptr(int64(22))))
				Expect(loadBalancerPoolHealthMonitorPrototypeModel.Timeout).To(Equal(core.Int64Ptr(int64(2))))
				Expect(loadBalancerPoolHealthMonitorPrototypeModel.Type).To(Equal(core.StringPtr("tcp")))

				// Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID model
				loadBalancerPoolIdentityModel := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
				Expect(loadBalancerPoolIdentityModel).ToNot(BeNil())
				loadBalancerPoolIdentityModel.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")
				Expect(loadBalancerPoolIdentityModel.ID).To(Equal(core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")))

				// Construct an instance of the LoadBalancerPoolFailsafePolicyPrototype model
				loadBalancerPoolFailsafePolicyPrototypeModel := new(vpcv1.LoadBalancerPoolFailsafePolicyPrototype)
				Expect(loadBalancerPoolFailsafePolicyPrototypeModel).ToNot(BeNil())
				loadBalancerPoolFailsafePolicyPrototypeModel.Action = core.StringPtr("forward")
				loadBalancerPoolFailsafePolicyPrototypeModel.Target = loadBalancerPoolIdentityModel
				Expect(loadBalancerPoolFailsafePolicyPrototypeModel.Action).To(Equal(core.StringPtr("forward")))
				Expect(loadBalancerPoolFailsafePolicyPrototypeModel.Target).To(Equal(loadBalancerPoolIdentityModel))

				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				Expect(loadBalancerPoolMemberTargetPrototypeModel).ToNot(BeNil())
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")
				Expect(loadBalancerPoolMemberTargetPrototypeModel.ID).To(Equal(core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")))

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				Expect(loadBalancerPoolMemberPrototypeModel).ToNot(BeNil())
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))
				Expect(loadBalancerPoolMemberPrototypeModel.Port).To(Equal(core.Int64Ptr(int64(80))))
				Expect(loadBalancerPoolMemberPrototypeModel.Target).To(Equal(loadBalancerPoolMemberTargetPrototypeModel))
				Expect(loadBalancerPoolMemberPrototypeModel.Weight).To(Equal(core.Int64Ptr(int64(50))))

				// Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model
				loadBalancerPoolSessionPersistencePrototypeModel := new(vpcv1.LoadBalancerPoolSessionPersistencePrototype)
				Expect(loadBalancerPoolSessionPersistencePrototypeModel).ToNot(BeNil())
				loadBalancerPoolSessionPersistencePrototypeModel.CookieName = core.StringPtr("my-cookie-name")
				loadBalancerPoolSessionPersistencePrototypeModel.Type = core.StringPtr("app_cookie")
				Expect(loadBalancerPoolSessionPersistencePrototypeModel.CookieName).To(Equal(core.StringPtr("my-cookie-name")))
				Expect(loadBalancerPoolSessionPersistencePrototypeModel.Type).To(Equal(core.StringPtr("app_cookie")))

				// Construct an instance of the CreateLoadBalancerPoolOptions model
				loadBalancerID := "testString"
				createLoadBalancerPoolOptionsAlgorithm := "least_connections"
				var createLoadBalancerPoolOptionsHealthMonitor vpcv1.LoadBalancerPoolHealthMonitorPrototypeIntf = nil
				createLoadBalancerPoolOptionsProtocol := "http"
				createLoadBalancerPoolOptionsModel := vpcService.NewCreateLoadBalancerPoolOptions(loadBalancerID, createLoadBalancerPoolOptionsAlgorithm, createLoadBalancerPoolOptionsHealthMonitor, createLoadBalancerPoolOptionsProtocol)
				createLoadBalancerPoolOptionsModel.SetLoadBalancerID("testString")
				createLoadBalancerPoolOptionsModel.SetAlgorithm("least_connections")
				createLoadBalancerPoolOptionsModel.SetHealthMonitor(loadBalancerPoolHealthMonitorPrototypeModel)
				createLoadBalancerPoolOptionsModel.SetProtocol("http")
				createLoadBalancerPoolOptionsModel.SetFailsafePolicy(loadBalancerPoolFailsafePolicyPrototypeModel)
				createLoadBalancerPoolOptionsModel.SetMembers([]vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel})
				createLoadBalancerPoolOptionsModel.SetName("my-load-balancer-pool")
				createLoadBalancerPoolOptionsModel.SetProxyProtocol("disabled")
				createLoadBalancerPoolOptionsModel.SetSessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel)
				createLoadBalancerPoolOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createLoadBalancerPoolOptionsModel).ToNot(BeNil())
				Expect(createLoadBalancerPoolOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(createLoadBalancerPoolOptionsModel.Algorithm).To(Equal(core.StringPtr("least_connections")))
				Expect(createLoadBalancerPoolOptionsModel.HealthMonitor).To(Equal(loadBalancerPoolHealthMonitorPrototypeModel))
				Expect(createLoadBalancerPoolOptionsModel.Protocol).To(Equal(core.StringPtr("http")))
				Expect(createLoadBalancerPoolOptionsModel.FailsafePolicy).To(Equal(loadBalancerPoolFailsafePolicyPrototypeModel))
				Expect(createLoadBalancerPoolOptionsModel.Members).To(Equal([]vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}))
				Expect(createLoadBalancerPoolOptionsModel.Name).To(Equal(core.StringPtr("my-load-balancer-pool")))
				Expect(createLoadBalancerPoolOptionsModel.ProxyProtocol).To(Equal(core.StringPtr("disabled")))
				Expect(createLoadBalancerPoolOptionsModel.SessionPersistence).To(Equal(loadBalancerPoolSessionPersistencePrototypeModel))
				Expect(createLoadBalancerPoolOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateNetworkACLOptions successfully`, func() {
				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				Expect(vpcIdentityModel).ToNot(BeNil())
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				Expect(vpcIdentityModel.ID).To(Equal(core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))

				// Construct an instance of the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype model
				networkACLRulePrototypeNetworkACLContextModel := new(vpcv1.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype)
				Expect(networkACLRulePrototypeNetworkACLContextModel).ToNot(BeNil())
				networkACLRulePrototypeNetworkACLContextModel.Action = core.StringPtr("allow")
				networkACLRulePrototypeNetworkACLContextModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeNetworkACLContextModel.Direction = core.StringPtr("inbound")
				networkACLRulePrototypeNetworkACLContextModel.IPVersion = core.StringPtr("ipv4")
				networkACLRulePrototypeNetworkACLContextModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePrototypeNetworkACLContextModel.Source = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeNetworkACLContextModel.Protocol = core.StringPtr("all")
				Expect(networkACLRulePrototypeNetworkACLContextModel.Action).To(Equal(core.StringPtr("allow")))
				Expect(networkACLRulePrototypeNetworkACLContextModel.Destination).To(Equal(core.StringPtr("192.168.3.2/32")))
				Expect(networkACLRulePrototypeNetworkACLContextModel.Direction).To(Equal(core.StringPtr("inbound")))
				Expect(networkACLRulePrototypeNetworkACLContextModel.IPVersion).To(Equal(core.StringPtr("ipv4")))
				Expect(networkACLRulePrototypeNetworkACLContextModel.Name).To(Equal(core.StringPtr("my-network-acl-rule")))
				Expect(networkACLRulePrototypeNetworkACLContextModel.Source).To(Equal(core.StringPtr("192.168.3.2/32")))
				Expect(networkACLRulePrototypeNetworkACLContextModel.Protocol).To(Equal(core.StringPtr("all")))

				// Construct an instance of the NetworkACLPrototypeNetworkACLByRules model
				networkACLPrototypeModel := new(vpcv1.NetworkACLPrototypeNetworkACLByRules)
				Expect(networkACLPrototypeModel).ToNot(BeNil())
				networkACLPrototypeModel.Name = core.StringPtr("my-network-acl")
				networkACLPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				networkACLPrototypeModel.VPC = vpcIdentityModel
				networkACLPrototypeModel.Rules = []vpcv1.NetworkACLRulePrototypeNetworkACLContextIntf{networkACLRulePrototypeNetworkACLContextModel}
				Expect(networkACLPrototypeModel.Name).To(Equal(core.StringPtr("my-network-acl")))
				Expect(networkACLPrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(networkACLPrototypeModel.VPC).To(Equal(vpcIdentityModel))
				Expect(networkACLPrototypeModel.Rules).To(Equal([]vpcv1.NetworkACLRulePrototypeNetworkACLContextIntf{networkACLRulePrototypeNetworkACLContextModel}))

				// Construct an instance of the CreateNetworkACLOptions model
				var networkACLPrototype vpcv1.NetworkACLPrototypeIntf = nil
				createNetworkACLOptionsModel := vpcService.NewCreateNetworkACLOptions(networkACLPrototype)
				createNetworkACLOptionsModel.SetNetworkACLPrototype(networkACLPrototypeModel)
				createNetworkACLOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createNetworkACLOptionsModel).ToNot(BeNil())
				Expect(createNetworkACLOptionsModel.NetworkACLPrototype).To(Equal(networkACLPrototypeModel))
				Expect(createNetworkACLOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateNetworkACLRuleOptions successfully`, func() {
				// Construct an instance of the NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID model
				networkACLRuleBeforePrototypeModel := new(vpcv1.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID)
				Expect(networkACLRuleBeforePrototypeModel).ToNot(BeNil())
				networkACLRuleBeforePrototypeModel.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")
				Expect(networkACLRuleBeforePrototypeModel.ID).To(Equal(core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")))

				// Construct an instance of the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype model
				networkACLRulePrototypeModel := new(vpcv1.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype)
				Expect(networkACLRulePrototypeModel).ToNot(BeNil())
				networkACLRulePrototypeModel.Action = core.StringPtr("allow")
				networkACLRulePrototypeModel.Before = networkACLRuleBeforePrototypeModel
				networkACLRulePrototypeModel.Destination = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeModel.Direction = core.StringPtr("inbound")
				networkACLRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				networkACLRulePrototypeModel.Name = core.StringPtr("my-network-acl-rule")
				networkACLRulePrototypeModel.Source = core.StringPtr("192.168.3.2/32")
				networkACLRulePrototypeModel.Protocol = core.StringPtr("all")
				Expect(networkACLRulePrototypeModel.Action).To(Equal(core.StringPtr("allow")))
				Expect(networkACLRulePrototypeModel.Before).To(Equal(networkACLRuleBeforePrototypeModel))
				Expect(networkACLRulePrototypeModel.Destination).To(Equal(core.StringPtr("192.168.3.2/32")))
				Expect(networkACLRulePrototypeModel.Direction).To(Equal(core.StringPtr("inbound")))
				Expect(networkACLRulePrototypeModel.IPVersion).To(Equal(core.StringPtr("ipv4")))
				Expect(networkACLRulePrototypeModel.Name).To(Equal(core.StringPtr("my-network-acl-rule")))
				Expect(networkACLRulePrototypeModel.Source).To(Equal(core.StringPtr("192.168.3.2/32")))
				Expect(networkACLRulePrototypeModel.Protocol).To(Equal(core.StringPtr("all")))

				// Construct an instance of the CreateNetworkACLRuleOptions model
				networkAclid := "testString"
				var networkACLRulePrototype vpcv1.NetworkACLRulePrototypeIntf = nil
				createNetworkACLRuleOptionsModel := vpcService.NewCreateNetworkACLRuleOptions(networkAclid, networkACLRulePrototype)
				createNetworkACLRuleOptionsModel.SetNetworkACLID("testString")
				createNetworkACLRuleOptionsModel.SetNetworkACLRulePrototype(networkACLRulePrototypeModel)
				createNetworkACLRuleOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createNetworkACLRuleOptionsModel).ToNot(BeNil())
				Expect(createNetworkACLRuleOptionsModel.NetworkACLID).To(Equal(core.StringPtr("testString")))
				Expect(createNetworkACLRuleOptionsModel.NetworkACLRulePrototype).To(Equal(networkACLRulePrototypeModel))
				Expect(createNetworkACLRuleOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreatePlacementGroupOptions successfully`, func() {
				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the CreatePlacementGroupOptions model
				createPlacementGroupOptionsStrategy := "host_spread"
				createPlacementGroupOptionsModel := vpcService.NewCreatePlacementGroupOptions(createPlacementGroupOptionsStrategy)
				createPlacementGroupOptionsModel.SetStrategy("host_spread")
				createPlacementGroupOptionsModel.SetName("my-placement-group")
				createPlacementGroupOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createPlacementGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createPlacementGroupOptionsModel).ToNot(BeNil())
				Expect(createPlacementGroupOptionsModel.Strategy).To(Equal(core.StringPtr("host_spread")))
				Expect(createPlacementGroupOptionsModel.Name).To(Equal(core.StringPtr("my-placement-group")))
				Expect(createPlacementGroupOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createPlacementGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreatePrivatePathServiceGatewayAccountPolicyOptions successfully`, func() {
				// Construct an instance of the AccountIdentityByID model
				accountIdentityModel := new(vpcv1.AccountIdentityByID)
				Expect(accountIdentityModel).ToNot(BeNil())
				accountIdentityModel.ID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				Expect(accountIdentityModel.ID).To(Equal(core.StringPtr("bb1b52262f7441a586f49068482f1e60")))

				// Construct an instance of the CreatePrivatePathServiceGatewayAccountPolicyOptions model
				privatePathServiceGatewayID := "testString"
				createPrivatePathServiceGatewayAccountPolicyOptionsAccessPolicy := "deny"
				var createPrivatePathServiceGatewayAccountPolicyOptionsAccount vpcv1.AccountIdentityIntf = nil
				createPrivatePathServiceGatewayAccountPolicyOptionsModel := vpcService.NewCreatePrivatePathServiceGatewayAccountPolicyOptions(privatePathServiceGatewayID, createPrivatePathServiceGatewayAccountPolicyOptionsAccessPolicy, createPrivatePathServiceGatewayAccountPolicyOptionsAccount)
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.SetPrivatePathServiceGatewayID("testString")
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.SetAccessPolicy("deny")
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.SetAccount(accountIdentityModel)
				createPrivatePathServiceGatewayAccountPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createPrivatePathServiceGatewayAccountPolicyOptionsModel).ToNot(BeNil())
				Expect(createPrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(createPrivatePathServiceGatewayAccountPolicyOptionsModel.AccessPolicy).To(Equal(core.StringPtr("deny")))
				Expect(createPrivatePathServiceGatewayAccountPolicyOptionsModel.Account).To(Equal(accountIdentityModel))
				Expect(createPrivatePathServiceGatewayAccountPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreatePrivatePathServiceGatewayOptions successfully`, func() {
				// Construct an instance of the LoadBalancerIdentityByID model
				loadBalancerIdentityModel := new(vpcv1.LoadBalancerIdentityByID)
				Expect(loadBalancerIdentityModel).ToNot(BeNil())
				loadBalancerIdentityModel.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
				Expect(loadBalancerIdentityModel.ID).To(Equal(core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the CreatePrivatePathServiceGatewayOptions model
				var createPrivatePathServiceGatewayOptionsLoadBalancer vpcv1.LoadBalancerIdentityIntf = nil
				createPrivatePathServiceGatewayOptionsServiceEndpoints := []string{"*.example.com"}
				createPrivatePathServiceGatewayOptionsModel := vpcService.NewCreatePrivatePathServiceGatewayOptions(createPrivatePathServiceGatewayOptionsLoadBalancer, createPrivatePathServiceGatewayOptionsServiceEndpoints)
				createPrivatePathServiceGatewayOptionsModel.SetLoadBalancer(loadBalancerIdentityModel)
				createPrivatePathServiceGatewayOptionsModel.SetServiceEndpoints([]string{"*.example.com"})
				createPrivatePathServiceGatewayOptionsModel.SetDefaultAccessPolicy("deny")
				createPrivatePathServiceGatewayOptionsModel.SetName("my-private-path-service-gateway")
				createPrivatePathServiceGatewayOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createPrivatePathServiceGatewayOptionsModel.SetZonalAffinity(false)
				createPrivatePathServiceGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createPrivatePathServiceGatewayOptionsModel).ToNot(BeNil())
				Expect(createPrivatePathServiceGatewayOptionsModel.LoadBalancer).To(Equal(loadBalancerIdentityModel))
				Expect(createPrivatePathServiceGatewayOptionsModel.ServiceEndpoints).To(Equal([]string{"*.example.com"}))
				Expect(createPrivatePathServiceGatewayOptionsModel.DefaultAccessPolicy).To(Equal(core.StringPtr("deny")))
				Expect(createPrivatePathServiceGatewayOptionsModel.Name).To(Equal(core.StringPtr("my-private-path-service-gateway")))
				Expect(createPrivatePathServiceGatewayOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createPrivatePathServiceGatewayOptionsModel.ZonalAffinity).To(Equal(core.BoolPtr(false)))
				Expect(createPrivatePathServiceGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreatePublicAddressRangeOptions successfully`, func() {
				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				Expect(vpcIdentityModel).ToNot(BeNil())
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				Expect(vpcIdentityModel.ID).To(Equal(core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the PublicAddressRangeTargetPrototype model
				publicAddressRangeTargetPrototypeModel := new(vpcv1.PublicAddressRangeTargetPrototype)
				Expect(publicAddressRangeTargetPrototypeModel).ToNot(BeNil())
				publicAddressRangeTargetPrototypeModel.VPC = vpcIdentityModel
				publicAddressRangeTargetPrototypeModel.Zone = zoneIdentityModel
				Expect(publicAddressRangeTargetPrototypeModel.VPC).To(Equal(vpcIdentityModel))
				Expect(publicAddressRangeTargetPrototypeModel.Zone).To(Equal(zoneIdentityModel))

				// Construct an instance of the CreatePublicAddressRangeOptions model
				createPublicAddressRangeOptionsIpv4AddressCount := int64(8)
				createPublicAddressRangeOptionsModel := vpcService.NewCreatePublicAddressRangeOptions(createPublicAddressRangeOptionsIpv4AddressCount)
				createPublicAddressRangeOptionsModel.SetIpv4AddressCount(int64(8))
				createPublicAddressRangeOptionsModel.SetName("my-public-address-range")
				createPublicAddressRangeOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createPublicAddressRangeOptionsModel.SetTarget(publicAddressRangeTargetPrototypeModel)
				createPublicAddressRangeOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createPublicAddressRangeOptionsModel).ToNot(BeNil())
				Expect(createPublicAddressRangeOptionsModel.Ipv4AddressCount).To(Equal(core.Int64Ptr(int64(8))))
				Expect(createPublicAddressRangeOptionsModel.Name).To(Equal(core.StringPtr("my-public-address-range")))
				Expect(createPublicAddressRangeOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createPublicAddressRangeOptionsModel.Target).To(Equal(publicAddressRangeTargetPrototypeModel))
				Expect(createPublicAddressRangeOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreatePublicGatewayOptions successfully`, func() {
				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				Expect(vpcIdentityModel).ToNot(BeNil())
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				Expect(vpcIdentityModel.ID).To(Equal(core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID model
				publicGatewayFloatingIPPrototypeModel := new(vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID)
				Expect(publicGatewayFloatingIPPrototypeModel).ToNot(BeNil())
				publicGatewayFloatingIPPrototypeModel.ID = core.StringPtr("r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")
				Expect(publicGatewayFloatingIPPrototypeModel.ID).To(Equal(core.StringPtr("r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the CreatePublicGatewayOptions model
				var createPublicGatewayOptionsVPC vpcv1.VPCIdentityIntf = nil
				var createPublicGatewayOptionsZone vpcv1.ZoneIdentityIntf = nil
				createPublicGatewayOptionsModel := vpcService.NewCreatePublicGatewayOptions(createPublicGatewayOptionsVPC, createPublicGatewayOptionsZone)
				createPublicGatewayOptionsModel.SetVPC(vpcIdentityModel)
				createPublicGatewayOptionsModel.SetZone(zoneIdentityModel)
				createPublicGatewayOptionsModel.SetFloatingIP(publicGatewayFloatingIPPrototypeModel)
				createPublicGatewayOptionsModel.SetName("my-public-gateway")
				createPublicGatewayOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createPublicGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createPublicGatewayOptionsModel).ToNot(BeNil())
				Expect(createPublicGatewayOptionsModel.VPC).To(Equal(vpcIdentityModel))
				Expect(createPublicGatewayOptionsModel.Zone).To(Equal(zoneIdentityModel))
				Expect(createPublicGatewayOptionsModel.FloatingIP).To(Equal(publicGatewayFloatingIPPrototypeModel))
				Expect(createPublicGatewayOptionsModel.Name).To(Equal(core.StringPtr("my-public-gateway")))
				Expect(createPublicGatewayOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createPublicGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateReservationOptions successfully`, func() {
				// Construct an instance of the ReservationCapacityPrototype model
				reservationCapacityPrototypeModel := new(vpcv1.ReservationCapacityPrototype)
				Expect(reservationCapacityPrototypeModel).ToNot(BeNil())
				reservationCapacityPrototypeModel.Total = core.Int64Ptr(int64(10))
				Expect(reservationCapacityPrototypeModel.Total).To(Equal(core.Int64Ptr(int64(10))))

				// Construct an instance of the ReservationCommittedUsePrototype model
				reservationCommittedUsePrototypeModel := new(vpcv1.ReservationCommittedUsePrototype)
				Expect(reservationCommittedUsePrototypeModel).ToNot(BeNil())
				reservationCommittedUsePrototypeModel.ExpirationPolicy = core.StringPtr("release")
				reservationCommittedUsePrototypeModel.Term = core.StringPtr("testString")
				Expect(reservationCommittedUsePrototypeModel.ExpirationPolicy).To(Equal(core.StringPtr("release")))
				Expect(reservationCommittedUsePrototypeModel.Term).To(Equal(core.StringPtr("testString")))

				// Construct an instance of the ReservationProfilePrototype model
				reservationProfilePrototypeModel := new(vpcv1.ReservationProfilePrototype)
				Expect(reservationProfilePrototypeModel).ToNot(BeNil())
				reservationProfilePrototypeModel.Name = core.StringPtr("bx2-4x16")
				reservationProfilePrototypeModel.ResourceType = core.StringPtr("bare_metal_server_profile")
				Expect(reservationProfilePrototypeModel.Name).To(Equal(core.StringPtr("bx2-4x16")))
				Expect(reservationProfilePrototypeModel.ResourceType).To(Equal(core.StringPtr("bare_metal_server_profile")))

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the CreateReservationOptions model
				var createReservationOptionsCapacity *vpcv1.ReservationCapacityPrototype = nil
				var createReservationOptionsCommittedUse *vpcv1.ReservationCommittedUsePrototype = nil
				var createReservationOptionsProfile *vpcv1.ReservationProfilePrototype = nil
				var createReservationOptionsZone vpcv1.ZoneIdentityIntf = nil
				createReservationOptionsModel := vpcService.NewCreateReservationOptions(createReservationOptionsCapacity, createReservationOptionsCommittedUse, createReservationOptionsProfile, createReservationOptionsZone)
				createReservationOptionsModel.SetCapacity(reservationCapacityPrototypeModel)
				createReservationOptionsModel.SetCommittedUse(reservationCommittedUsePrototypeModel)
				createReservationOptionsModel.SetProfile(reservationProfilePrototypeModel)
				createReservationOptionsModel.SetZone(zoneIdentityModel)
				createReservationOptionsModel.SetAffinityPolicy("automatic")
				createReservationOptionsModel.SetName("my-reservation")
				createReservationOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createReservationOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createReservationOptionsModel).ToNot(BeNil())
				Expect(createReservationOptionsModel.Capacity).To(Equal(reservationCapacityPrototypeModel))
				Expect(createReservationOptionsModel.CommittedUse).To(Equal(reservationCommittedUsePrototypeModel))
				Expect(createReservationOptionsModel.Profile).To(Equal(reservationProfilePrototypeModel))
				Expect(createReservationOptionsModel.Zone).To(Equal(zoneIdentityModel))
				Expect(createReservationOptionsModel.AffinityPolicy).To(Equal(core.StringPtr("automatic")))
				Expect(createReservationOptionsModel.Name).To(Equal(core.StringPtr("my-reservation")))
				Expect(createReservationOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createReservationOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateSecurityGroupOptions successfully`, func() {
				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				Expect(vpcIdentityModel).ToNot(BeNil())
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				Expect(vpcIdentityModel.ID).To(Equal(core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the SecurityGroupRuleLocalPrototypeIP model
				securityGroupRuleLocalPrototypeModel := new(vpcv1.SecurityGroupRuleLocalPrototypeIP)
				Expect(securityGroupRuleLocalPrototypeModel).ToNot(BeNil())
				securityGroupRuleLocalPrototypeModel.Address = core.StringPtr("192.168.3.4")
				Expect(securityGroupRuleLocalPrototypeModel.Address).To(Equal(core.StringPtr("192.168.3.4")))

				// Construct an instance of the SecurityGroupRuleRemotePrototypeIP model
				securityGroupRuleRemotePrototypeModel := new(vpcv1.SecurityGroupRuleRemotePrototypeIP)
				Expect(securityGroupRuleRemotePrototypeModel).ToNot(BeNil())
				securityGroupRuleRemotePrototypeModel.Address = core.StringPtr("192.168.3.4")
				Expect(securityGroupRuleRemotePrototypeModel.Address).To(Equal(core.StringPtr("192.168.3.4")))

				// Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model
				securityGroupRulePrototypeModel := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll)
				Expect(securityGroupRulePrototypeModel).ToNot(BeNil())
				securityGroupRulePrototypeModel.Direction = core.StringPtr("inbound")
				securityGroupRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePrototypeModel.Local = securityGroupRuleLocalPrototypeModel
				securityGroupRulePrototypeModel.Remote = securityGroupRuleRemotePrototypeModel
				securityGroupRulePrototypeModel.Protocol = core.StringPtr("all")
				Expect(securityGroupRulePrototypeModel.Direction).To(Equal(core.StringPtr("inbound")))
				Expect(securityGroupRulePrototypeModel.IPVersion).To(Equal(core.StringPtr("ipv4")))
				Expect(securityGroupRulePrototypeModel.Local).To(Equal(securityGroupRuleLocalPrototypeModel))
				Expect(securityGroupRulePrototypeModel.Remote).To(Equal(securityGroupRuleRemotePrototypeModel))
				Expect(securityGroupRulePrototypeModel.Protocol).To(Equal(core.StringPtr("all")))

				// Construct an instance of the CreateSecurityGroupOptions model
				var createSecurityGroupOptionsVPC vpcv1.VPCIdentityIntf = nil
				createSecurityGroupOptionsModel := vpcService.NewCreateSecurityGroupOptions(createSecurityGroupOptionsVPC)
				createSecurityGroupOptionsModel.SetVPC(vpcIdentityModel)
				createSecurityGroupOptionsModel.SetName("my-security-group")
				createSecurityGroupOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createSecurityGroupOptionsModel.SetRules([]vpcv1.SecurityGroupRulePrototypeIntf{securityGroupRulePrototypeModel})
				createSecurityGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createSecurityGroupOptionsModel).ToNot(BeNil())
				Expect(createSecurityGroupOptionsModel.VPC).To(Equal(vpcIdentityModel))
				Expect(createSecurityGroupOptionsModel.Name).To(Equal(core.StringPtr("my-security-group")))
				Expect(createSecurityGroupOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createSecurityGroupOptionsModel.Rules).To(Equal([]vpcv1.SecurityGroupRulePrototypeIntf{securityGroupRulePrototypeModel}))
				Expect(createSecurityGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateSecurityGroupRuleOptions successfully`, func() {
				// Construct an instance of the SecurityGroupRuleLocalPrototypeIP model
				securityGroupRuleLocalPrototypeModel := new(vpcv1.SecurityGroupRuleLocalPrototypeIP)
				Expect(securityGroupRuleLocalPrototypeModel).ToNot(BeNil())
				securityGroupRuleLocalPrototypeModel.Address = core.StringPtr("192.168.3.4")
				Expect(securityGroupRuleLocalPrototypeModel.Address).To(Equal(core.StringPtr("192.168.3.4")))

				// Construct an instance of the SecurityGroupRuleRemotePrototypeIP model
				securityGroupRuleRemotePrototypeModel := new(vpcv1.SecurityGroupRuleRemotePrototypeIP)
				Expect(securityGroupRuleRemotePrototypeModel).ToNot(BeNil())
				securityGroupRuleRemotePrototypeModel.Address = core.StringPtr("192.168.3.4")
				Expect(securityGroupRuleRemotePrototypeModel.Address).To(Equal(core.StringPtr("192.168.3.4")))

				// Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model
				securityGroupRulePrototypeModel := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll)
				Expect(securityGroupRulePrototypeModel).ToNot(BeNil())
				securityGroupRulePrototypeModel.Direction = core.StringPtr("inbound")
				securityGroupRulePrototypeModel.IPVersion = core.StringPtr("ipv4")
				securityGroupRulePrototypeModel.Local = securityGroupRuleLocalPrototypeModel
				securityGroupRulePrototypeModel.Remote = securityGroupRuleRemotePrototypeModel
				securityGroupRulePrototypeModel.Protocol = core.StringPtr("all")
				Expect(securityGroupRulePrototypeModel.Direction).To(Equal(core.StringPtr("inbound")))
				Expect(securityGroupRulePrototypeModel.IPVersion).To(Equal(core.StringPtr("ipv4")))
				Expect(securityGroupRulePrototypeModel.Local).To(Equal(securityGroupRuleLocalPrototypeModel))
				Expect(securityGroupRulePrototypeModel.Remote).To(Equal(securityGroupRuleRemotePrototypeModel))
				Expect(securityGroupRulePrototypeModel.Protocol).To(Equal(core.StringPtr("all")))

				// Construct an instance of the CreateSecurityGroupRuleOptions model
				securityGroupID := "testString"
				var securityGroupRulePrototype vpcv1.SecurityGroupRulePrototypeIntf = nil
				createSecurityGroupRuleOptionsModel := vpcService.NewCreateSecurityGroupRuleOptions(securityGroupID, securityGroupRulePrototype)
				createSecurityGroupRuleOptionsModel.SetSecurityGroupID("testString")
				createSecurityGroupRuleOptionsModel.SetSecurityGroupRulePrototype(securityGroupRulePrototypeModel)
				createSecurityGroupRuleOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createSecurityGroupRuleOptionsModel).ToNot(BeNil())
				Expect(createSecurityGroupRuleOptionsModel.SecurityGroupID).To(Equal(core.StringPtr("testString")))
				Expect(createSecurityGroupRuleOptionsModel.SecurityGroupRulePrototype).To(Equal(securityGroupRulePrototypeModel))
				Expect(createSecurityGroupRuleOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateSecurityGroupTargetBindingOptions successfully`, func() {
				// Construct an instance of the CreateSecurityGroupTargetBindingOptions model
				securityGroupID := "testString"
				id := "testString"
				createSecurityGroupTargetBindingOptionsModel := vpcService.NewCreateSecurityGroupTargetBindingOptions(securityGroupID, id)
				createSecurityGroupTargetBindingOptionsModel.SetSecurityGroupID("testString")
				createSecurityGroupTargetBindingOptionsModel.SetID("testString")
				createSecurityGroupTargetBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createSecurityGroupTargetBindingOptionsModel).ToNot(BeNil())
				Expect(createSecurityGroupTargetBindingOptionsModel.SecurityGroupID).To(Equal(core.StringPtr("testString")))
				Expect(createSecurityGroupTargetBindingOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(createSecurityGroupTargetBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateShareMountTargetOptions successfully`, func() {
				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				Expect(virtualNetworkInterfaceIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(virtualNetworkInterfaceIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(virtualNetworkInterfaceIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(virtualNetworkInterfaceIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				Expect(securityGroupIdentityModel).ToNot(BeNil())
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
				Expect(securityGroupIdentityModel.ID).To(Equal(core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")))

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				Expect(subnetIdentityModel).ToNot(BeNil())
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
				Expect(subnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")))

				// Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
				shareMountTargetVirtualNetworkInterfacePrototypeModel := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext)
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel).ToNot(BeNil())
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AutoDelete = core.BoolPtr(false)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Name = core.StringPtr("my-virtual-network-interface")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.AllowIPSpoofing).To(Equal(core.BoolPtr(true)))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.EnableInfrastructureNat).To(Equal(core.BoolPtr(true)))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.Ips).To(Equal([]vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.Name).To(Equal(core.StringPtr("my-virtual-network-interface")))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.PrimaryIP).To(Equal(virtualNetworkInterfacePrimaryIPPrototypeModel))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.ProtocolStateFilteringMode).To(Equal(core.StringPtr("auto")))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.SecurityGroups).To(Equal([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.Subnet).To(Equal(subnetIdentityModel))

				// Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
				shareMountTargetPrototypeModel := new(vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup)
				Expect(shareMountTargetPrototypeModel).ToNot(BeNil())
				shareMountTargetPrototypeModel.AccessProtocol = core.StringPtr("nfs4")
				shareMountTargetPrototypeModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPrototypeModel.TransitEncryption = core.StringPtr("none")
				shareMountTargetPrototypeModel.VirtualNetworkInterface = shareMountTargetVirtualNetworkInterfacePrototypeModel
				Expect(shareMountTargetPrototypeModel.AccessProtocol).To(Equal(core.StringPtr("nfs4")))
				Expect(shareMountTargetPrototypeModel.Name).To(Equal(core.StringPtr("my-share-mount-target")))
				Expect(shareMountTargetPrototypeModel.TransitEncryption).To(Equal(core.StringPtr("none")))
				Expect(shareMountTargetPrototypeModel.VirtualNetworkInterface).To(Equal(shareMountTargetVirtualNetworkInterfacePrototypeModel))

				// Construct an instance of the CreateShareMountTargetOptions model
				shareID := "testString"
				var shareMountTargetPrototype vpcv1.ShareMountTargetPrototypeIntf = nil
				createShareMountTargetOptionsModel := vpcService.NewCreateShareMountTargetOptions(shareID, shareMountTargetPrototype)
				createShareMountTargetOptionsModel.SetShareID("testString")
				createShareMountTargetOptionsModel.SetShareMountTargetPrototype(shareMountTargetPrototypeModel)
				createShareMountTargetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createShareMountTargetOptionsModel).ToNot(BeNil())
				Expect(createShareMountTargetOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(createShareMountTargetOptionsModel.ShareMountTargetPrototype).To(Equal(shareMountTargetPrototypeModel))
				Expect(createShareMountTargetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateShareOptions successfully`, func() {
				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
				Expect(virtualNetworkInterfaceIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfaceIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfaceIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfaceIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(virtualNetworkInterfaceIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(virtualNetworkInterfaceIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(virtualNetworkInterfaceIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfacePrimaryIPPrototypeModel.Address = core.StringPtr("10.0.0.5")
				virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete = core.BoolPtr(false)
				virtualNetworkInterfacePrimaryIPPrototypeModel.Name = core.StringPtr("my-reserved-ip")
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.Address).To(Equal(core.StringPtr("10.0.0.5")))
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				Expect(securityGroupIdentityModel).ToNot(BeNil())
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
				Expect(securityGroupIdentityModel.ID).To(Equal(core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")))

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				Expect(subnetIdentityModel).ToNot(BeNil())
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
				Expect(subnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")))

				// Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
				shareMountTargetVirtualNetworkInterfacePrototypeModel := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext)
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel).ToNot(BeNil())
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AllowIPSpoofing = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.AutoDelete = core.BoolPtr(false)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.EnableInfrastructureNat = core.BoolPtr(true)
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Ips = []vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Name = core.StringPtr("my-virtual-network-interface")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.PrimaryIP = virtualNetworkInterfacePrimaryIPPrototypeModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ProtocolStateFilteringMode = core.StringPtr("auto")
				shareMountTargetVirtualNetworkInterfacePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				shareMountTargetVirtualNetworkInterfacePrototypeModel.SecurityGroups = []vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}
				shareMountTargetVirtualNetworkInterfacePrototypeModel.Subnet = subnetIdentityModel
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.AllowIPSpoofing).To(Equal(core.BoolPtr(true)))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.EnableInfrastructureNat).To(Equal(core.BoolPtr(true)))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.Ips).To(Equal([]vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.Name).To(Equal(core.StringPtr("my-virtual-network-interface")))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.PrimaryIP).To(Equal(virtualNetworkInterfacePrimaryIPPrototypeModel))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.ProtocolStateFilteringMode).To(Equal(core.StringPtr("auto")))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.SecurityGroups).To(Equal([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}))
				Expect(shareMountTargetVirtualNetworkInterfacePrototypeModel.Subnet).To(Equal(subnetIdentityModel))

				// Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
				shareMountTargetPrototypeModel := new(vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup)
				Expect(shareMountTargetPrototypeModel).ToNot(BeNil())
				shareMountTargetPrototypeModel.AccessProtocol = core.StringPtr("nfs4")
				shareMountTargetPrototypeModel.Name = core.StringPtr("my-share-mount-target")
				shareMountTargetPrototypeModel.TransitEncryption = core.StringPtr("none")
				shareMountTargetPrototypeModel.VirtualNetworkInterface = shareMountTargetVirtualNetworkInterfacePrototypeModel
				Expect(shareMountTargetPrototypeModel.AccessProtocol).To(Equal(core.StringPtr("nfs4")))
				Expect(shareMountTargetPrototypeModel.Name).To(Equal(core.StringPtr("my-share-mount-target")))
				Expect(shareMountTargetPrototypeModel.TransitEncryption).To(Equal(core.StringPtr("none")))
				Expect(shareMountTargetPrototypeModel.VirtualNetworkInterface).To(Equal(shareMountTargetVirtualNetworkInterfacePrototypeModel))

				// Construct an instance of the ShareProfileIdentityByName model
				shareProfileIdentityModel := new(vpcv1.ShareProfileIdentityByName)
				Expect(shareProfileIdentityModel).ToNot(BeNil())
				shareProfileIdentityModel.Name = core.StringPtr("tier-3iops")
				Expect(shareProfileIdentityModel.Name).To(Equal(core.StringPtr("tier-3iops")))

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the SharePrototypeShareContext model
				sharePrototypeShareContextModel := new(vpcv1.SharePrototypeShareContext)
				Expect(sharePrototypeShareContextModel).ToNot(BeNil())
				sharePrototypeShareContextModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePrototypeShareContextModel.Iops = core.Int64Ptr(int64(100))
				sharePrototypeShareContextModel.MountTargets = []vpcv1.ShareMountTargetPrototypeIntf{shareMountTargetPrototypeModel}
				sharePrototypeShareContextModel.Name = core.StringPtr("my-share")
				sharePrototypeShareContextModel.Profile = shareProfileIdentityModel
				sharePrototypeShareContextModel.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
				sharePrototypeShareContextModel.ResourceGroup = resourceGroupIdentityModel
				sharePrototypeShareContextModel.UserTags = []string{}
				sharePrototypeShareContextModel.Zone = zoneIdentityModel
				Expect(sharePrototypeShareContextModel.AllowedTransitEncryptionModes).To(Equal([]string{"ipsec"}))
				Expect(sharePrototypeShareContextModel.Iops).To(Equal(core.Int64Ptr(int64(100))))
				Expect(sharePrototypeShareContextModel.MountTargets).To(Equal([]vpcv1.ShareMountTargetPrototypeIntf{shareMountTargetPrototypeModel}))
				Expect(sharePrototypeShareContextModel.Name).To(Equal(core.StringPtr("my-share")))
				Expect(sharePrototypeShareContextModel.Profile).To(Equal(shareProfileIdentityModel))
				Expect(sharePrototypeShareContextModel.ReplicationCronSpec).To(Equal(core.StringPtr("0 */5 * * *")))
				Expect(sharePrototypeShareContextModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(sharePrototypeShareContextModel.UserTags).To(Equal([]string{}))
				Expect(sharePrototypeShareContextModel.Zone).To(Equal(zoneIdentityModel))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				Expect(encryptionKeyIdentityModel).ToNot(BeNil())
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")
				Expect(encryptionKeyIdentityModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")))

				// Construct an instance of the ShareInitialOwner model
				shareInitialOwnerModel := new(vpcv1.ShareInitialOwner)
				Expect(shareInitialOwnerModel).ToNot(BeNil())
				shareInitialOwnerModel.Gid = core.Int64Ptr(int64(50))
				shareInitialOwnerModel.Uid = core.Int64Ptr(int64(50))
				Expect(shareInitialOwnerModel.Gid).To(Equal(core.Int64Ptr(int64(50))))
				Expect(shareInitialOwnerModel.Uid).To(Equal(core.Int64Ptr(int64(50))))

				// Construct an instance of the SharePrototypeShareBySize model
				sharePrototypeModel := new(vpcv1.SharePrototypeShareBySize)
				Expect(sharePrototypeModel).ToNot(BeNil())
				sharePrototypeModel.AllowedTransitEncryptionModes = []string{"ipsec"}
				sharePrototypeModel.MountTargets = []vpcv1.ShareMountTargetPrototypeIntf{shareMountTargetPrototypeModel}
				sharePrototypeModel.Name = core.StringPtr("my-share")
				sharePrototypeModel.ReplicaShare = sharePrototypeShareContextModel
				sharePrototypeModel.UserTags = []string{}
				sharePrototypeModel.AccessControlMode = core.StringPtr("security_group")
				sharePrototypeModel.AllowedAccessProtocols = []string{"nfs4"}
				sharePrototypeModel.Bandwidth = core.Int64Ptr(int64(100))
				sharePrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				sharePrototypeModel.InitialOwner = shareInitialOwnerModel
				sharePrototypeModel.Iops = core.Int64Ptr(int64(100))
				sharePrototypeModel.Profile = shareProfileIdentityModel
				sharePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				sharePrototypeModel.Size = core.Int64Ptr(int64(200))
				sharePrototypeModel.Zone = zoneIdentityModel
				Expect(sharePrototypeModel.AllowedTransitEncryptionModes).To(Equal([]string{"ipsec"}))
				Expect(sharePrototypeModel.MountTargets).To(Equal([]vpcv1.ShareMountTargetPrototypeIntf{shareMountTargetPrototypeModel}))
				Expect(sharePrototypeModel.Name).To(Equal(core.StringPtr("my-share")))
				Expect(sharePrototypeModel.ReplicaShare).To(Equal(sharePrototypeShareContextModel))
				Expect(sharePrototypeModel.UserTags).To(Equal([]string{}))
				Expect(sharePrototypeModel.AccessControlMode).To(Equal(core.StringPtr("security_group")))
				Expect(sharePrototypeModel.AllowedAccessProtocols).To(Equal([]string{"nfs4"}))
				Expect(sharePrototypeModel.Bandwidth).To(Equal(core.Int64Ptr(int64(100))))
				Expect(sharePrototypeModel.EncryptionKey).To(Equal(encryptionKeyIdentityModel))
				Expect(sharePrototypeModel.InitialOwner).To(Equal(shareInitialOwnerModel))
				Expect(sharePrototypeModel.Iops).To(Equal(core.Int64Ptr(int64(100))))
				Expect(sharePrototypeModel.Profile).To(Equal(shareProfileIdentityModel))
				Expect(sharePrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(sharePrototypeModel.Size).To(Equal(core.Int64Ptr(int64(200))))
				Expect(sharePrototypeModel.Zone).To(Equal(zoneIdentityModel))

				// Construct an instance of the CreateShareOptions model
				var sharePrototype vpcv1.SharePrototypeIntf = nil
				createShareOptionsModel := vpcService.NewCreateShareOptions(sharePrototype)
				createShareOptionsModel.SetSharePrototype(sharePrototypeModel)
				createShareOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createShareOptionsModel).ToNot(BeNil())
				Expect(createShareOptionsModel.SharePrototype).To(Equal(sharePrototypeModel))
				Expect(createShareOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateShareSnapshotOptions successfully`, func() {
				// Construct an instance of the CreateShareSnapshotOptions model
				shareID := "testString"
				createShareSnapshotOptionsModel := vpcService.NewCreateShareSnapshotOptions(shareID)
				createShareSnapshotOptionsModel.SetShareID("testString")
				createShareSnapshotOptionsModel.SetName("my-share-snapshot")
				createShareSnapshotOptionsModel.SetUserTags([]string{"testString"})
				createShareSnapshotOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createShareSnapshotOptionsModel).ToNot(BeNil())
				Expect(createShareSnapshotOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(createShareSnapshotOptionsModel.Name).To(Equal(core.StringPtr("my-share-snapshot")))
				Expect(createShareSnapshotOptionsModel.UserTags).To(Equal([]string{"testString"}))
				Expect(createShareSnapshotOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateSnapshotCloneOptions successfully`, func() {
				// Construct an instance of the CreateSnapshotCloneOptions model
				id := "testString"
				zoneName := "us-south-1"
				createSnapshotCloneOptionsModel := vpcService.NewCreateSnapshotCloneOptions(id, zoneName)
				createSnapshotCloneOptionsModel.SetID("testString")
				createSnapshotCloneOptionsModel.SetZoneName("us-south-1")
				createSnapshotCloneOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createSnapshotCloneOptionsModel).ToNot(BeNil())
				Expect(createSnapshotCloneOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(createSnapshotCloneOptionsModel.ZoneName).To(Equal(core.StringPtr("us-south-1")))
				Expect(createSnapshotCloneOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateSnapshotConsistencyGroupOptions successfully`, func() {
				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the VolumeIdentityByID model
				volumeIdentityModel := new(vpcv1.VolumeIdentityByID)
				Expect(volumeIdentityModel).ToNot(BeNil())
				volumeIdentityModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
				Expect(volumeIdentityModel.ID).To(Equal(core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")))

				// Construct an instance of the SnapshotPrototypeSnapshotConsistencyGroupContext model
				snapshotPrototypeSnapshotConsistencyGroupContextModel := new(vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext)
				Expect(snapshotPrototypeSnapshotConsistencyGroupContextModel).ToNot(BeNil())
				snapshotPrototypeSnapshotConsistencyGroupContextModel.Name = core.StringPtr("my-snapshot")
				snapshotPrototypeSnapshotConsistencyGroupContextModel.SourceVolume = volumeIdentityModel
				snapshotPrototypeSnapshotConsistencyGroupContextModel.UserTags = []string{"testString"}
				Expect(snapshotPrototypeSnapshotConsistencyGroupContextModel.Name).To(Equal(core.StringPtr("my-snapshot")))
				Expect(snapshotPrototypeSnapshotConsistencyGroupContextModel.SourceVolume).To(Equal(volumeIdentityModel))
				Expect(snapshotPrototypeSnapshotConsistencyGroupContextModel.UserTags).To(Equal([]string{"testString"}))

				// Construct an instance of the SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots model
				snapshotConsistencyGroupPrototypeModel := new(vpcv1.SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots)
				Expect(snapshotConsistencyGroupPrototypeModel).ToNot(BeNil())
				snapshotConsistencyGroupPrototypeModel.DeleteSnapshotsOnDelete = core.BoolPtr(true)
				snapshotConsistencyGroupPrototypeModel.Name = core.StringPtr("my-snapshot-consistency-group")
				snapshotConsistencyGroupPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				snapshotConsistencyGroupPrototypeModel.Snapshots = []vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext{*snapshotPrototypeSnapshotConsistencyGroupContextModel}
				Expect(snapshotConsistencyGroupPrototypeModel.DeleteSnapshotsOnDelete).To(Equal(core.BoolPtr(true)))
				Expect(snapshotConsistencyGroupPrototypeModel.Name).To(Equal(core.StringPtr("my-snapshot-consistency-group")))
				Expect(snapshotConsistencyGroupPrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(snapshotConsistencyGroupPrototypeModel.Snapshots).To(Equal([]vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext{*snapshotPrototypeSnapshotConsistencyGroupContextModel}))

				// Construct an instance of the CreateSnapshotConsistencyGroupOptions model
				var snapshotConsistencyGroupPrototype vpcv1.SnapshotConsistencyGroupPrototypeIntf = nil
				createSnapshotConsistencyGroupOptionsModel := vpcService.NewCreateSnapshotConsistencyGroupOptions(snapshotConsistencyGroupPrototype)
				createSnapshotConsistencyGroupOptionsModel.SetSnapshotConsistencyGroupPrototype(snapshotConsistencyGroupPrototypeModel)
				createSnapshotConsistencyGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createSnapshotConsistencyGroupOptionsModel).ToNot(BeNil())
				Expect(createSnapshotConsistencyGroupOptionsModel.SnapshotConsistencyGroupPrototype).To(Equal(snapshotConsistencyGroupPrototypeModel))
				Expect(createSnapshotConsistencyGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateSnapshotOptions successfully`, func() {
				// Construct an instance of the SnapshotAllowedUsePrototype model
				snapshotAllowedUsePrototypeModel := new(vpcv1.SnapshotAllowedUsePrototype)
				Expect(snapshotAllowedUsePrototypeModel).ToNot(BeNil())
				snapshotAllowedUsePrototypeModel.ApiVersion = core.StringPtr("2024-06-23")
				snapshotAllowedUsePrototypeModel.BareMetalServer = core.StringPtr("enable_secure_boot == true")
				snapshotAllowedUsePrototypeModel.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")
				Expect(snapshotAllowedUsePrototypeModel.ApiVersion).To(Equal(core.StringPtr("2024-06-23")))
				Expect(snapshotAllowedUsePrototypeModel.BareMetalServer).To(Equal(core.StringPtr("enable_secure_boot == true")))
				Expect(snapshotAllowedUsePrototypeModel.Instance).To(Equal(core.StringPtr("gpu.count > 0 && enable_secure_boot == true")))

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the SnapshotClonePrototype model
				snapshotClonePrototypeModel := new(vpcv1.SnapshotClonePrototype)
				Expect(snapshotClonePrototypeModel).ToNot(BeNil())
				snapshotClonePrototypeModel.Zone = zoneIdentityModel
				Expect(snapshotClonePrototypeModel.Zone).To(Equal(zoneIdentityModel))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the VolumeIdentityByID model
				volumeIdentityModel := new(vpcv1.VolumeIdentityByID)
				Expect(volumeIdentityModel).ToNot(BeNil())
				volumeIdentityModel.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
				Expect(volumeIdentityModel.ID).To(Equal(core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")))

				// Construct an instance of the SnapshotPrototypeSnapshotBySourceVolume model
				snapshotPrototypeModel := new(vpcv1.SnapshotPrototypeSnapshotBySourceVolume)
				Expect(snapshotPrototypeModel).ToNot(BeNil())
				snapshotPrototypeModel.AllowedUse = snapshotAllowedUsePrototypeModel
				snapshotPrototypeModel.Clones = []vpcv1.SnapshotClonePrototype{*snapshotClonePrototypeModel}
				snapshotPrototypeModel.Name = core.StringPtr("my-snapshot")
				snapshotPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				snapshotPrototypeModel.UserTags = []string{}
				snapshotPrototypeModel.SourceVolume = volumeIdentityModel
				Expect(snapshotPrototypeModel.AllowedUse).To(Equal(snapshotAllowedUsePrototypeModel))
				Expect(snapshotPrototypeModel.Clones).To(Equal([]vpcv1.SnapshotClonePrototype{*snapshotClonePrototypeModel}))
				Expect(snapshotPrototypeModel.Name).To(Equal(core.StringPtr("my-snapshot")))
				Expect(snapshotPrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(snapshotPrototypeModel.UserTags).To(Equal([]string{}))
				Expect(snapshotPrototypeModel.SourceVolume).To(Equal(volumeIdentityModel))

				// Construct an instance of the CreateSnapshotOptions model
				var snapshotPrototype vpcv1.SnapshotPrototypeIntf = nil
				createSnapshotOptionsModel := vpcService.NewCreateSnapshotOptions(snapshotPrototype)
				createSnapshotOptionsModel.SetSnapshotPrototype(snapshotPrototypeModel)
				createSnapshotOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createSnapshotOptionsModel).ToNot(BeNil())
				Expect(createSnapshotOptionsModel.SnapshotPrototype).To(Equal(snapshotPrototypeModel))
				Expect(createSnapshotOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateSubnetOptions successfully`, func() {
				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				Expect(networkACLIdentityModel).ToNot(BeNil())
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")
				Expect(networkACLIdentityModel.ID).To(Equal(core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")))

				// Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityByID model
				publicGatewayIdentityModel := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByID)
				Expect(publicGatewayIdentityModel).ToNot(BeNil())
				publicGatewayIdentityModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")
				Expect(publicGatewayIdentityModel.ID).To(Equal(core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				Expect(routingTableIdentityModel).ToNot(BeNil())
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")
				Expect(routingTableIdentityModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")))

				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				Expect(vpcIdentityModel).ToNot(BeNil())
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				Expect(vpcIdentityModel.ID).To(Equal(core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the SubnetPrototypeSubnetByTotalCount model
				subnetPrototypeModel := new(vpcv1.SubnetPrototypeSubnetByTotalCount)
				Expect(subnetPrototypeModel).ToNot(BeNil())
				subnetPrototypeModel.IPVersion = core.StringPtr("ipv4")
				subnetPrototypeModel.Name = core.StringPtr("my-subnet")
				subnetPrototypeModel.NetworkACL = networkACLIdentityModel
				subnetPrototypeModel.PublicGateway = publicGatewayIdentityModel
				subnetPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				subnetPrototypeModel.RoutingTable = routingTableIdentityModel
				subnetPrototypeModel.VPC = vpcIdentityModel
				subnetPrototypeModel.TotalIpv4AddressCount = core.Int64Ptr(int64(256))
				subnetPrototypeModel.Zone = zoneIdentityModel
				Expect(subnetPrototypeModel.IPVersion).To(Equal(core.StringPtr("ipv4")))
				Expect(subnetPrototypeModel.Name).To(Equal(core.StringPtr("my-subnet")))
				Expect(subnetPrototypeModel.NetworkACL).To(Equal(networkACLIdentityModel))
				Expect(subnetPrototypeModel.PublicGateway).To(Equal(publicGatewayIdentityModel))
				Expect(subnetPrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(subnetPrototypeModel.RoutingTable).To(Equal(routingTableIdentityModel))
				Expect(subnetPrototypeModel.VPC).To(Equal(vpcIdentityModel))
				Expect(subnetPrototypeModel.TotalIpv4AddressCount).To(Equal(core.Int64Ptr(int64(256))))
				Expect(subnetPrototypeModel.Zone).To(Equal(zoneIdentityModel))

				// Construct an instance of the CreateSubnetOptions model
				var subnetPrototype vpcv1.SubnetPrototypeIntf = nil
				createSubnetOptionsModel := vpcService.NewCreateSubnetOptions(subnetPrototype)
				createSubnetOptionsModel.SetSubnetPrototype(subnetPrototypeModel)
				createSubnetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createSubnetOptionsModel).ToNot(BeNil())
				Expect(createSubnetOptionsModel.SubnetPrototype).To(Equal(subnetPrototypeModel))
				Expect(createSubnetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateSubnetReservedIPOptions successfully`, func() {
				// Construct an instance of the ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID model
				reservedIPTargetPrototypeModel := new(vpcv1.ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID)
				Expect(reservedIPTargetPrototypeModel).ToNot(BeNil())
				reservedIPTargetPrototypeModel.ID = core.StringPtr("r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")
				Expect(reservedIPTargetPrototypeModel.ID).To(Equal(core.StringPtr("r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")))

				// Construct an instance of the CreateSubnetReservedIPOptions model
				subnetID := "testString"
				createSubnetReservedIPOptionsModel := vpcService.NewCreateSubnetReservedIPOptions(subnetID)
				createSubnetReservedIPOptionsModel.SetSubnetID("testString")
				createSubnetReservedIPOptionsModel.SetAddress("192.168.3.4")
				createSubnetReservedIPOptionsModel.SetAutoDelete(false)
				createSubnetReservedIPOptionsModel.SetName("my-reserved-ip")
				createSubnetReservedIPOptionsModel.SetTarget(reservedIPTargetPrototypeModel)
				createSubnetReservedIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createSubnetReservedIPOptionsModel).ToNot(BeNil())
				Expect(createSubnetReservedIPOptionsModel.SubnetID).To(Equal(core.StringPtr("testString")))
				Expect(createSubnetReservedIPOptionsModel.Address).To(Equal(core.StringPtr("192.168.3.4")))
				Expect(createSubnetReservedIPOptionsModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(createSubnetReservedIPOptionsModel.Name).To(Equal(core.StringPtr("my-reserved-ip")))
				Expect(createSubnetReservedIPOptionsModel.Target).To(Equal(reservedIPTargetPrototypeModel))
				Expect(createSubnetReservedIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateVirtualNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID model
				virtualNetworkInterfaceIPPrototypeModel := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID)
				Expect(virtualNetworkInterfaceIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfaceIPPrototypeModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
				Expect(virtualNetworkInterfaceIPPrototypeModel.ID).To(Equal(core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")))

				// Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID model
				virtualNetworkInterfacePrimaryIPPrototypeModel := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID)
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel).ToNot(BeNil())
				virtualNetworkInterfacePrimaryIPPrototypeModel.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
				Expect(virtualNetworkInterfacePrimaryIPPrototypeModel.ID).To(Equal(core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				Expect(securityGroupIdentityModel).ToNot(BeNil())
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
				Expect(securityGroupIdentityModel.ID).To(Equal(core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")))

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				Expect(subnetIdentityModel).ToNot(BeNil())
				subnetIdentityModel.ID = core.StringPtr("69e55145-cc7d-4d8e-9e1f-cc3fb60b1793")
				Expect(subnetIdentityModel.ID).To(Equal(core.StringPtr("69e55145-cc7d-4d8e-9e1f-cc3fb60b1793")))

				// Construct an instance of the CreateVirtualNetworkInterfaceOptions model
				createVirtualNetworkInterfaceOptionsModel := vpcService.NewCreateVirtualNetworkInterfaceOptions()
				createVirtualNetworkInterfaceOptionsModel.SetAllowIPSpoofing(false)
				createVirtualNetworkInterfaceOptionsModel.SetAutoDelete(false)
				createVirtualNetworkInterfaceOptionsModel.SetEnableInfrastructureNat(true)
				createVirtualNetworkInterfaceOptionsModel.SetIps([]vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel})
				createVirtualNetworkInterfaceOptionsModel.SetName("my-virtual-network-interface")
				createVirtualNetworkInterfaceOptionsModel.SetPrimaryIP(virtualNetworkInterfacePrimaryIPPrototypeModel)
				createVirtualNetworkInterfaceOptionsModel.SetProtocolStateFilteringMode("auto")
				createVirtualNetworkInterfaceOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createVirtualNetworkInterfaceOptionsModel.SetSecurityGroups([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel})
				createVirtualNetworkInterfaceOptionsModel.SetSubnet(subnetIdentityModel)
				createVirtualNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createVirtualNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(createVirtualNetworkInterfaceOptionsModel.AllowIPSpoofing).To(Equal(core.BoolPtr(false)))
				Expect(createVirtualNetworkInterfaceOptionsModel.AutoDelete).To(Equal(core.BoolPtr(false)))
				Expect(createVirtualNetworkInterfaceOptionsModel.EnableInfrastructureNat).To(Equal(core.BoolPtr(true)))
				Expect(createVirtualNetworkInterfaceOptionsModel.Ips).To(Equal([]vpcv1.VirtualNetworkInterfaceIPPrototypeIntf{virtualNetworkInterfaceIPPrototypeModel}))
				Expect(createVirtualNetworkInterfaceOptionsModel.Name).To(Equal(core.StringPtr("my-virtual-network-interface")))
				Expect(createVirtualNetworkInterfaceOptionsModel.PrimaryIP).To(Equal(virtualNetworkInterfacePrimaryIPPrototypeModel))
				Expect(createVirtualNetworkInterfaceOptionsModel.ProtocolStateFilteringMode).To(Equal(core.StringPtr("auto")))
				Expect(createVirtualNetworkInterfaceOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createVirtualNetworkInterfaceOptionsModel.SecurityGroups).To(Equal([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}))
				Expect(createVirtualNetworkInterfaceOptionsModel.Subnet).To(Equal(subnetIdentityModel))
				Expect(createVirtualNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateVolumeOptions successfully`, func() {
				// Construct an instance of the VolumeProfileIdentityByName model
				volumeProfileIdentityModel := new(vpcv1.VolumeProfileIdentityByName)
				Expect(volumeProfileIdentityModel).ToNot(BeNil())
				volumeProfileIdentityModel.Name = core.StringPtr("general-purpose")
				Expect(volumeProfileIdentityModel.Name).To(Equal(core.StringPtr("general-purpose")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the EncryptionKeyIdentityByCRN model
				encryptionKeyIdentityModel := new(vpcv1.EncryptionKeyIdentityByCRN)
				Expect(encryptionKeyIdentityModel).ToNot(BeNil())
				encryptionKeyIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")
				Expect(encryptionKeyIdentityModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")))

				// Construct an instance of the VolumePrototypeVolumeByCapacity model
				volumePrototypeModel := new(vpcv1.VolumePrototypeVolumeByCapacity)
				Expect(volumePrototypeModel).ToNot(BeNil())
				volumePrototypeModel.Bandwidth = core.Int64Ptr(int64(1000))
				volumePrototypeModel.Iops = core.Int64Ptr(int64(10000))
				volumePrototypeModel.Name = core.StringPtr("my-volume")
				volumePrototypeModel.Profile = volumeProfileIdentityModel
				volumePrototypeModel.ResourceGroup = resourceGroupIdentityModel
				volumePrototypeModel.UserTags = []string{}
				volumePrototypeModel.Zone = zoneIdentityModel
				volumePrototypeModel.Capacity = core.Int64Ptr(int64(100))
				volumePrototypeModel.EncryptionKey = encryptionKeyIdentityModel
				Expect(volumePrototypeModel.Bandwidth).To(Equal(core.Int64Ptr(int64(1000))))
				Expect(volumePrototypeModel.Iops).To(Equal(core.Int64Ptr(int64(10000))))
				Expect(volumePrototypeModel.Name).To(Equal(core.StringPtr("my-volume")))
				Expect(volumePrototypeModel.Profile).To(Equal(volumeProfileIdentityModel))
				Expect(volumePrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(volumePrototypeModel.UserTags).To(Equal([]string{}))
				Expect(volumePrototypeModel.Zone).To(Equal(zoneIdentityModel))
				Expect(volumePrototypeModel.Capacity).To(Equal(core.Int64Ptr(int64(100))))
				Expect(volumePrototypeModel.EncryptionKey).To(Equal(encryptionKeyIdentityModel))

				// Construct an instance of the CreateVolumeOptions model
				var volumePrototype vpcv1.VolumePrototypeIntf = nil
				createVolumeOptionsModel := vpcService.NewCreateVolumeOptions(volumePrototype)
				createVolumeOptionsModel.SetVolumePrototype(volumePrototypeModel)
				createVolumeOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createVolumeOptionsModel).ToNot(BeNil())
				Expect(createVolumeOptionsModel.VolumePrototype).To(Equal(volumePrototypeModel))
				Expect(createVolumeOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateVPCAddressPrefixOptions successfully`, func() {
				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the CreateVPCAddressPrefixOptions model
				vpcID := "testString"
				createVPCAddressPrefixOptionsCIDR := "10.240.0.0/18"
				var createVPCAddressPrefixOptionsZone vpcv1.ZoneIdentityIntf = nil
				createVPCAddressPrefixOptionsModel := vpcService.NewCreateVPCAddressPrefixOptions(vpcID, createVPCAddressPrefixOptionsCIDR, createVPCAddressPrefixOptionsZone)
				createVPCAddressPrefixOptionsModel.SetVPCID("testString")
				createVPCAddressPrefixOptionsModel.SetCIDR("10.240.0.0/18")
				createVPCAddressPrefixOptionsModel.SetZone(zoneIdentityModel)
				createVPCAddressPrefixOptionsModel.SetIsDefault(true)
				createVPCAddressPrefixOptionsModel.SetName("my-vpc-address-prefix-zone-1")
				createVPCAddressPrefixOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createVPCAddressPrefixOptionsModel).ToNot(BeNil())
				Expect(createVPCAddressPrefixOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(createVPCAddressPrefixOptionsModel.CIDR).To(Equal(core.StringPtr("10.240.0.0/18")))
				Expect(createVPCAddressPrefixOptionsModel.Zone).To(Equal(zoneIdentityModel))
				Expect(createVPCAddressPrefixOptionsModel.IsDefault).To(Equal(core.BoolPtr(true)))
				Expect(createVPCAddressPrefixOptionsModel.Name).To(Equal(core.StringPtr("my-vpc-address-prefix-zone-1")))
				Expect(createVPCAddressPrefixOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateVPCDnsResolutionBindingOptions successfully`, func() {
				// Construct an instance of the VPCIdentityByID model
				vpcIdentityModel := new(vpcv1.VPCIdentityByID)
				Expect(vpcIdentityModel).ToNot(BeNil())
				vpcIdentityModel.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				Expect(vpcIdentityModel.ID).To(Equal(core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))

				// Construct an instance of the CreateVPCDnsResolutionBindingOptions model
				vpcID := "testString"
				var createVPCDnsResolutionBindingOptionsVPC vpcv1.VPCIdentityIntf = nil
				createVPCDnsResolutionBindingOptionsModel := vpcService.NewCreateVPCDnsResolutionBindingOptions(vpcID, createVPCDnsResolutionBindingOptionsVPC)
				createVPCDnsResolutionBindingOptionsModel.SetVPCID("testString")
				createVPCDnsResolutionBindingOptionsModel.SetVPC(vpcIdentityModel)
				createVPCDnsResolutionBindingOptionsModel.SetName("my-dns-resolution-binding")
				createVPCDnsResolutionBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createVPCDnsResolutionBindingOptionsModel).ToNot(BeNil())
				Expect(createVPCDnsResolutionBindingOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(createVPCDnsResolutionBindingOptionsModel.VPC).To(Equal(vpcIdentityModel))
				Expect(createVPCDnsResolutionBindingOptionsModel.Name).To(Equal(core.StringPtr("my-dns-resolution-binding")))
				Expect(createVPCDnsResolutionBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateVPCOptions successfully`, func() {
				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the DnsServerPrototype model
				dnsServerPrototypeModel := new(vpcv1.DnsServerPrototype)
				Expect(dnsServerPrototypeModel).ToNot(BeNil())
				dnsServerPrototypeModel.Address = core.StringPtr("192.168.3.4")
				dnsServerPrototypeModel.ZoneAffinity = zoneIdentityModel
				Expect(dnsServerPrototypeModel.Address).To(Equal(core.StringPtr("192.168.3.4")))
				Expect(dnsServerPrototypeModel.ZoneAffinity).To(Equal(zoneIdentityModel))

				// Construct an instance of the VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype model
				vpcdnsResolverPrototypeModel := new(vpcv1.VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype)
				Expect(vpcdnsResolverPrototypeModel).ToNot(BeNil())
				vpcdnsResolverPrototypeModel.ManualServers = []vpcv1.DnsServerPrototype{*dnsServerPrototypeModel}
				vpcdnsResolverPrototypeModel.Type = core.StringPtr("manual")
				Expect(vpcdnsResolverPrototypeModel.ManualServers).To(Equal([]vpcv1.DnsServerPrototype{*dnsServerPrototypeModel}))
				Expect(vpcdnsResolverPrototypeModel.Type).To(Equal(core.StringPtr("manual")))

				// Construct an instance of the VpcdnsPrototype model
				vpcdnsPrototypeModel := new(vpcv1.VpcdnsPrototype)
				Expect(vpcdnsPrototypeModel).ToNot(BeNil())
				vpcdnsPrototypeModel.EnableHub = core.BoolPtr(false)
				vpcdnsPrototypeModel.Resolver = vpcdnsResolverPrototypeModel
				Expect(vpcdnsPrototypeModel.EnableHub).To(Equal(core.BoolPtr(false)))
				Expect(vpcdnsPrototypeModel.Resolver).To(Equal(vpcdnsResolverPrototypeModel))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the CreateVPCOptions model
				createVPCOptionsModel := vpcService.NewCreateVPCOptions()
				createVPCOptionsModel.SetAddressPrefixManagement("auto")
				createVPCOptionsModel.SetClassicAccess(false)
				createVPCOptionsModel.SetDns(vpcdnsPrototypeModel)
				createVPCOptionsModel.SetName("my-vpc")
				createVPCOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createVPCOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createVPCOptionsModel).ToNot(BeNil())
				Expect(createVPCOptionsModel.AddressPrefixManagement).To(Equal(core.StringPtr("auto")))
				Expect(createVPCOptionsModel.ClassicAccess).To(Equal(core.BoolPtr(false)))
				Expect(createVPCOptionsModel.Dns).To(Equal(vpcdnsPrototypeModel))
				Expect(createVPCOptionsModel.Name).To(Equal(core.StringPtr("my-vpc")))
				Expect(createVPCOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createVPCOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateVPCRouteOptions successfully`, func() {
				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				Expect(routeNextHopPrototypeModel).ToNot(BeNil())
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")
				Expect(routeNextHopPrototypeModel.Address).To(Equal(core.StringPtr("0.0.0.0")))

				// Construct an instance of the CreateVPCRouteOptions model
				vpcID := "testString"
				createVPCRouteOptionsDestination := "192.168.3.0/24"
				var createVPCRouteOptionsZone vpcv1.ZoneIdentityIntf = nil
				createVPCRouteOptionsModel := vpcService.NewCreateVPCRouteOptions(vpcID, createVPCRouteOptionsDestination, createVPCRouteOptionsZone)
				createVPCRouteOptionsModel.SetVPCID("testString")
				createVPCRouteOptionsModel.SetDestination("192.168.3.0/24")
				createVPCRouteOptionsModel.SetZone(zoneIdentityModel)
				createVPCRouteOptionsModel.SetAction("deliver")
				createVPCRouteOptionsModel.SetAdvertise(false)
				createVPCRouteOptionsModel.SetName("my-vpc-routing-table-route")
				createVPCRouteOptionsModel.SetNextHop(routeNextHopPrototypeModel)
				createVPCRouteOptionsModel.SetPriority(int64(1))
				createVPCRouteOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createVPCRouteOptionsModel).ToNot(BeNil())
				Expect(createVPCRouteOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(createVPCRouteOptionsModel.Destination).To(Equal(core.StringPtr("192.168.3.0/24")))
				Expect(createVPCRouteOptionsModel.Zone).To(Equal(zoneIdentityModel))
				Expect(createVPCRouteOptionsModel.Action).To(Equal(core.StringPtr("deliver")))
				Expect(createVPCRouteOptionsModel.Advertise).To(Equal(core.BoolPtr(false)))
				Expect(createVPCRouteOptionsModel.Name).To(Equal(core.StringPtr("my-vpc-routing-table-route")))
				Expect(createVPCRouteOptionsModel.NextHop).To(Equal(routeNextHopPrototypeModel))
				Expect(createVPCRouteOptionsModel.Priority).To(Equal(core.Int64Ptr(int64(1))))
				Expect(createVPCRouteOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateVPCRoutingTableOptions successfully`, func() {
				// Construct an instance of the ResourceFilter model
				resourceFilterModel := new(vpcv1.ResourceFilter)
				Expect(resourceFilterModel).ToNot(BeNil())
				resourceFilterModel.ResourceType = core.StringPtr("vpn_server")
				Expect(resourceFilterModel.ResourceType).To(Equal(core.StringPtr("vpn_server")))

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				Expect(routeNextHopPrototypeModel).ToNot(BeNil())
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")
				Expect(routeNextHopPrototypeModel.Address).To(Equal(core.StringPtr("0.0.0.0")))

				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the RoutePrototype model
				routePrototypeModel := new(vpcv1.RoutePrototype)
				Expect(routePrototypeModel).ToNot(BeNil())
				routePrototypeModel.Action = core.StringPtr("deliver")
				routePrototypeModel.Advertise = core.BoolPtr(false)
				routePrototypeModel.Destination = core.StringPtr("192.168.3.0/24")
				routePrototypeModel.Name = core.StringPtr("my-vpc-routing-table-route")
				routePrototypeModel.NextHop = routeNextHopPrototypeModel
				routePrototypeModel.Priority = core.Int64Ptr(int64(1))
				routePrototypeModel.Zone = zoneIdentityModel
				Expect(routePrototypeModel.Action).To(Equal(core.StringPtr("deliver")))
				Expect(routePrototypeModel.Advertise).To(Equal(core.BoolPtr(false)))
				Expect(routePrototypeModel.Destination).To(Equal(core.StringPtr("192.168.3.0/24")))
				Expect(routePrototypeModel.Name).To(Equal(core.StringPtr("my-vpc-routing-table-route")))
				Expect(routePrototypeModel.NextHop).To(Equal(routeNextHopPrototypeModel))
				Expect(routePrototypeModel.Priority).To(Equal(core.Int64Ptr(int64(1))))
				Expect(routePrototypeModel.Zone).To(Equal(zoneIdentityModel))

				// Construct an instance of the CreateVPCRoutingTableOptions model
				vpcID := "testString"
				createVPCRoutingTableOptionsModel := vpcService.NewCreateVPCRoutingTableOptions(vpcID)
				createVPCRoutingTableOptionsModel.SetVPCID("testString")
				createVPCRoutingTableOptionsModel.SetAcceptRoutesFrom([]vpcv1.ResourceFilter{*resourceFilterModel})
				createVPCRoutingTableOptionsModel.SetAdvertiseRoutesTo([]string{})
				createVPCRoutingTableOptionsModel.SetName("my-routing-table-1")
				createVPCRoutingTableOptionsModel.SetRouteDirectLinkIngress(false)
				createVPCRoutingTableOptionsModel.SetRouteInternetIngress(false)
				createVPCRoutingTableOptionsModel.SetRouteTransitGatewayIngress(false)
				createVPCRoutingTableOptionsModel.SetRouteVPCZoneIngress(false)
				createVPCRoutingTableOptionsModel.SetRoutes([]vpcv1.RoutePrototype{*routePrototypeModel})
				createVPCRoutingTableOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createVPCRoutingTableOptionsModel).ToNot(BeNil())
				Expect(createVPCRoutingTableOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(createVPCRoutingTableOptionsModel.AcceptRoutesFrom).To(Equal([]vpcv1.ResourceFilter{*resourceFilterModel}))
				Expect(createVPCRoutingTableOptionsModel.AdvertiseRoutesTo).To(Equal([]string{}))
				Expect(createVPCRoutingTableOptionsModel.Name).To(Equal(core.StringPtr("my-routing-table-1")))
				Expect(createVPCRoutingTableOptionsModel.RouteDirectLinkIngress).To(Equal(core.BoolPtr(false)))
				Expect(createVPCRoutingTableOptionsModel.RouteInternetIngress).To(Equal(core.BoolPtr(false)))
				Expect(createVPCRoutingTableOptionsModel.RouteTransitGatewayIngress).To(Equal(core.BoolPtr(false)))
				Expect(createVPCRoutingTableOptionsModel.RouteVPCZoneIngress).To(Equal(core.BoolPtr(false)))
				Expect(createVPCRoutingTableOptionsModel.Routes).To(Equal([]vpcv1.RoutePrototype{*routePrototypeModel}))
				Expect(createVPCRoutingTableOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateVPCRoutingTableRouteOptions successfully`, func() {
				// Construct an instance of the ZoneIdentityByName model
				zoneIdentityModel := new(vpcv1.ZoneIdentityByName)
				Expect(zoneIdentityModel).ToNot(BeNil())
				zoneIdentityModel.Name = core.StringPtr("us-south-1")
				Expect(zoneIdentityModel.Name).To(Equal(core.StringPtr("us-south-1")))

				// Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model
				routeNextHopPrototypeModel := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
				Expect(routeNextHopPrototypeModel).ToNot(BeNil())
				routeNextHopPrototypeModel.Address = core.StringPtr("0.0.0.0")
				Expect(routeNextHopPrototypeModel.Address).To(Equal(core.StringPtr("0.0.0.0")))

				// Construct an instance of the CreateVPCRoutingTableRouteOptions model
				vpcID := "testString"
				routingTableID := "testString"
				createVPCRoutingTableRouteOptionsDestination := "192.168.3.0/24"
				var createVPCRoutingTableRouteOptionsZone vpcv1.ZoneIdentityIntf = nil
				createVPCRoutingTableRouteOptionsModel := vpcService.NewCreateVPCRoutingTableRouteOptions(vpcID, routingTableID, createVPCRoutingTableRouteOptionsDestination, createVPCRoutingTableRouteOptionsZone)
				createVPCRoutingTableRouteOptionsModel.SetVPCID("testString")
				createVPCRoutingTableRouteOptionsModel.SetRoutingTableID("testString")
				createVPCRoutingTableRouteOptionsModel.SetDestination("192.168.3.0/24")
				createVPCRoutingTableRouteOptionsModel.SetZone(zoneIdentityModel)
				createVPCRoutingTableRouteOptionsModel.SetAction("deliver")
				createVPCRoutingTableRouteOptionsModel.SetAdvertise(false)
				createVPCRoutingTableRouteOptionsModel.SetName("my-vpc-routing-table-route")
				createVPCRoutingTableRouteOptionsModel.SetNextHop(routeNextHopPrototypeModel)
				createVPCRoutingTableRouteOptionsModel.SetPriority(int64(1))
				createVPCRoutingTableRouteOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createVPCRoutingTableRouteOptionsModel).ToNot(BeNil())
				Expect(createVPCRoutingTableRouteOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(createVPCRoutingTableRouteOptionsModel.RoutingTableID).To(Equal(core.StringPtr("testString")))
				Expect(createVPCRoutingTableRouteOptionsModel.Destination).To(Equal(core.StringPtr("192.168.3.0/24")))
				Expect(createVPCRoutingTableRouteOptionsModel.Zone).To(Equal(zoneIdentityModel))
				Expect(createVPCRoutingTableRouteOptionsModel.Action).To(Equal(core.StringPtr("deliver")))
				Expect(createVPCRoutingTableRouteOptionsModel.Advertise).To(Equal(core.BoolPtr(false)))
				Expect(createVPCRoutingTableRouteOptionsModel.Name).To(Equal(core.StringPtr("my-vpc-routing-table-route")))
				Expect(createVPCRoutingTableRouteOptionsModel.NextHop).To(Equal(routeNextHopPrototypeModel))
				Expect(createVPCRoutingTableRouteOptionsModel.Priority).To(Equal(core.Int64Ptr(int64(1))))
				Expect(createVPCRoutingTableRouteOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateVPNGatewayConnectionOptions successfully`, func() {
				// Construct an instance of the VPNGatewayConnectionDpdPrototype model
				vpnGatewayConnectionDpdPrototypeModel := new(vpcv1.VPNGatewayConnectionDpdPrototype)
				Expect(vpnGatewayConnectionDpdPrototypeModel).ToNot(BeNil())
				vpnGatewayConnectionDpdPrototypeModel.Action = core.StringPtr("restart")
				vpnGatewayConnectionDpdPrototypeModel.Interval = core.Int64Ptr(int64(30))
				vpnGatewayConnectionDpdPrototypeModel.Timeout = core.Int64Ptr(int64(120))
				Expect(vpnGatewayConnectionDpdPrototypeModel.Action).To(Equal(core.StringPtr("restart")))
				Expect(vpnGatewayConnectionDpdPrototypeModel.Interval).To(Equal(core.Int64Ptr(int64(30))))
				Expect(vpnGatewayConnectionDpdPrototypeModel.Timeout).To(Equal(core.Int64Ptr(int64(120))))

				// Construct an instance of the VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID model
				vpnGatewayConnectionIkePolicyPrototypeModel := new(vpcv1.VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID)
				Expect(vpnGatewayConnectionIkePolicyPrototypeModel).ToNot(BeNil())
				vpnGatewayConnectionIkePolicyPrototypeModel.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")
				Expect(vpnGatewayConnectionIkePolicyPrototypeModel.ID).To(Equal(core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")))

				// Construct an instance of the VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID model
				vpnGatewayConnectionIPsecPolicyPrototypeModel := new(vpcv1.VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID)
				Expect(vpnGatewayConnectionIPsecPolicyPrototypeModel).ToNot(BeNil())
				vpnGatewayConnectionIPsecPolicyPrototypeModel.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")
				Expect(vpnGatewayConnectionIPsecPolicyPrototypeModel.ID).To(Equal(core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")))

				// Construct an instance of the VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn model
				vpnGatewayConnectionIkeIdentityPrototypeModel := new(vpcv1.VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn)
				Expect(vpnGatewayConnectionIkeIdentityPrototypeModel).ToNot(BeNil())
				vpnGatewayConnectionIkeIdentityPrototypeModel.Type = core.StringPtr("fqdn")
				vpnGatewayConnectionIkeIdentityPrototypeModel.Value = core.StringPtr("my-service.example.com")
				Expect(vpnGatewayConnectionIkeIdentityPrototypeModel.Type).To(Equal(core.StringPtr("fqdn")))
				Expect(vpnGatewayConnectionIkeIdentityPrototypeModel.Value).To(Equal(core.StringPtr("my-service.example.com")))

				// Construct an instance of the VPNGatewayConnectionStaticRouteModeLocalPrototype model
				vpnGatewayConnectionStaticRouteModeLocalPrototypeModel := new(vpcv1.VPNGatewayConnectionStaticRouteModeLocalPrototype)
				Expect(vpnGatewayConnectionStaticRouteModeLocalPrototypeModel).ToNot(BeNil())
				vpnGatewayConnectionStaticRouteModeLocalPrototypeModel.IkeIdentities = []vpcv1.VPNGatewayConnectionIkeIdentityPrototypeIntf{vpnGatewayConnectionIkeIdentityPrototypeModel}
				Expect(vpnGatewayConnectionStaticRouteModeLocalPrototypeModel.IkeIdentities).To(Equal([]vpcv1.VPNGatewayConnectionIkeIdentityPrototypeIntf{vpnGatewayConnectionIkeIdentityPrototypeModel}))

				// Construct an instance of the VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress model
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel := new(vpcv1.VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress)
				Expect(vpnGatewayConnectionStaticRouteModePeerPrototypeModel).ToNot(BeNil())
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel.IkeIdentity = vpnGatewayConnectionIkeIdentityPrototypeModel
				vpnGatewayConnectionStaticRouteModePeerPrototypeModel.Address = core.StringPtr("192.0.2.5")
				Expect(vpnGatewayConnectionStaticRouteModePeerPrototypeModel.IkeIdentity).To(Equal(vpnGatewayConnectionIkeIdentityPrototypeModel))
				Expect(vpnGatewayConnectionStaticRouteModePeerPrototypeModel.Address).To(Equal(core.StringPtr("192.0.2.5")))

				// Construct an instance of the VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model
				vpnGatewayConnectionPrototypeModel := new(vpcv1.VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype)
				Expect(vpnGatewayConnectionPrototypeModel).ToNot(BeNil())
				vpnGatewayConnectionPrototypeModel.AdminStateUp = core.BoolPtr(true)
				vpnGatewayConnectionPrototypeModel.DeadPeerDetection = vpnGatewayConnectionDpdPrototypeModel
				vpnGatewayConnectionPrototypeModel.EstablishMode = core.StringPtr("bidirectional")
				vpnGatewayConnectionPrototypeModel.IkePolicy = vpnGatewayConnectionIkePolicyPrototypeModel
				vpnGatewayConnectionPrototypeModel.IpsecPolicy = vpnGatewayConnectionIPsecPolicyPrototypeModel
				vpnGatewayConnectionPrototypeModel.Name = core.StringPtr("my-vpn-gateway-connection")
				vpnGatewayConnectionPrototypeModel.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
				vpnGatewayConnectionPrototypeModel.DistributeTraffic = core.BoolPtr(false)
				vpnGatewayConnectionPrototypeModel.Local = vpnGatewayConnectionStaticRouteModeLocalPrototypeModel
				vpnGatewayConnectionPrototypeModel.Peer = vpnGatewayConnectionStaticRouteModePeerPrototypeModel
				vpnGatewayConnectionPrototypeModel.RoutingProtocol = core.StringPtr("none")
				Expect(vpnGatewayConnectionPrototypeModel.AdminStateUp).To(Equal(core.BoolPtr(true)))
				Expect(vpnGatewayConnectionPrototypeModel.DeadPeerDetection).To(Equal(vpnGatewayConnectionDpdPrototypeModel))
				Expect(vpnGatewayConnectionPrototypeModel.EstablishMode).To(Equal(core.StringPtr("bidirectional")))
				Expect(vpnGatewayConnectionPrototypeModel.IkePolicy).To(Equal(vpnGatewayConnectionIkePolicyPrototypeModel))
				Expect(vpnGatewayConnectionPrototypeModel.IpsecPolicy).To(Equal(vpnGatewayConnectionIPsecPolicyPrototypeModel))
				Expect(vpnGatewayConnectionPrototypeModel.Name).To(Equal(core.StringPtr("my-vpn-gateway-connection")))
				Expect(vpnGatewayConnectionPrototypeModel.Psk).To(Equal(core.StringPtr("lkj14b1oi0alcniejkso")))
				Expect(vpnGatewayConnectionPrototypeModel.DistributeTraffic).To(Equal(core.BoolPtr(false)))
				Expect(vpnGatewayConnectionPrototypeModel.Local).To(Equal(vpnGatewayConnectionStaticRouteModeLocalPrototypeModel))
				Expect(vpnGatewayConnectionPrototypeModel.Peer).To(Equal(vpnGatewayConnectionStaticRouteModePeerPrototypeModel))
				Expect(vpnGatewayConnectionPrototypeModel.RoutingProtocol).To(Equal(core.StringPtr("none")))

				// Construct an instance of the CreateVPNGatewayConnectionOptions model
				vpnGatewayID := "testString"
				var vpnGatewayConnectionPrototype vpcv1.VPNGatewayConnectionPrototypeIntf = nil
				createVPNGatewayConnectionOptionsModel := vpcService.NewCreateVPNGatewayConnectionOptions(vpnGatewayID, vpnGatewayConnectionPrototype)
				createVPNGatewayConnectionOptionsModel.SetVPNGatewayID("testString")
				createVPNGatewayConnectionOptionsModel.SetVPNGatewayConnectionPrototype(vpnGatewayConnectionPrototypeModel)
				createVPNGatewayConnectionOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createVPNGatewayConnectionOptionsModel).ToNot(BeNil())
				Expect(createVPNGatewayConnectionOptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(createVPNGatewayConnectionOptionsModel.VPNGatewayConnectionPrototype).To(Equal(vpnGatewayConnectionPrototypeModel))
				Expect(createVPNGatewayConnectionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateVPNGatewayOptions successfully`, func() {
				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				Expect(subnetIdentityModel).ToNot(BeNil())
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
				Expect(subnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")))

				// Construct an instance of the VPNGatewayPrototypeVPNGatewayRouteModePrototype model
				vpnGatewayPrototypeModel := new(vpcv1.VPNGatewayPrototypeVPNGatewayRouteModePrototype)
				Expect(vpnGatewayPrototypeModel).ToNot(BeNil())
				vpnGatewayPrototypeModel.Name = core.StringPtr("my-vpn-gateway")
				vpnGatewayPrototypeModel.ResourceGroup = resourceGroupIdentityModel
				vpnGatewayPrototypeModel.Subnet = subnetIdentityModel
				vpnGatewayPrototypeModel.AdvertisedCIDRs = []string{"192.168.3.0/24"}
				vpnGatewayPrototypeModel.LocalAsn = core.Int64Ptr(int64(64520))
				vpnGatewayPrototypeModel.Mode = core.StringPtr("route")
				Expect(vpnGatewayPrototypeModel.Name).To(Equal(core.StringPtr("my-vpn-gateway")))
				Expect(vpnGatewayPrototypeModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(vpnGatewayPrototypeModel.Subnet).To(Equal(subnetIdentityModel))
				Expect(vpnGatewayPrototypeModel.AdvertisedCIDRs).To(Equal([]string{"192.168.3.0/24"}))
				Expect(vpnGatewayPrototypeModel.LocalAsn).To(Equal(core.Int64Ptr(int64(64520))))
				Expect(vpnGatewayPrototypeModel.Mode).To(Equal(core.StringPtr("route")))

				// Construct an instance of the CreateVPNGatewayOptions model
				var vpnGatewayPrototype vpcv1.VPNGatewayPrototypeIntf = nil
				createVPNGatewayOptionsModel := vpcService.NewCreateVPNGatewayOptions(vpnGatewayPrototype)
				createVPNGatewayOptionsModel.SetVPNGatewayPrototype(vpnGatewayPrototypeModel)
				createVPNGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createVPNGatewayOptionsModel).ToNot(BeNil())
				Expect(createVPNGatewayOptionsModel.VPNGatewayPrototype).To(Equal(vpnGatewayPrototypeModel))
				Expect(createVPNGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateVPNServerOptions successfully`, func() {
				// Construct an instance of the CertificateInstanceIdentityByCRN model
				certificateInstanceIdentityModel := new(vpcv1.CertificateInstanceIdentityByCRN)
				Expect(certificateInstanceIdentityModel).ToNot(BeNil())
				certificateInstanceIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")
				Expect(certificateInstanceIdentityModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")))

				// Construct an instance of the VPNServerAuthenticationByUsernameIDProviderByIam model
				vpnServerAuthenticationByUsernameIDProviderModel := new(vpcv1.VPNServerAuthenticationByUsernameIDProviderByIam)
				Expect(vpnServerAuthenticationByUsernameIDProviderModel).ToNot(BeNil())
				vpnServerAuthenticationByUsernameIDProviderModel.ProviderType = core.StringPtr("iam")
				Expect(vpnServerAuthenticationByUsernameIDProviderModel.ProviderType).To(Equal(core.StringPtr("iam")))

				// Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
				vpnServerAuthenticationPrototypeModel := new(vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype)
				Expect(vpnServerAuthenticationPrototypeModel).ToNot(BeNil())
				vpnServerAuthenticationPrototypeModel.Method = core.StringPtr("username")
				vpnServerAuthenticationPrototypeModel.IdentityProvider = vpnServerAuthenticationByUsernameIDProviderModel
				Expect(vpnServerAuthenticationPrototypeModel.Method).To(Equal(core.StringPtr("username")))
				Expect(vpnServerAuthenticationPrototypeModel.IdentityProvider).To(Equal(vpnServerAuthenticationByUsernameIDProviderModel))

				// Construct an instance of the SubnetIdentityByID model
				subnetIdentityModel := new(vpcv1.SubnetIdentityByID)
				Expect(subnetIdentityModel).ToNot(BeNil())
				subnetIdentityModel.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
				Expect(subnetIdentityModel.ID).To(Equal(core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")))

				// Construct an instance of the IP model
				ipModel := new(vpcv1.IP)
				Expect(ipModel).ToNot(BeNil())
				ipModel.Address = core.StringPtr("192.168.3.4")
				Expect(ipModel.Address).To(Equal(core.StringPtr("192.168.3.4")))

				// Construct an instance of the ResourceGroupIdentityByID model
				resourceGroupIdentityModel := new(vpcv1.ResourceGroupIdentityByID)
				Expect(resourceGroupIdentityModel).ToNot(BeNil())
				resourceGroupIdentityModel.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")
				Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")))

				// Construct an instance of the SecurityGroupIdentityByID model
				securityGroupIdentityModel := new(vpcv1.SecurityGroupIdentityByID)
				Expect(securityGroupIdentityModel).ToNot(BeNil())
				securityGroupIdentityModel.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
				Expect(securityGroupIdentityModel.ID).To(Equal(core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")))

				// Construct an instance of the CreateVPNServerOptions model
				var createVPNServerOptionsCertificate vpcv1.CertificateInstanceIdentityIntf = nil
				createVPNServerOptionsClientAuthentication := []vpcv1.VPNServerAuthenticationPrototypeIntf{}
				createVPNServerOptionsClientIPPool := "172.16.0.0/16"
				createVPNServerOptionsSubnets := []vpcv1.SubnetIdentityIntf{}
				createVPNServerOptionsModel := vpcService.NewCreateVPNServerOptions(createVPNServerOptionsCertificate, createVPNServerOptionsClientAuthentication, createVPNServerOptionsClientIPPool, createVPNServerOptionsSubnets)
				createVPNServerOptionsModel.SetCertificate(certificateInstanceIdentityModel)
				createVPNServerOptionsModel.SetClientAuthentication([]vpcv1.VPNServerAuthenticationPrototypeIntf{vpnServerAuthenticationPrototypeModel})
				createVPNServerOptionsModel.SetClientIPPool("172.16.0.0/16")
				createVPNServerOptionsModel.SetSubnets([]vpcv1.SubnetIdentityIntf{subnetIdentityModel})
				createVPNServerOptionsModel.SetClientDnsServerIps([]vpcv1.IP{*ipModel})
				createVPNServerOptionsModel.SetClientIdleTimeout(int64(600))
				createVPNServerOptionsModel.SetEnableSplitTunneling(false)
				createVPNServerOptionsModel.SetName("my-vpn-server")
				createVPNServerOptionsModel.SetPort(int64(443))
				createVPNServerOptionsModel.SetProtocol("udp")
				createVPNServerOptionsModel.SetResourceGroup(resourceGroupIdentityModel)
				createVPNServerOptionsModel.SetSecurityGroups([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel})
				createVPNServerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createVPNServerOptionsModel).ToNot(BeNil())
				Expect(createVPNServerOptionsModel.Certificate).To(Equal(certificateInstanceIdentityModel))
				Expect(createVPNServerOptionsModel.ClientAuthentication).To(Equal([]vpcv1.VPNServerAuthenticationPrototypeIntf{vpnServerAuthenticationPrototypeModel}))
				Expect(createVPNServerOptionsModel.ClientIPPool).To(Equal(core.StringPtr("172.16.0.0/16")))
				Expect(createVPNServerOptionsModel.Subnets).To(Equal([]vpcv1.SubnetIdentityIntf{subnetIdentityModel}))
				Expect(createVPNServerOptionsModel.ClientDnsServerIps).To(Equal([]vpcv1.IP{*ipModel}))
				Expect(createVPNServerOptionsModel.ClientIdleTimeout).To(Equal(core.Int64Ptr(int64(600))))
				Expect(createVPNServerOptionsModel.EnableSplitTunneling).To(Equal(core.BoolPtr(false)))
				Expect(createVPNServerOptionsModel.Name).To(Equal(core.StringPtr("my-vpn-server")))
				Expect(createVPNServerOptionsModel.Port).To(Equal(core.Int64Ptr(int64(443))))
				Expect(createVPNServerOptionsModel.Protocol).To(Equal(core.StringPtr("udp")))
				Expect(createVPNServerOptionsModel.ResourceGroup).To(Equal(resourceGroupIdentityModel))
				Expect(createVPNServerOptionsModel.SecurityGroups).To(Equal([]vpcv1.SecurityGroupIdentityIntf{securityGroupIdentityModel}))
				Expect(createVPNServerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewCreateVPNServerRouteOptions successfully`, func() {
				// Construct an instance of the CreateVPNServerRouteOptions model
				vpnServerID := "testString"
				createVPNServerRouteOptionsDestination := "172.16.0.0/16"
				createVPNServerRouteOptionsModel := vpcService.NewCreateVPNServerRouteOptions(vpnServerID, createVPNServerRouteOptionsDestination)
				createVPNServerRouteOptionsModel.SetVPNServerID("testString")
				createVPNServerRouteOptionsModel.SetDestination("172.16.0.0/16")
				createVPNServerRouteOptionsModel.SetAction("deliver")
				createVPNServerRouteOptionsModel.SetName("my-vpn-route-2")
				createVPNServerRouteOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(createVPNServerRouteOptionsModel).ToNot(BeNil())
				Expect(createVPNServerRouteOptionsModel.VPNServerID).To(Equal(core.StringPtr("testString")))
				Expect(createVPNServerRouteOptionsModel.Destination).To(Equal(core.StringPtr("172.16.0.0/16")))
				Expect(createVPNServerRouteOptionsModel.Action).To(Equal(core.StringPtr("deliver")))
				Expect(createVPNServerRouteOptionsModel.Name).To(Equal(core.StringPtr("my-vpn-route-2")))
				Expect(createVPNServerRouteOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteBackupPolicyOptions successfully`, func() {
				// Construct an instance of the DeleteBackupPolicyOptions model
				id := "testString"
				deleteBackupPolicyOptionsModel := vpcService.NewDeleteBackupPolicyOptions(id)
				deleteBackupPolicyOptionsModel.SetID("testString")
				deleteBackupPolicyOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteBackupPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteBackupPolicyOptionsModel).ToNot(BeNil())
				Expect(deleteBackupPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteBackupPolicyOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteBackupPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteBackupPolicyPlanOptions successfully`, func() {
				// Construct an instance of the DeleteBackupPolicyPlanOptions model
				backupPolicyID := "testString"
				id := "testString"
				deleteBackupPolicyPlanOptionsModel := vpcService.NewDeleteBackupPolicyPlanOptions(backupPolicyID, id)
				deleteBackupPolicyPlanOptionsModel.SetBackupPolicyID("testString")
				deleteBackupPolicyPlanOptionsModel.SetID("testString")
				deleteBackupPolicyPlanOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteBackupPolicyPlanOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteBackupPolicyPlanOptionsModel).ToNot(BeNil())
				Expect(deleteBackupPolicyPlanOptionsModel.BackupPolicyID).To(Equal(core.StringPtr("testString")))
				Expect(deleteBackupPolicyPlanOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteBackupPolicyPlanOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteBackupPolicyPlanOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteBareMetalServerNetworkAttachmentOptions successfully`, func() {
				// Construct an instance of the DeleteBareMetalServerNetworkAttachmentOptions model
				bareMetalServerID := "testString"
				id := "testString"
				deleteBareMetalServerNetworkAttachmentOptionsModel := vpcService.NewDeleteBareMetalServerNetworkAttachmentOptions(bareMetalServerID, id)
				deleteBareMetalServerNetworkAttachmentOptionsModel.SetBareMetalServerID("testString")
				deleteBareMetalServerNetworkAttachmentOptionsModel.SetID("testString")
				deleteBareMetalServerNetworkAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteBareMetalServerNetworkAttachmentOptionsModel).ToNot(BeNil())
				Expect(deleteBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(deleteBareMetalServerNetworkAttachmentOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteBareMetalServerNetworkAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteBareMetalServerNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the DeleteBareMetalServerNetworkInterfaceOptions model
				bareMetalServerID := "testString"
				id := "testString"
				deleteBareMetalServerNetworkInterfaceOptionsModel := vpcService.NewDeleteBareMetalServerNetworkInterfaceOptions(bareMetalServerID, id)
				deleteBareMetalServerNetworkInterfaceOptionsModel.SetBareMetalServerID("testString")
				deleteBareMetalServerNetworkInterfaceOptionsModel.SetID("testString")
				deleteBareMetalServerNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteBareMetalServerNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(deleteBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(deleteBareMetalServerNetworkInterfaceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteBareMetalServerNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteBareMetalServerOptions successfully`, func() {
				// Construct an instance of the DeleteBareMetalServerOptions model
				id := "testString"
				deleteBareMetalServerOptionsModel := vpcService.NewDeleteBareMetalServerOptions(id)
				deleteBareMetalServerOptionsModel.SetID("testString")
				deleteBareMetalServerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteBareMetalServerOptionsModel).ToNot(BeNil())
				Expect(deleteBareMetalServerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteBareMetalServerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteClusterNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the DeleteClusterNetworkInterfaceOptions model
				clusterNetworkID := "testString"
				id := "testString"
				deleteClusterNetworkInterfaceOptionsModel := vpcService.NewDeleteClusterNetworkInterfaceOptions(clusterNetworkID, id)
				deleteClusterNetworkInterfaceOptionsModel.SetClusterNetworkID("testString")
				deleteClusterNetworkInterfaceOptionsModel.SetID("testString")
				deleteClusterNetworkInterfaceOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteClusterNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(deleteClusterNetworkInterfaceOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(deleteClusterNetworkInterfaceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteClusterNetworkInterfaceOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteClusterNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteClusterNetworkOptions successfully`, func() {
				// Construct an instance of the DeleteClusterNetworkOptions model
				id := "testString"
				deleteClusterNetworkOptionsModel := vpcService.NewDeleteClusterNetworkOptions(id)
				deleteClusterNetworkOptionsModel.SetID("testString")
				deleteClusterNetworkOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteClusterNetworkOptionsModel).ToNot(BeNil())
				Expect(deleteClusterNetworkOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteClusterNetworkOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteClusterNetworkOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteClusterNetworkSubnetOptions successfully`, func() {
				// Construct an instance of the DeleteClusterNetworkSubnetOptions model
				clusterNetworkID := "testString"
				id := "testString"
				deleteClusterNetworkSubnetOptionsModel := vpcService.NewDeleteClusterNetworkSubnetOptions(clusterNetworkID, id)
				deleteClusterNetworkSubnetOptionsModel.SetClusterNetworkID("testString")
				deleteClusterNetworkSubnetOptionsModel.SetID("testString")
				deleteClusterNetworkSubnetOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkSubnetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteClusterNetworkSubnetOptionsModel).ToNot(BeNil())
				Expect(deleteClusterNetworkSubnetOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(deleteClusterNetworkSubnetOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteClusterNetworkSubnetOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteClusterNetworkSubnetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteClusterNetworkSubnetReservedIPOptions successfully`, func() {
				// Construct an instance of the DeleteClusterNetworkSubnetReservedIPOptions model
				clusterNetworkID := "testString"
				clusterNetworkSubnetID := "testString"
				id := "testString"
				deleteClusterNetworkSubnetReservedIPOptionsModel := vpcService.NewDeleteClusterNetworkSubnetReservedIPOptions(clusterNetworkID, clusterNetworkSubnetID, id)
				deleteClusterNetworkSubnetReservedIPOptionsModel.SetClusterNetworkID("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.SetClusterNetworkSubnetID("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.SetID("testString")
				deleteClusterNetworkSubnetReservedIPOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteClusterNetworkSubnetReservedIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteClusterNetworkSubnetReservedIPOptionsModel).ToNot(BeNil())
				Expect(deleteClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(deleteClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID).To(Equal(core.StringPtr("testString")))
				Expect(deleteClusterNetworkSubnetReservedIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteClusterNetworkSubnetReservedIPOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteClusterNetworkSubnetReservedIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteDedicatedHostGroupOptions successfully`, func() {
				// Construct an instance of the DeleteDedicatedHostGroupOptions model
				id := "testString"
				deleteDedicatedHostGroupOptionsModel := vpcService.NewDeleteDedicatedHostGroupOptions(id)
				deleteDedicatedHostGroupOptionsModel.SetID("testString")
				deleteDedicatedHostGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteDedicatedHostGroupOptionsModel).ToNot(BeNil())
				Expect(deleteDedicatedHostGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteDedicatedHostGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteDedicatedHostOptions successfully`, func() {
				// Construct an instance of the DeleteDedicatedHostOptions model
				id := "testString"
				deleteDedicatedHostOptionsModel := vpcService.NewDeleteDedicatedHostOptions(id)
				deleteDedicatedHostOptionsModel.SetID("testString")
				deleteDedicatedHostOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteDedicatedHostOptionsModel).ToNot(BeNil())
				Expect(deleteDedicatedHostOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteDedicatedHostOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteEndpointGatewayOptions successfully`, func() {
				// Construct an instance of the DeleteEndpointGatewayOptions model
				id := "testString"
				deleteEndpointGatewayOptionsModel := vpcService.NewDeleteEndpointGatewayOptions(id)
				deleteEndpointGatewayOptionsModel.SetID("testString")
				deleteEndpointGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteEndpointGatewayOptionsModel).ToNot(BeNil())
				Expect(deleteEndpointGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteEndpointGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteEndpointGatewayResourceBindingOptions successfully`, func() {
				// Construct an instance of the DeleteEndpointGatewayResourceBindingOptions model
				endpointGatewayID := "testString"
				id := "testString"
				deleteEndpointGatewayResourceBindingOptionsModel := vpcService.NewDeleteEndpointGatewayResourceBindingOptions(endpointGatewayID, id)
				deleteEndpointGatewayResourceBindingOptionsModel.SetEndpointGatewayID("testString")
				deleteEndpointGatewayResourceBindingOptionsModel.SetID("testString")
				deleteEndpointGatewayResourceBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteEndpointGatewayResourceBindingOptionsModel).ToNot(BeNil())
				Expect(deleteEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(deleteEndpointGatewayResourceBindingOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteEndpointGatewayResourceBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteFloatingIPOptions successfully`, func() {
				// Construct an instance of the DeleteFloatingIPOptions model
				id := "testString"
				deleteFloatingIPOptionsModel := vpcService.NewDeleteFloatingIPOptions(id)
				deleteFloatingIPOptionsModel.SetID("testString")
				deleteFloatingIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteFloatingIPOptionsModel).ToNot(BeNil())
				Expect(deleteFloatingIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteFloatingIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteFlowLogCollectorOptions successfully`, func() {
				// Construct an instance of the DeleteFlowLogCollectorOptions model
				id := "testString"
				deleteFlowLogCollectorOptionsModel := vpcService.NewDeleteFlowLogCollectorOptions(id)
				deleteFlowLogCollectorOptionsModel.SetID("testString")
				deleteFlowLogCollectorOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteFlowLogCollectorOptionsModel).ToNot(BeNil())
				Expect(deleteFlowLogCollectorOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteFlowLogCollectorOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteIkePolicyOptions successfully`, func() {
				// Construct an instance of the DeleteIkePolicyOptions model
				id := "testString"
				deleteIkePolicyOptionsModel := vpcService.NewDeleteIkePolicyOptions(id)
				deleteIkePolicyOptionsModel.SetID("testString")
				deleteIkePolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteIkePolicyOptionsModel).ToNot(BeNil())
				Expect(deleteIkePolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteIkePolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteImageExportJobOptions successfully`, func() {
				// Construct an instance of the DeleteImageExportJobOptions model
				imageID := "testString"
				id := "testString"
				deleteImageExportJobOptionsModel := vpcService.NewDeleteImageExportJobOptions(imageID, id)
				deleteImageExportJobOptionsModel.SetImageID("testString")
				deleteImageExportJobOptionsModel.SetID("testString")
				deleteImageExportJobOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteImageExportJobOptionsModel).ToNot(BeNil())
				Expect(deleteImageExportJobOptionsModel.ImageID).To(Equal(core.StringPtr("testString")))
				Expect(deleteImageExportJobOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteImageExportJobOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteImageOptions successfully`, func() {
				// Construct an instance of the DeleteImageOptions model
				id := "testString"
				deleteImageOptionsModel := vpcService.NewDeleteImageOptions(id)
				deleteImageOptionsModel.SetID("testString")
				deleteImageOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteImageOptionsModel).ToNot(BeNil())
				Expect(deleteImageOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteImageOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteInstanceClusterNetworkAttachmentOptions successfully`, func() {
				// Construct an instance of the DeleteInstanceClusterNetworkAttachmentOptions model
				instanceID := "testString"
				id := "testString"
				deleteInstanceClusterNetworkAttachmentOptionsModel := vpcService.NewDeleteInstanceClusterNetworkAttachmentOptions(instanceID, id)
				deleteInstanceClusterNetworkAttachmentOptionsModel.SetInstanceID("testString")
				deleteInstanceClusterNetworkAttachmentOptionsModel.SetID("testString")
				deleteInstanceClusterNetworkAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteInstanceClusterNetworkAttachmentOptionsModel).ToNot(BeNil())
				Expect(deleteInstanceClusterNetworkAttachmentOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceClusterNetworkAttachmentOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceClusterNetworkAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteInstanceGroupLoadBalancerOptions successfully`, func() {
				// Construct an instance of the DeleteInstanceGroupLoadBalancerOptions model
				instanceGroupID := "testString"
				deleteInstanceGroupLoadBalancerOptionsModel := vpcService.NewDeleteInstanceGroupLoadBalancerOptions(instanceGroupID)
				deleteInstanceGroupLoadBalancerOptionsModel.SetInstanceGroupID("testString")
				deleteInstanceGroupLoadBalancerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteInstanceGroupLoadBalancerOptionsModel).ToNot(BeNil())
				Expect(deleteInstanceGroupLoadBalancerOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceGroupLoadBalancerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteInstanceGroupManagerActionOptions successfully`, func() {
				// Construct an instance of the DeleteInstanceGroupManagerActionOptions model
				instanceGroupID := "testString"
				instanceGroupManagerID := "testString"
				id := "testString"
				deleteInstanceGroupManagerActionOptionsModel := vpcService.NewDeleteInstanceGroupManagerActionOptions(instanceGroupID, instanceGroupManagerID, id)
				deleteInstanceGroupManagerActionOptionsModel.SetInstanceGroupID("testString")
				deleteInstanceGroupManagerActionOptionsModel.SetInstanceGroupManagerID("testString")
				deleteInstanceGroupManagerActionOptionsModel.SetID("testString")
				deleteInstanceGroupManagerActionOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteInstanceGroupManagerActionOptionsModel).ToNot(BeNil())
				Expect(deleteInstanceGroupManagerActionOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceGroupManagerActionOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceGroupManagerActionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteInstanceGroupManagerOptions successfully`, func() {
				// Construct an instance of the DeleteInstanceGroupManagerOptions model
				instanceGroupID := "testString"
				id := "testString"
				deleteInstanceGroupManagerOptionsModel := vpcService.NewDeleteInstanceGroupManagerOptions(instanceGroupID, id)
				deleteInstanceGroupManagerOptionsModel.SetInstanceGroupID("testString")
				deleteInstanceGroupManagerOptionsModel.SetID("testString")
				deleteInstanceGroupManagerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteInstanceGroupManagerOptionsModel).ToNot(BeNil())
				Expect(deleteInstanceGroupManagerOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceGroupManagerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceGroupManagerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteInstanceGroupManagerPolicyOptions successfully`, func() {
				// Construct an instance of the DeleteInstanceGroupManagerPolicyOptions model
				instanceGroupID := "testString"
				instanceGroupManagerID := "testString"
				id := "testString"
				deleteInstanceGroupManagerPolicyOptionsModel := vpcService.NewDeleteInstanceGroupManagerPolicyOptions(instanceGroupID, instanceGroupManagerID, id)
				deleteInstanceGroupManagerPolicyOptionsModel.SetInstanceGroupID("testString")
				deleteInstanceGroupManagerPolicyOptionsModel.SetInstanceGroupManagerID("testString")
				deleteInstanceGroupManagerPolicyOptionsModel.SetID("testString")
				deleteInstanceGroupManagerPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteInstanceGroupManagerPolicyOptionsModel).ToNot(BeNil())
				Expect(deleteInstanceGroupManagerPolicyOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceGroupManagerPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceGroupManagerPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteInstanceGroupMembershipOptions successfully`, func() {
				// Construct an instance of the DeleteInstanceGroupMembershipOptions model
				instanceGroupID := "testString"
				id := "testString"
				deleteInstanceGroupMembershipOptionsModel := vpcService.NewDeleteInstanceGroupMembershipOptions(instanceGroupID, id)
				deleteInstanceGroupMembershipOptionsModel.SetInstanceGroupID("testString")
				deleteInstanceGroupMembershipOptionsModel.SetID("testString")
				deleteInstanceGroupMembershipOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteInstanceGroupMembershipOptionsModel).ToNot(BeNil())
				Expect(deleteInstanceGroupMembershipOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceGroupMembershipOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceGroupMembershipOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteInstanceGroupMembershipsOptions successfully`, func() {
				// Construct an instance of the DeleteInstanceGroupMembershipsOptions model
				instanceGroupID := "testString"
				deleteInstanceGroupMembershipsOptionsModel := vpcService.NewDeleteInstanceGroupMembershipsOptions(instanceGroupID)
				deleteInstanceGroupMembershipsOptionsModel.SetInstanceGroupID("testString")
				deleteInstanceGroupMembershipsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteInstanceGroupMembershipsOptionsModel).ToNot(BeNil())
				Expect(deleteInstanceGroupMembershipsOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceGroupMembershipsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteInstanceGroupOptions successfully`, func() {
				// Construct an instance of the DeleteInstanceGroupOptions model
				id := "testString"
				deleteInstanceGroupOptionsModel := vpcService.NewDeleteInstanceGroupOptions(id)
				deleteInstanceGroupOptionsModel.SetID("testString")
				deleteInstanceGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteInstanceGroupOptionsModel).ToNot(BeNil())
				Expect(deleteInstanceGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteInstanceNetworkAttachmentOptions successfully`, func() {
				// Construct an instance of the DeleteInstanceNetworkAttachmentOptions model
				instanceID := "testString"
				id := "testString"
				deleteInstanceNetworkAttachmentOptionsModel := vpcService.NewDeleteInstanceNetworkAttachmentOptions(instanceID, id)
				deleteInstanceNetworkAttachmentOptionsModel.SetInstanceID("testString")
				deleteInstanceNetworkAttachmentOptionsModel.SetID("testString")
				deleteInstanceNetworkAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteInstanceNetworkAttachmentOptionsModel).ToNot(BeNil())
				Expect(deleteInstanceNetworkAttachmentOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceNetworkAttachmentOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceNetworkAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteInstanceNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the DeleteInstanceNetworkInterfaceOptions model
				instanceID := "testString"
				id := "testString"
				deleteInstanceNetworkInterfaceOptionsModel := vpcService.NewDeleteInstanceNetworkInterfaceOptions(instanceID, id)
				deleteInstanceNetworkInterfaceOptionsModel.SetInstanceID("testString")
				deleteInstanceNetworkInterfaceOptionsModel.SetID("testString")
				deleteInstanceNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteInstanceNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(deleteInstanceNetworkInterfaceOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceNetworkInterfaceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteInstanceOptions successfully`, func() {
				// Construct an instance of the DeleteInstanceOptions model
				id := "testString"
				deleteInstanceOptionsModel := vpcService.NewDeleteInstanceOptions(id)
				deleteInstanceOptionsModel.SetID("testString")
				deleteInstanceOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteInstanceOptionsModel).ToNot(BeNil())
				Expect(deleteInstanceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteInstanceTemplateOptions successfully`, func() {
				// Construct an instance of the DeleteInstanceTemplateOptions model
				id := "testString"
				deleteInstanceTemplateOptionsModel := vpcService.NewDeleteInstanceTemplateOptions(id)
				deleteInstanceTemplateOptionsModel.SetID("testString")
				deleteInstanceTemplateOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteInstanceTemplateOptionsModel).ToNot(BeNil())
				Expect(deleteInstanceTemplateOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceTemplateOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteInstanceVolumeAttachmentOptions successfully`, func() {
				// Construct an instance of the DeleteInstanceVolumeAttachmentOptions model
				instanceID := "testString"
				id := "testString"
				deleteInstanceVolumeAttachmentOptionsModel := vpcService.NewDeleteInstanceVolumeAttachmentOptions(instanceID, id)
				deleteInstanceVolumeAttachmentOptionsModel.SetInstanceID("testString")
				deleteInstanceVolumeAttachmentOptionsModel.SetID("testString")
				deleteInstanceVolumeAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteInstanceVolumeAttachmentOptionsModel).ToNot(BeNil())
				Expect(deleteInstanceVolumeAttachmentOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceVolumeAttachmentOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteInstanceVolumeAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteIpsecPolicyOptions successfully`, func() {
				// Construct an instance of the DeleteIpsecPolicyOptions model
				id := "testString"
				deleteIpsecPolicyOptionsModel := vpcService.NewDeleteIpsecPolicyOptions(id)
				deleteIpsecPolicyOptionsModel.SetID("testString")
				deleteIpsecPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteIpsecPolicyOptionsModel).ToNot(BeNil())
				Expect(deleteIpsecPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteIpsecPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteKeyOptions successfully`, func() {
				// Construct an instance of the DeleteKeyOptions model
				id := "testString"
				deleteKeyOptionsModel := vpcService.NewDeleteKeyOptions(id)
				deleteKeyOptionsModel.SetID("testString")
				deleteKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteKeyOptionsModel).ToNot(BeNil())
				Expect(deleteKeyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteLoadBalancerListenerOptions successfully`, func() {
				// Construct an instance of the DeleteLoadBalancerListenerOptions model
				loadBalancerID := "testString"
				id := "testString"
				deleteLoadBalancerListenerOptionsModel := vpcService.NewDeleteLoadBalancerListenerOptions(loadBalancerID, id)
				deleteLoadBalancerListenerOptionsModel.SetLoadBalancerID("testString")
				deleteLoadBalancerListenerOptionsModel.SetID("testString")
				deleteLoadBalancerListenerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteLoadBalancerListenerOptionsModel).ToNot(BeNil())
				Expect(deleteLoadBalancerListenerOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerListenerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerListenerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteLoadBalancerListenerPolicyOptions successfully`, func() {
				// Construct an instance of the DeleteLoadBalancerListenerPolicyOptions model
				loadBalancerID := "testString"
				listenerID := "testString"
				id := "testString"
				deleteLoadBalancerListenerPolicyOptionsModel := vpcService.NewDeleteLoadBalancerListenerPolicyOptions(loadBalancerID, listenerID, id)
				deleteLoadBalancerListenerPolicyOptionsModel.SetLoadBalancerID("testString")
				deleteLoadBalancerListenerPolicyOptionsModel.SetListenerID("testString")
				deleteLoadBalancerListenerPolicyOptionsModel.SetID("testString")
				deleteLoadBalancerListenerPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteLoadBalancerListenerPolicyOptionsModel).ToNot(BeNil())
				Expect(deleteLoadBalancerListenerPolicyOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerListenerPolicyOptionsModel.ListenerID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerListenerPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerListenerPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteLoadBalancerListenerPolicyRuleOptions successfully`, func() {
				// Construct an instance of the DeleteLoadBalancerListenerPolicyRuleOptions model
				loadBalancerID := "testString"
				listenerID := "testString"
				policyID := "testString"
				id := "testString"
				deleteLoadBalancerListenerPolicyRuleOptionsModel := vpcService.NewDeleteLoadBalancerListenerPolicyRuleOptions(loadBalancerID, listenerID, policyID, id)
				deleteLoadBalancerListenerPolicyRuleOptionsModel.SetLoadBalancerID("testString")
				deleteLoadBalancerListenerPolicyRuleOptionsModel.SetListenerID("testString")
				deleteLoadBalancerListenerPolicyRuleOptionsModel.SetPolicyID("testString")
				deleteLoadBalancerListenerPolicyRuleOptionsModel.SetID("testString")
				deleteLoadBalancerListenerPolicyRuleOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteLoadBalancerListenerPolicyRuleOptionsModel).ToNot(BeNil())
				Expect(deleteLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerListenerPolicyRuleOptionsModel.ListenerID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerListenerPolicyRuleOptionsModel.PolicyID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerListenerPolicyRuleOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerListenerPolicyRuleOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteLoadBalancerOptions successfully`, func() {
				// Construct an instance of the DeleteLoadBalancerOptions model
				id := "testString"
				deleteLoadBalancerOptionsModel := vpcService.NewDeleteLoadBalancerOptions(id)
				deleteLoadBalancerOptionsModel.SetID("testString")
				deleteLoadBalancerOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteLoadBalancerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteLoadBalancerOptionsModel).ToNot(BeNil())
				Expect(deleteLoadBalancerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteLoadBalancerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteLoadBalancerPoolMemberOptions successfully`, func() {
				// Construct an instance of the DeleteLoadBalancerPoolMemberOptions model
				loadBalancerID := "testString"
				poolID := "testString"
				id := "testString"
				deleteLoadBalancerPoolMemberOptionsModel := vpcService.NewDeleteLoadBalancerPoolMemberOptions(loadBalancerID, poolID, id)
				deleteLoadBalancerPoolMemberOptionsModel.SetLoadBalancerID("testString")
				deleteLoadBalancerPoolMemberOptionsModel.SetPoolID("testString")
				deleteLoadBalancerPoolMemberOptionsModel.SetID("testString")
				deleteLoadBalancerPoolMemberOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteLoadBalancerPoolMemberOptionsModel).ToNot(BeNil())
				Expect(deleteLoadBalancerPoolMemberOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerPoolMemberOptionsModel.PoolID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerPoolMemberOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerPoolMemberOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteLoadBalancerPoolOptions successfully`, func() {
				// Construct an instance of the DeleteLoadBalancerPoolOptions model
				loadBalancerID := "testString"
				id := "testString"
				deleteLoadBalancerPoolOptionsModel := vpcService.NewDeleteLoadBalancerPoolOptions(loadBalancerID, id)
				deleteLoadBalancerPoolOptionsModel.SetLoadBalancerID("testString")
				deleteLoadBalancerPoolOptionsModel.SetID("testString")
				deleteLoadBalancerPoolOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteLoadBalancerPoolOptionsModel).ToNot(BeNil())
				Expect(deleteLoadBalancerPoolOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerPoolOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteLoadBalancerPoolOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteNetworkACLOptions successfully`, func() {
				// Construct an instance of the DeleteNetworkACLOptions model
				id := "testString"
				deleteNetworkACLOptionsModel := vpcService.NewDeleteNetworkACLOptions(id)
				deleteNetworkACLOptionsModel.SetID("testString")
				deleteNetworkACLOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteNetworkACLOptionsModel).ToNot(BeNil())
				Expect(deleteNetworkACLOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteNetworkACLOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteNetworkACLRuleOptions successfully`, func() {
				// Construct an instance of the DeleteNetworkACLRuleOptions model
				networkAclid := "testString"
				id := "testString"
				deleteNetworkACLRuleOptionsModel := vpcService.NewDeleteNetworkACLRuleOptions(networkAclid, id)
				deleteNetworkACLRuleOptionsModel.SetNetworkACLID("testString")
				deleteNetworkACLRuleOptionsModel.SetID("testString")
				deleteNetworkACLRuleOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteNetworkACLRuleOptionsModel).ToNot(BeNil())
				Expect(deleteNetworkACLRuleOptionsModel.NetworkACLID).To(Equal(core.StringPtr("testString")))
				Expect(deleteNetworkACLRuleOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteNetworkACLRuleOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeletePlacementGroupOptions successfully`, func() {
				// Construct an instance of the DeletePlacementGroupOptions model
				id := "testString"
				deletePlacementGroupOptionsModel := vpcService.NewDeletePlacementGroupOptions(id)
				deletePlacementGroupOptionsModel.SetID("testString")
				deletePlacementGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deletePlacementGroupOptionsModel).ToNot(BeNil())
				Expect(deletePlacementGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deletePlacementGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeletePrivatePathServiceGatewayAccountPolicyOptions successfully`, func() {
				// Construct an instance of the DeletePrivatePathServiceGatewayAccountPolicyOptions model
				privatePathServiceGatewayID := "testString"
				id := "testString"
				deletePrivatePathServiceGatewayAccountPolicyOptionsModel := vpcService.NewDeletePrivatePathServiceGatewayAccountPolicyOptions(privatePathServiceGatewayID, id)
				deletePrivatePathServiceGatewayAccountPolicyOptionsModel.SetPrivatePathServiceGatewayID("testString")
				deletePrivatePathServiceGatewayAccountPolicyOptionsModel.SetID("testString")
				deletePrivatePathServiceGatewayAccountPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deletePrivatePathServiceGatewayAccountPolicyOptionsModel).ToNot(BeNil())
				Expect(deletePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(deletePrivatePathServiceGatewayAccountPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deletePrivatePathServiceGatewayAccountPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeletePrivatePathServiceGatewayOptions successfully`, func() {
				// Construct an instance of the DeletePrivatePathServiceGatewayOptions model
				id := "testString"
				deletePrivatePathServiceGatewayOptionsModel := vpcService.NewDeletePrivatePathServiceGatewayOptions(id)
				deletePrivatePathServiceGatewayOptionsModel.SetID("testString")
				deletePrivatePathServiceGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deletePrivatePathServiceGatewayOptionsModel).ToNot(BeNil())
				Expect(deletePrivatePathServiceGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deletePrivatePathServiceGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeletePublicAddressRangeOptions successfully`, func() {
				// Construct an instance of the DeletePublicAddressRangeOptions model
				id := "testString"
				deletePublicAddressRangeOptionsModel := vpcService.NewDeletePublicAddressRangeOptions(id)
				deletePublicAddressRangeOptionsModel.SetID("testString")
				deletePublicAddressRangeOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deletePublicAddressRangeOptionsModel).ToNot(BeNil())
				Expect(deletePublicAddressRangeOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deletePublicAddressRangeOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeletePublicGatewayOptions successfully`, func() {
				// Construct an instance of the DeletePublicGatewayOptions model
				id := "testString"
				deletePublicGatewayOptionsModel := vpcService.NewDeletePublicGatewayOptions(id)
				deletePublicGatewayOptionsModel.SetID("testString")
				deletePublicGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deletePublicGatewayOptionsModel).ToNot(BeNil())
				Expect(deletePublicGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deletePublicGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteReservationOptions successfully`, func() {
				// Construct an instance of the DeleteReservationOptions model
				id := "testString"
				deleteReservationOptionsModel := vpcService.NewDeleteReservationOptions(id)
				deleteReservationOptionsModel.SetID("testString")
				deleteReservationOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteReservationOptionsModel).ToNot(BeNil())
				Expect(deleteReservationOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteReservationOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteSecurityGroupOptions successfully`, func() {
				// Construct an instance of the DeleteSecurityGroupOptions model
				id := "testString"
				deleteSecurityGroupOptionsModel := vpcService.NewDeleteSecurityGroupOptions(id)
				deleteSecurityGroupOptionsModel.SetID("testString")
				deleteSecurityGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteSecurityGroupOptionsModel).ToNot(BeNil())
				Expect(deleteSecurityGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteSecurityGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteSecurityGroupRuleOptions successfully`, func() {
				// Construct an instance of the DeleteSecurityGroupRuleOptions model
				securityGroupID := "testString"
				id := "testString"
				deleteSecurityGroupRuleOptionsModel := vpcService.NewDeleteSecurityGroupRuleOptions(securityGroupID, id)
				deleteSecurityGroupRuleOptionsModel.SetSecurityGroupID("testString")
				deleteSecurityGroupRuleOptionsModel.SetID("testString")
				deleteSecurityGroupRuleOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteSecurityGroupRuleOptionsModel).ToNot(BeNil())
				Expect(deleteSecurityGroupRuleOptionsModel.SecurityGroupID).To(Equal(core.StringPtr("testString")))
				Expect(deleteSecurityGroupRuleOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteSecurityGroupRuleOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteSecurityGroupTargetBindingOptions successfully`, func() {
				// Construct an instance of the DeleteSecurityGroupTargetBindingOptions model
				securityGroupID := "testString"
				id := "testString"
				deleteSecurityGroupTargetBindingOptionsModel := vpcService.NewDeleteSecurityGroupTargetBindingOptions(securityGroupID, id)
				deleteSecurityGroupTargetBindingOptionsModel.SetSecurityGroupID("testString")
				deleteSecurityGroupTargetBindingOptionsModel.SetID("testString")
				deleteSecurityGroupTargetBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteSecurityGroupTargetBindingOptionsModel).ToNot(BeNil())
				Expect(deleteSecurityGroupTargetBindingOptionsModel.SecurityGroupID).To(Equal(core.StringPtr("testString")))
				Expect(deleteSecurityGroupTargetBindingOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteSecurityGroupTargetBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteShareAccessorBindingOptions successfully`, func() {
				// Construct an instance of the DeleteShareAccessorBindingOptions model
				shareID := "testString"
				id := "testString"
				deleteShareAccessorBindingOptionsModel := vpcService.NewDeleteShareAccessorBindingOptions(shareID, id)
				deleteShareAccessorBindingOptionsModel.SetShareID("testString")
				deleteShareAccessorBindingOptionsModel.SetID("testString")
				deleteShareAccessorBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteShareAccessorBindingOptionsModel).ToNot(BeNil())
				Expect(deleteShareAccessorBindingOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(deleteShareAccessorBindingOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteShareAccessorBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteShareMountTargetOptions successfully`, func() {
				// Construct an instance of the DeleteShareMountTargetOptions model
				shareID := "testString"
				id := "testString"
				deleteShareMountTargetOptionsModel := vpcService.NewDeleteShareMountTargetOptions(shareID, id)
				deleteShareMountTargetOptionsModel.SetShareID("testString")
				deleteShareMountTargetOptionsModel.SetID("testString")
				deleteShareMountTargetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteShareMountTargetOptionsModel).ToNot(BeNil())
				Expect(deleteShareMountTargetOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(deleteShareMountTargetOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteShareMountTargetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteShareOptions successfully`, func() {
				// Construct an instance of the DeleteShareOptions model
				id := "testString"
				deleteShareOptionsModel := vpcService.NewDeleteShareOptions(id)
				deleteShareOptionsModel.SetID("testString")
				deleteShareOptionsModel.SetIfMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				deleteShareOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteShareOptionsModel).ToNot(BeNil())
				Expect(deleteShareOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteShareOptionsModel.IfMatch).To(Equal(core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")))
				Expect(deleteShareOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteShareSnapshotOptions successfully`, func() {
				// Construct an instance of the DeleteShareSnapshotOptions model
				shareID := "testString"
				id := "testString"
				deleteShareSnapshotOptionsModel := vpcService.NewDeleteShareSnapshotOptions(shareID, id)
				deleteShareSnapshotOptionsModel.SetShareID("testString")
				deleteShareSnapshotOptionsModel.SetID("testString")
				deleteShareSnapshotOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteShareSnapshotOptionsModel).ToNot(BeNil())
				Expect(deleteShareSnapshotOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(deleteShareSnapshotOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteShareSnapshotOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteShareSourceOptions successfully`, func() {
				// Construct an instance of the DeleteShareSourceOptions model
				shareID := "testString"
				deleteShareSourceOptionsModel := vpcService.NewDeleteShareSourceOptions(shareID)
				deleteShareSourceOptionsModel.SetShareID("testString")
				deleteShareSourceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteShareSourceOptionsModel).ToNot(BeNil())
				Expect(deleteShareSourceOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(deleteShareSourceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteSnapshotCloneOptions successfully`, func() {
				// Construct an instance of the DeleteSnapshotCloneOptions model
				id := "testString"
				zoneName := "us-south-1"
				deleteSnapshotCloneOptionsModel := vpcService.NewDeleteSnapshotCloneOptions(id, zoneName)
				deleteSnapshotCloneOptionsModel.SetID("testString")
				deleteSnapshotCloneOptionsModel.SetZoneName("us-south-1")
				deleteSnapshotCloneOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteSnapshotCloneOptionsModel).ToNot(BeNil())
				Expect(deleteSnapshotCloneOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteSnapshotCloneOptionsModel.ZoneName).To(Equal(core.StringPtr("us-south-1")))
				Expect(deleteSnapshotCloneOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteSnapshotConsistencyGroupOptions successfully`, func() {
				// Construct an instance of the DeleteSnapshotConsistencyGroupOptions model
				id := "testString"
				deleteSnapshotConsistencyGroupOptionsModel := vpcService.NewDeleteSnapshotConsistencyGroupOptions(id)
				deleteSnapshotConsistencyGroupOptionsModel.SetID("testString")
				deleteSnapshotConsistencyGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteSnapshotConsistencyGroupOptionsModel).ToNot(BeNil())
				Expect(deleteSnapshotConsistencyGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteSnapshotConsistencyGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteSnapshotOptions successfully`, func() {
				// Construct an instance of the DeleteSnapshotOptions model
				id := "testString"
				deleteSnapshotOptionsModel := vpcService.NewDeleteSnapshotOptions(id)
				deleteSnapshotOptionsModel.SetID("testString")
				deleteSnapshotOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteSnapshotOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteSnapshotOptionsModel).ToNot(BeNil())
				Expect(deleteSnapshotOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteSnapshotOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteSnapshotOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteSnapshotsOptions successfully`, func() {
				// Construct an instance of the DeleteSnapshotsOptions model
				sourceVolumeID := "testString"
				deleteSnapshotsOptionsModel := vpcService.NewDeleteSnapshotsOptions(sourceVolumeID)
				deleteSnapshotsOptionsModel.SetSourceVolumeID("testString")
				deleteSnapshotsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteSnapshotsOptionsModel).ToNot(BeNil())
				Expect(deleteSnapshotsOptionsModel.SourceVolumeID).To(Equal(core.StringPtr("testString")))
				Expect(deleteSnapshotsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteSubnetOptions successfully`, func() {
				// Construct an instance of the DeleteSubnetOptions model
				id := "testString"
				deleteSubnetOptionsModel := vpcService.NewDeleteSubnetOptions(id)
				deleteSubnetOptionsModel.SetID("testString")
				deleteSubnetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteSubnetOptionsModel).ToNot(BeNil())
				Expect(deleteSubnetOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteSubnetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteSubnetReservedIPOptions successfully`, func() {
				// Construct an instance of the DeleteSubnetReservedIPOptions model
				subnetID := "testString"
				id := "testString"
				deleteSubnetReservedIPOptionsModel := vpcService.NewDeleteSubnetReservedIPOptions(subnetID, id)
				deleteSubnetReservedIPOptionsModel.SetSubnetID("testString")
				deleteSubnetReservedIPOptionsModel.SetID("testString")
				deleteSubnetReservedIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteSubnetReservedIPOptionsModel).ToNot(BeNil())
				Expect(deleteSubnetReservedIPOptionsModel.SubnetID).To(Equal(core.StringPtr("testString")))
				Expect(deleteSubnetReservedIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteSubnetReservedIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteVirtualNetworkInterfacesOptions successfully`, func() {
				// Construct an instance of the DeleteVirtualNetworkInterfacesOptions model
				id := "testString"
				deleteVirtualNetworkInterfacesOptionsModel := vpcService.NewDeleteVirtualNetworkInterfacesOptions(id)
				deleteVirtualNetworkInterfacesOptionsModel.SetID("testString")
				deleteVirtualNetworkInterfacesOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVirtualNetworkInterfacesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteVirtualNetworkInterfacesOptionsModel).ToNot(BeNil())
				Expect(deleteVirtualNetworkInterfacesOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVirtualNetworkInterfacesOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteVirtualNetworkInterfacesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteVolumeOptions successfully`, func() {
				// Construct an instance of the DeleteVolumeOptions model
				id := "testString"
				deleteVolumeOptionsModel := vpcService.NewDeleteVolumeOptions(id)
				deleteVolumeOptionsModel.SetID("testString")
				deleteVolumeOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVolumeOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteVolumeOptionsModel).ToNot(BeNil())
				Expect(deleteVolumeOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVolumeOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteVolumeOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteVPCAddressPrefixOptions successfully`, func() {
				// Construct an instance of the DeleteVPCAddressPrefixOptions model
				vpcID := "testString"
				id := "testString"
				deleteVPCAddressPrefixOptionsModel := vpcService.NewDeleteVPCAddressPrefixOptions(vpcID, id)
				deleteVPCAddressPrefixOptionsModel.SetVPCID("testString")
				deleteVPCAddressPrefixOptionsModel.SetID("testString")
				deleteVPCAddressPrefixOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteVPCAddressPrefixOptionsModel).ToNot(BeNil())
				Expect(deleteVPCAddressPrefixOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPCAddressPrefixOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPCAddressPrefixOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteVPCDnsResolutionBindingOptions successfully`, func() {
				// Construct an instance of the DeleteVPCDnsResolutionBindingOptions model
				vpcID := "testString"
				id := "testString"
				deleteVPCDnsResolutionBindingOptionsModel := vpcService.NewDeleteVPCDnsResolutionBindingOptions(vpcID, id)
				deleteVPCDnsResolutionBindingOptionsModel.SetVPCID("testString")
				deleteVPCDnsResolutionBindingOptionsModel.SetID("testString")
				deleteVPCDnsResolutionBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteVPCDnsResolutionBindingOptionsModel).ToNot(BeNil())
				Expect(deleteVPCDnsResolutionBindingOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPCDnsResolutionBindingOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPCDnsResolutionBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteVPCOptions successfully`, func() {
				// Construct an instance of the DeleteVPCOptions model
				id := "testString"
				deleteVPCOptionsModel := vpcService.NewDeleteVPCOptions(id)
				deleteVPCOptionsModel.SetID("testString")
				deleteVPCOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVPCOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteVPCOptionsModel).ToNot(BeNil())
				Expect(deleteVPCOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPCOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteVPCOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteVPCRouteOptions successfully`, func() {
				// Construct an instance of the DeleteVPCRouteOptions model
				vpcID := "testString"
				id := "testString"
				deleteVPCRouteOptionsModel := vpcService.NewDeleteVPCRouteOptions(vpcID, id)
				deleteVPCRouteOptionsModel.SetVPCID("testString")
				deleteVPCRouteOptionsModel.SetID("testString")
				deleteVPCRouteOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteVPCRouteOptionsModel).ToNot(BeNil())
				Expect(deleteVPCRouteOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPCRouteOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPCRouteOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteVPCRoutingTableOptions successfully`, func() {
				// Construct an instance of the DeleteVPCRoutingTableOptions model
				vpcID := "testString"
				id := "testString"
				deleteVPCRoutingTableOptionsModel := vpcService.NewDeleteVPCRoutingTableOptions(vpcID, id)
				deleteVPCRoutingTableOptionsModel.SetVPCID("testString")
				deleteVPCRoutingTableOptionsModel.SetID("testString")
				deleteVPCRoutingTableOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVPCRoutingTableOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteVPCRoutingTableOptionsModel).ToNot(BeNil())
				Expect(deleteVPCRoutingTableOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPCRoutingTableOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPCRoutingTableOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteVPCRoutingTableOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteVPCRoutingTableRouteOptions successfully`, func() {
				// Construct an instance of the DeleteVPCRoutingTableRouteOptions model
				vpcID := "testString"
				routingTableID := "testString"
				id := "testString"
				deleteVPCRoutingTableRouteOptionsModel := vpcService.NewDeleteVPCRoutingTableRouteOptions(vpcID, routingTableID, id)
				deleteVPCRoutingTableRouteOptionsModel.SetVPCID("testString")
				deleteVPCRoutingTableRouteOptionsModel.SetRoutingTableID("testString")
				deleteVPCRoutingTableRouteOptionsModel.SetID("testString")
				deleteVPCRoutingTableRouteOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteVPCRoutingTableRouteOptionsModel).ToNot(BeNil())
				Expect(deleteVPCRoutingTableRouteOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPCRoutingTableRouteOptionsModel.RoutingTableID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPCRoutingTableRouteOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPCRoutingTableRouteOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteVPNGatewayConnectionOptions successfully`, func() {
				// Construct an instance of the DeleteVPNGatewayConnectionOptions model
				vpnGatewayID := "testString"
				id := "testString"
				deleteVPNGatewayConnectionOptionsModel := vpcService.NewDeleteVPNGatewayConnectionOptions(vpnGatewayID, id)
				deleteVPNGatewayConnectionOptionsModel.SetVPNGatewayID("testString")
				deleteVPNGatewayConnectionOptionsModel.SetID("testString")
				deleteVPNGatewayConnectionOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVPNGatewayConnectionOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteVPNGatewayConnectionOptionsModel).ToNot(BeNil())
				Expect(deleteVPNGatewayConnectionOptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPNGatewayConnectionOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPNGatewayConnectionOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteVPNGatewayConnectionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteVPNGatewayOptions successfully`, func() {
				// Construct an instance of the DeleteVPNGatewayOptions model
				id := "testString"
				deleteVPNGatewayOptionsModel := vpcService.NewDeleteVPNGatewayOptions(id)
				deleteVPNGatewayOptionsModel.SetID("testString")
				deleteVPNGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteVPNGatewayOptionsModel).ToNot(BeNil())
				Expect(deleteVPNGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPNGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteVPNServerClientOptions successfully`, func() {
				// Construct an instance of the DeleteVPNServerClientOptions model
				vpnServerID := "testString"
				id := "testString"
				deleteVPNServerClientOptionsModel := vpcService.NewDeleteVPNServerClientOptions(vpnServerID, id)
				deleteVPNServerClientOptionsModel.SetVPNServerID("testString")
				deleteVPNServerClientOptionsModel.SetID("testString")
				deleteVPNServerClientOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteVPNServerClientOptionsModel).ToNot(BeNil())
				Expect(deleteVPNServerClientOptionsModel.VPNServerID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPNServerClientOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPNServerClientOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteVPNServerOptions successfully`, func() {
				// Construct an instance of the DeleteVPNServerOptions model
				id := "testString"
				deleteVPNServerOptionsModel := vpcService.NewDeleteVPNServerOptions(id)
				deleteVPNServerOptionsModel.SetID("testString")
				deleteVPNServerOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				deleteVPNServerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteVPNServerOptionsModel).ToNot(BeNil())
				Expect(deleteVPNServerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPNServerOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(deleteVPNServerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeleteVPNServerRouteOptions successfully`, func() {
				// Construct an instance of the DeleteVPNServerRouteOptions model
				vpnServerID := "testString"
				id := "testString"
				deleteVPNServerRouteOptionsModel := vpcService.NewDeleteVPNServerRouteOptions(vpnServerID, id)
				deleteVPNServerRouteOptionsModel.SetVPNServerID("testString")
				deleteVPNServerRouteOptionsModel.SetID("testString")
				deleteVPNServerRouteOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deleteVPNServerRouteOptionsModel).ToNot(BeNil())
				Expect(deleteVPNServerRouteOptionsModel.VPNServerID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPNServerRouteOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deleteVPNServerRouteOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDenyPrivatePathServiceGatewayEndpointGatewayBindingOptions successfully`, func() {
				// Construct an instance of the DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions model
				privatePathServiceGatewayID := "testString"
				id := "testString"
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel := vpcService.NewDenyPrivatePathServiceGatewayEndpointGatewayBindingOptions(privatePathServiceGatewayID, id)
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetPrivatePathServiceGatewayID("testString")
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetID("testString")
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetSetAccountPolicy(true)
				denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel).ToNot(BeNil())
				Expect(denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.PrivatePathServiceGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetAccountPolicy).To(Equal(core.BoolPtr(true)))
				Expect(denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDeprecateImageOptions successfully`, func() {
				// Construct an instance of the DeprecateImageOptions model
				id := "testString"
				deprecateImageOptionsModel := vpcService.NewDeprecateImageOptions(id)
				deprecateImageOptionsModel.SetID("testString")
				deprecateImageOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(deprecateImageOptionsModel).ToNot(BeNil())
				Expect(deprecateImageOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(deprecateImageOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewDisconnectVPNClientOptions successfully`, func() {
				// Construct an instance of the DisconnectVPNClientOptions model
				vpnServerID := "testString"
				id := "testString"
				disconnectVPNClientOptionsModel := vpcService.NewDisconnectVPNClientOptions(vpnServerID, id)
				disconnectVPNClientOptionsModel.SetVPNServerID("testString")
				disconnectVPNClientOptionsModel.SetID("testString")
				disconnectVPNClientOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(disconnectVPNClientOptionsModel).ToNot(BeNil())
				Expect(disconnectVPNClientOptionsModel.VPNServerID).To(Equal(core.StringPtr("testString")))
				Expect(disconnectVPNClientOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(disconnectVPNClientOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewFailoverShareOptions successfully`, func() {
				// Construct an instance of the FailoverShareOptions model
				shareID := "testString"
				failoverShareOptionsModel := vpcService.NewFailoverShareOptions(shareID)
				failoverShareOptionsModel.SetShareID("testString")
				failoverShareOptionsModel.SetFallbackPolicy("fail")
				failoverShareOptionsModel.SetTimeout(int64(600))
				failoverShareOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(failoverShareOptionsModel).ToNot(BeNil())
				Expect(failoverShareOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(failoverShareOptionsModel.FallbackPolicy).To(Equal(core.StringPtr("fail")))
				Expect(failoverShareOptionsModel.Timeout).To(Equal(core.Int64Ptr(int64(600))))
				Expect(failoverShareOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetBackupPolicyJobOptions successfully`, func() {
				// Construct an instance of the GetBackupPolicyJobOptions model
				backupPolicyID := "testString"
				id := "testString"
				getBackupPolicyJobOptionsModel := vpcService.NewGetBackupPolicyJobOptions(backupPolicyID, id)
				getBackupPolicyJobOptionsModel.SetBackupPolicyID("testString")
				getBackupPolicyJobOptionsModel.SetID("testString")
				getBackupPolicyJobOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getBackupPolicyJobOptionsModel).ToNot(BeNil())
				Expect(getBackupPolicyJobOptionsModel.BackupPolicyID).To(Equal(core.StringPtr("testString")))
				Expect(getBackupPolicyJobOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getBackupPolicyJobOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetBackupPolicyOptions successfully`, func() {
				// Construct an instance of the GetBackupPolicyOptions model
				id := "testString"
				getBackupPolicyOptionsModel := vpcService.NewGetBackupPolicyOptions(id)
				getBackupPolicyOptionsModel.SetID("testString")
				getBackupPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getBackupPolicyOptionsModel).ToNot(BeNil())
				Expect(getBackupPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getBackupPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetBackupPolicyPlanOptions successfully`, func() {
				// Construct an instance of the GetBackupPolicyPlanOptions model
				backupPolicyID := "testString"
				id := "testString"
				getBackupPolicyPlanOptionsModel := vpcService.NewGetBackupPolicyPlanOptions(backupPolicyID, id)
				getBackupPolicyPlanOptionsModel.SetBackupPolicyID("testString")
				getBackupPolicyPlanOptionsModel.SetID("testString")
				getBackupPolicyPlanOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getBackupPolicyPlanOptionsModel).ToNot(BeNil())
				Expect(getBackupPolicyPlanOptionsModel.BackupPolicyID).To(Equal(core.StringPtr("testString")))
				Expect(getBackupPolicyPlanOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getBackupPolicyPlanOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetBareMetalServerDiskOptions successfully`, func() {
				// Construct an instance of the GetBareMetalServerDiskOptions model
				bareMetalServerID := "testString"
				id := "testString"
				getBareMetalServerDiskOptionsModel := vpcService.NewGetBareMetalServerDiskOptions(bareMetalServerID, id)
				getBareMetalServerDiskOptionsModel.SetBareMetalServerID("testString")
				getBareMetalServerDiskOptionsModel.SetID("testString")
				getBareMetalServerDiskOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getBareMetalServerDiskOptionsModel).ToNot(BeNil())
				Expect(getBareMetalServerDiskOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(getBareMetalServerDiskOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getBareMetalServerDiskOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetBareMetalServerInitializationOptions successfully`, func() {
				// Construct an instance of the GetBareMetalServerInitializationOptions model
				id := "testString"
				getBareMetalServerInitializationOptionsModel := vpcService.NewGetBareMetalServerInitializationOptions(id)
				getBareMetalServerInitializationOptionsModel.SetID("testString")
				getBareMetalServerInitializationOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getBareMetalServerInitializationOptionsModel).ToNot(BeNil())
				Expect(getBareMetalServerInitializationOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getBareMetalServerInitializationOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetBareMetalServerNetworkAttachmentOptions successfully`, func() {
				// Construct an instance of the GetBareMetalServerNetworkAttachmentOptions model
				bareMetalServerID := "testString"
				id := "testString"
				getBareMetalServerNetworkAttachmentOptionsModel := vpcService.NewGetBareMetalServerNetworkAttachmentOptions(bareMetalServerID, id)
				getBareMetalServerNetworkAttachmentOptionsModel.SetBareMetalServerID("testString")
				getBareMetalServerNetworkAttachmentOptionsModel.SetID("testString")
				getBareMetalServerNetworkAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getBareMetalServerNetworkAttachmentOptionsModel).ToNot(BeNil())
				Expect(getBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(getBareMetalServerNetworkAttachmentOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getBareMetalServerNetworkAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetBareMetalServerNetworkInterfaceFloatingIPOptions successfully`, func() {
				// Construct an instance of the GetBareMetalServerNetworkInterfaceFloatingIPOptions model
				bareMetalServerID := "testString"
				networkInterfaceID := "testString"
				id := "testString"
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel := vpcService.NewGetBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID, networkInterfaceID, id)
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.SetBareMetalServerID("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.SetNetworkInterfaceID("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.SetID("testString")
				getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getBareMetalServerNetworkInterfaceFloatingIPOptionsModel).ToNot(BeNil())
				Expect(getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetBareMetalServerNetworkInterfaceIPOptions successfully`, func() {
				// Construct an instance of the GetBareMetalServerNetworkInterfaceIPOptions model
				bareMetalServerID := "testString"
				networkInterfaceID := "testString"
				id := "testString"
				getBareMetalServerNetworkInterfaceIPOptionsModel := vpcService.NewGetBareMetalServerNetworkInterfaceIPOptions(bareMetalServerID, networkInterfaceID, id)
				getBareMetalServerNetworkInterfaceIPOptionsModel.SetBareMetalServerID("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.SetNetworkInterfaceID("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.SetID("testString")
				getBareMetalServerNetworkInterfaceIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getBareMetalServerNetworkInterfaceIPOptionsModel).ToNot(BeNil())
				Expect(getBareMetalServerNetworkInterfaceIPOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(getBareMetalServerNetworkInterfaceIPOptionsModel.NetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(getBareMetalServerNetworkInterfaceIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getBareMetalServerNetworkInterfaceIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetBareMetalServerNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the GetBareMetalServerNetworkInterfaceOptions model
				bareMetalServerID := "testString"
				id := "testString"
				getBareMetalServerNetworkInterfaceOptionsModel := vpcService.NewGetBareMetalServerNetworkInterfaceOptions(bareMetalServerID, id)
				getBareMetalServerNetworkInterfaceOptionsModel.SetBareMetalServerID("testString")
				getBareMetalServerNetworkInterfaceOptionsModel.SetID("testString")
				getBareMetalServerNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getBareMetalServerNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(getBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(getBareMetalServerNetworkInterfaceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getBareMetalServerNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetBareMetalServerOptions successfully`, func() {
				// Construct an instance of the GetBareMetalServerOptions model
				id := "testString"
				getBareMetalServerOptionsModel := vpcService.NewGetBareMetalServerOptions(id)
				getBareMetalServerOptionsModel.SetID("testString")
				getBareMetalServerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getBareMetalServerOptionsModel).ToNot(BeNil())
				Expect(getBareMetalServerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getBareMetalServerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetBareMetalServerProfileOptions successfully`, func() {
				// Construct an instance of the GetBareMetalServerProfileOptions model
				name := "bx2-metal-192x768"
				getBareMetalServerProfileOptionsModel := vpcService.NewGetBareMetalServerProfileOptions(name)
				getBareMetalServerProfileOptionsModel.SetName("bx2-metal-192x768")
				getBareMetalServerProfileOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getBareMetalServerProfileOptionsModel).ToNot(BeNil())
				Expect(getBareMetalServerProfileOptionsModel.Name).To(Equal(core.StringPtr("bx2-metal-192x768")))
				Expect(getBareMetalServerProfileOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetClusterNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the GetClusterNetworkInterfaceOptions model
				clusterNetworkID := "testString"
				id := "testString"
				getClusterNetworkInterfaceOptionsModel := vpcService.NewGetClusterNetworkInterfaceOptions(clusterNetworkID, id)
				getClusterNetworkInterfaceOptionsModel.SetClusterNetworkID("testString")
				getClusterNetworkInterfaceOptionsModel.SetID("testString")
				getClusterNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getClusterNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(getClusterNetworkInterfaceOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(getClusterNetworkInterfaceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getClusterNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetClusterNetworkOptions successfully`, func() {
				// Construct an instance of the GetClusterNetworkOptions model
				id := "testString"
				getClusterNetworkOptionsModel := vpcService.NewGetClusterNetworkOptions(id)
				getClusterNetworkOptionsModel.SetID("testString")
				getClusterNetworkOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getClusterNetworkOptionsModel).ToNot(BeNil())
				Expect(getClusterNetworkOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getClusterNetworkOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetClusterNetworkProfileOptions successfully`, func() {
				// Construct an instance of the GetClusterNetworkProfileOptions model
				name := "h100"
				getClusterNetworkProfileOptionsModel := vpcService.NewGetClusterNetworkProfileOptions(name)
				getClusterNetworkProfileOptionsModel.SetName("h100")
				getClusterNetworkProfileOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getClusterNetworkProfileOptionsModel).ToNot(BeNil())
				Expect(getClusterNetworkProfileOptionsModel.Name).To(Equal(core.StringPtr("h100")))
				Expect(getClusterNetworkProfileOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetClusterNetworkSubnetOptions successfully`, func() {
				// Construct an instance of the GetClusterNetworkSubnetOptions model
				clusterNetworkID := "testString"
				id := "testString"
				getClusterNetworkSubnetOptionsModel := vpcService.NewGetClusterNetworkSubnetOptions(clusterNetworkID, id)
				getClusterNetworkSubnetOptionsModel.SetClusterNetworkID("testString")
				getClusterNetworkSubnetOptionsModel.SetID("testString")
				getClusterNetworkSubnetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getClusterNetworkSubnetOptionsModel).ToNot(BeNil())
				Expect(getClusterNetworkSubnetOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(getClusterNetworkSubnetOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getClusterNetworkSubnetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetClusterNetworkSubnetReservedIPOptions successfully`, func() {
				// Construct an instance of the GetClusterNetworkSubnetReservedIPOptions model
				clusterNetworkID := "testString"
				clusterNetworkSubnetID := "testString"
				id := "testString"
				getClusterNetworkSubnetReservedIPOptionsModel := vpcService.NewGetClusterNetworkSubnetReservedIPOptions(clusterNetworkID, clusterNetworkSubnetID, id)
				getClusterNetworkSubnetReservedIPOptionsModel.SetClusterNetworkID("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.SetClusterNetworkSubnetID("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.SetID("testString")
				getClusterNetworkSubnetReservedIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getClusterNetworkSubnetReservedIPOptionsModel).ToNot(BeNil())
				Expect(getClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(getClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID).To(Equal(core.StringPtr("testString")))
				Expect(getClusterNetworkSubnetReservedIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getClusterNetworkSubnetReservedIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetDedicatedHostDiskOptions successfully`, func() {
				// Construct an instance of the GetDedicatedHostDiskOptions model
				dedicatedHostID := "testString"
				id := "testString"
				getDedicatedHostDiskOptionsModel := vpcService.NewGetDedicatedHostDiskOptions(dedicatedHostID, id)
				getDedicatedHostDiskOptionsModel.SetDedicatedHostID("testString")
				getDedicatedHostDiskOptionsModel.SetID("testString")
				getDedicatedHostDiskOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getDedicatedHostDiskOptionsModel).ToNot(BeNil())
				Expect(getDedicatedHostDiskOptionsModel.DedicatedHostID).To(Equal(core.StringPtr("testString")))
				Expect(getDedicatedHostDiskOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getDedicatedHostDiskOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetDedicatedHostGroupOptions successfully`, func() {
				// Construct an instance of the GetDedicatedHostGroupOptions model
				id := "testString"
				getDedicatedHostGroupOptionsModel := vpcService.NewGetDedicatedHostGroupOptions(id)
				getDedicatedHostGroupOptionsModel.SetID("testString")
				getDedicatedHostGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getDedicatedHostGroupOptionsModel).ToNot(BeNil())
				Expect(getDedicatedHostGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getDedicatedHostGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetDedicatedHostOptions successfully`, func() {
				// Construct an instance of the GetDedicatedHostOptions model
				id := "testString"
				getDedicatedHostOptionsModel := vpcService.NewGetDedicatedHostOptions(id)
				getDedicatedHostOptionsModel.SetID("testString")
				getDedicatedHostOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getDedicatedHostOptionsModel).ToNot(BeNil())
				Expect(getDedicatedHostOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getDedicatedHostOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetDedicatedHostProfileOptions successfully`, func() {
				// Construct an instance of the GetDedicatedHostProfileOptions model
				name := "mx2-host-152x1216"
				getDedicatedHostProfileOptionsModel := vpcService.NewGetDedicatedHostProfileOptions(name)
				getDedicatedHostProfileOptionsModel.SetName("mx2-host-152x1216")
				getDedicatedHostProfileOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getDedicatedHostProfileOptionsModel).ToNot(BeNil())
				Expect(getDedicatedHostProfileOptionsModel.Name).To(Equal(core.StringPtr("mx2-host-152x1216")))
				Expect(getDedicatedHostProfileOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetEndpointGatewayIPOptions successfully`, func() {
				// Construct an instance of the GetEndpointGatewayIPOptions model
				endpointGatewayID := "testString"
				id := "testString"
				getEndpointGatewayIPOptionsModel := vpcService.NewGetEndpointGatewayIPOptions(endpointGatewayID, id)
				getEndpointGatewayIPOptionsModel.SetEndpointGatewayID("testString")
				getEndpointGatewayIPOptionsModel.SetID("testString")
				getEndpointGatewayIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getEndpointGatewayIPOptionsModel).ToNot(BeNil())
				Expect(getEndpointGatewayIPOptionsModel.EndpointGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(getEndpointGatewayIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getEndpointGatewayIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetEndpointGatewayOptions successfully`, func() {
				// Construct an instance of the GetEndpointGatewayOptions model
				id := "testString"
				getEndpointGatewayOptionsModel := vpcService.NewGetEndpointGatewayOptions(id)
				getEndpointGatewayOptionsModel.SetID("testString")
				getEndpointGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getEndpointGatewayOptionsModel).ToNot(BeNil())
				Expect(getEndpointGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getEndpointGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetEndpointGatewayResourceBindingOptions successfully`, func() {
				// Construct an instance of the GetEndpointGatewayResourceBindingOptions model
				endpointGatewayID := "testString"
				id := "testString"
				getEndpointGatewayResourceBindingOptionsModel := vpcService.NewGetEndpointGatewayResourceBindingOptions(endpointGatewayID, id)
				getEndpointGatewayResourceBindingOptionsModel.SetEndpointGatewayID("testString")
				getEndpointGatewayResourceBindingOptionsModel.SetID("testString")
				getEndpointGatewayResourceBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getEndpointGatewayResourceBindingOptionsModel).ToNot(BeNil())
				Expect(getEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(getEndpointGatewayResourceBindingOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getEndpointGatewayResourceBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetFloatingIPOptions successfully`, func() {
				// Construct an instance of the GetFloatingIPOptions model
				id := "testString"
				getFloatingIPOptionsModel := vpcService.NewGetFloatingIPOptions(id)
				getFloatingIPOptionsModel.SetID("testString")
				getFloatingIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getFloatingIPOptionsModel).ToNot(BeNil())
				Expect(getFloatingIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getFloatingIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetFlowLogCollectorOptions successfully`, func() {
				// Construct an instance of the GetFlowLogCollectorOptions model
				id := "testString"
				getFlowLogCollectorOptionsModel := vpcService.NewGetFlowLogCollectorOptions(id)
				getFlowLogCollectorOptionsModel.SetID("testString")
				getFlowLogCollectorOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getFlowLogCollectorOptionsModel).ToNot(BeNil())
				Expect(getFlowLogCollectorOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getFlowLogCollectorOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetIkePolicyOptions successfully`, func() {
				// Construct an instance of the GetIkePolicyOptions model
				id := "testString"
				getIkePolicyOptionsModel := vpcService.NewGetIkePolicyOptions(id)
				getIkePolicyOptionsModel.SetID("testString")
				getIkePolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getIkePolicyOptionsModel).ToNot(BeNil())
				Expect(getIkePolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getIkePolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetImageExportJobOptions successfully`, func() {
				// Construct an instance of the GetImageExportJobOptions model
				imageID := "testString"
				id := "testString"
				getImageExportJobOptionsModel := vpcService.NewGetImageExportJobOptions(imageID, id)
				getImageExportJobOptionsModel.SetImageID("testString")
				getImageExportJobOptionsModel.SetID("testString")
				getImageExportJobOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getImageExportJobOptionsModel).ToNot(BeNil())
				Expect(getImageExportJobOptionsModel.ImageID).To(Equal(core.StringPtr("testString")))
				Expect(getImageExportJobOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getImageExportJobOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetImageOptions successfully`, func() {
				// Construct an instance of the GetImageOptions model
				id := "testString"
				getImageOptionsModel := vpcService.NewGetImageOptions(id)
				getImageOptionsModel.SetID("testString")
				getImageOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getImageOptionsModel).ToNot(BeNil())
				Expect(getImageOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getImageOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceClusterNetworkAttachmentOptions successfully`, func() {
				// Construct an instance of the GetInstanceClusterNetworkAttachmentOptions model
				instanceID := "testString"
				id := "testString"
				getInstanceClusterNetworkAttachmentOptionsModel := vpcService.NewGetInstanceClusterNetworkAttachmentOptions(instanceID, id)
				getInstanceClusterNetworkAttachmentOptionsModel.SetInstanceID("testString")
				getInstanceClusterNetworkAttachmentOptionsModel.SetID("testString")
				getInstanceClusterNetworkAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceClusterNetworkAttachmentOptionsModel).ToNot(BeNil())
				Expect(getInstanceClusterNetworkAttachmentOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceClusterNetworkAttachmentOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceClusterNetworkAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceDiskOptions successfully`, func() {
				// Construct an instance of the GetInstanceDiskOptions model
				instanceID := "testString"
				id := "testString"
				getInstanceDiskOptionsModel := vpcService.NewGetInstanceDiskOptions(instanceID, id)
				getInstanceDiskOptionsModel.SetInstanceID("testString")
				getInstanceDiskOptionsModel.SetID("testString")
				getInstanceDiskOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceDiskOptionsModel).ToNot(BeNil())
				Expect(getInstanceDiskOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceDiskOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceDiskOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceGroupManagerActionOptions successfully`, func() {
				// Construct an instance of the GetInstanceGroupManagerActionOptions model
				instanceGroupID := "testString"
				instanceGroupManagerID := "testString"
				id := "testString"
				getInstanceGroupManagerActionOptionsModel := vpcService.NewGetInstanceGroupManagerActionOptions(instanceGroupID, instanceGroupManagerID, id)
				getInstanceGroupManagerActionOptionsModel.SetInstanceGroupID("testString")
				getInstanceGroupManagerActionOptionsModel.SetInstanceGroupManagerID("testString")
				getInstanceGroupManagerActionOptionsModel.SetID("testString")
				getInstanceGroupManagerActionOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceGroupManagerActionOptionsModel).ToNot(BeNil())
				Expect(getInstanceGroupManagerActionOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceGroupManagerActionOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceGroupManagerActionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceGroupManagerOptions successfully`, func() {
				// Construct an instance of the GetInstanceGroupManagerOptions model
				instanceGroupID := "testString"
				id := "testString"
				getInstanceGroupManagerOptionsModel := vpcService.NewGetInstanceGroupManagerOptions(instanceGroupID, id)
				getInstanceGroupManagerOptionsModel.SetInstanceGroupID("testString")
				getInstanceGroupManagerOptionsModel.SetID("testString")
				getInstanceGroupManagerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceGroupManagerOptionsModel).ToNot(BeNil())
				Expect(getInstanceGroupManagerOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceGroupManagerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceGroupManagerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceGroupManagerPolicyOptions successfully`, func() {
				// Construct an instance of the GetInstanceGroupManagerPolicyOptions model
				instanceGroupID := "testString"
				instanceGroupManagerID := "testString"
				id := "testString"
				getInstanceGroupManagerPolicyOptionsModel := vpcService.NewGetInstanceGroupManagerPolicyOptions(instanceGroupID, instanceGroupManagerID, id)
				getInstanceGroupManagerPolicyOptionsModel.SetInstanceGroupID("testString")
				getInstanceGroupManagerPolicyOptionsModel.SetInstanceGroupManagerID("testString")
				getInstanceGroupManagerPolicyOptionsModel.SetID("testString")
				getInstanceGroupManagerPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceGroupManagerPolicyOptionsModel).ToNot(BeNil())
				Expect(getInstanceGroupManagerPolicyOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceGroupManagerPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceGroupManagerPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceGroupMembershipOptions successfully`, func() {
				// Construct an instance of the GetInstanceGroupMembershipOptions model
				instanceGroupID := "testString"
				id := "testString"
				getInstanceGroupMembershipOptionsModel := vpcService.NewGetInstanceGroupMembershipOptions(instanceGroupID, id)
				getInstanceGroupMembershipOptionsModel.SetInstanceGroupID("testString")
				getInstanceGroupMembershipOptionsModel.SetID("testString")
				getInstanceGroupMembershipOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceGroupMembershipOptionsModel).ToNot(BeNil())
				Expect(getInstanceGroupMembershipOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceGroupMembershipOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceGroupMembershipOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceGroupOptions successfully`, func() {
				// Construct an instance of the GetInstanceGroupOptions model
				id := "testString"
				getInstanceGroupOptionsModel := vpcService.NewGetInstanceGroupOptions(id)
				getInstanceGroupOptionsModel.SetID("testString")
				getInstanceGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceGroupOptionsModel).ToNot(BeNil())
				Expect(getInstanceGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceInitializationOptions successfully`, func() {
				// Construct an instance of the GetInstanceInitializationOptions model
				id := "testString"
				getInstanceInitializationOptionsModel := vpcService.NewGetInstanceInitializationOptions(id)
				getInstanceInitializationOptionsModel.SetID("testString")
				getInstanceInitializationOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceInitializationOptionsModel).ToNot(BeNil())
				Expect(getInstanceInitializationOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceInitializationOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceNetworkAttachmentOptions successfully`, func() {
				// Construct an instance of the GetInstanceNetworkAttachmentOptions model
				instanceID := "testString"
				id := "testString"
				getInstanceNetworkAttachmentOptionsModel := vpcService.NewGetInstanceNetworkAttachmentOptions(instanceID, id)
				getInstanceNetworkAttachmentOptionsModel.SetInstanceID("testString")
				getInstanceNetworkAttachmentOptionsModel.SetID("testString")
				getInstanceNetworkAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceNetworkAttachmentOptionsModel).ToNot(BeNil())
				Expect(getInstanceNetworkAttachmentOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceNetworkAttachmentOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceNetworkAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceNetworkInterfaceFloatingIPOptions successfully`, func() {
				// Construct an instance of the GetInstanceNetworkInterfaceFloatingIPOptions model
				instanceID := "testString"
				networkInterfaceID := "testString"
				id := "testString"
				getInstanceNetworkInterfaceFloatingIPOptionsModel := vpcService.NewGetInstanceNetworkInterfaceFloatingIPOptions(instanceID, networkInterfaceID, id)
				getInstanceNetworkInterfaceFloatingIPOptionsModel.SetInstanceID("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.SetNetworkInterfaceID("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.SetID("testString")
				getInstanceNetworkInterfaceFloatingIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceNetworkInterfaceFloatingIPOptionsModel).ToNot(BeNil())
				Expect(getInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceNetworkInterfaceFloatingIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceNetworkInterfaceFloatingIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceNetworkInterfaceIPOptions successfully`, func() {
				// Construct an instance of the GetInstanceNetworkInterfaceIPOptions model
				instanceID := "testString"
				networkInterfaceID := "testString"
				id := "testString"
				getInstanceNetworkInterfaceIPOptionsModel := vpcService.NewGetInstanceNetworkInterfaceIPOptions(instanceID, networkInterfaceID, id)
				getInstanceNetworkInterfaceIPOptionsModel.SetInstanceID("testString")
				getInstanceNetworkInterfaceIPOptionsModel.SetNetworkInterfaceID("testString")
				getInstanceNetworkInterfaceIPOptionsModel.SetID("testString")
				getInstanceNetworkInterfaceIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceNetworkInterfaceIPOptionsModel).ToNot(BeNil())
				Expect(getInstanceNetworkInterfaceIPOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceNetworkInterfaceIPOptionsModel.NetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceNetworkInterfaceIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceNetworkInterfaceIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the GetInstanceNetworkInterfaceOptions model
				instanceID := "testString"
				id := "testString"
				getInstanceNetworkInterfaceOptionsModel := vpcService.NewGetInstanceNetworkInterfaceOptions(instanceID, id)
				getInstanceNetworkInterfaceOptionsModel.SetInstanceID("testString")
				getInstanceNetworkInterfaceOptionsModel.SetID("testString")
				getInstanceNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(getInstanceNetworkInterfaceOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceNetworkInterfaceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceOptions successfully`, func() {
				// Construct an instance of the GetInstanceOptions model
				id := "testString"
				getInstanceOptionsModel := vpcService.NewGetInstanceOptions(id)
				getInstanceOptionsModel.SetID("testString")
				getInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceOptionsModel).ToNot(BeNil())
				Expect(getInstanceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceProfileOptions successfully`, func() {
				// Construct an instance of the GetInstanceProfileOptions model
				name := "mx2-host-152x1216"
				getInstanceProfileOptionsModel := vpcService.NewGetInstanceProfileOptions(name)
				getInstanceProfileOptionsModel.SetName("mx2-host-152x1216")
				getInstanceProfileOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceProfileOptionsModel).ToNot(BeNil())
				Expect(getInstanceProfileOptionsModel.Name).To(Equal(core.StringPtr("mx2-host-152x1216")))
				Expect(getInstanceProfileOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceTemplateOptions successfully`, func() {
				// Construct an instance of the GetInstanceTemplateOptions model
				id := "testString"
				getInstanceTemplateOptionsModel := vpcService.NewGetInstanceTemplateOptions(id)
				getInstanceTemplateOptionsModel.SetID("testString")
				getInstanceTemplateOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceTemplateOptionsModel).ToNot(BeNil())
				Expect(getInstanceTemplateOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceTemplateOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetInstanceVolumeAttachmentOptions successfully`, func() {
				// Construct an instance of the GetInstanceVolumeAttachmentOptions model
				instanceID := "testString"
				id := "testString"
				getInstanceVolumeAttachmentOptionsModel := vpcService.NewGetInstanceVolumeAttachmentOptions(instanceID, id)
				getInstanceVolumeAttachmentOptionsModel.SetInstanceID("testString")
				getInstanceVolumeAttachmentOptionsModel.SetID("testString")
				getInstanceVolumeAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getInstanceVolumeAttachmentOptionsModel).ToNot(BeNil())
				Expect(getInstanceVolumeAttachmentOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceVolumeAttachmentOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getInstanceVolumeAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetIpsecPolicyOptions successfully`, func() {
				// Construct an instance of the GetIpsecPolicyOptions model
				id := "testString"
				getIpsecPolicyOptionsModel := vpcService.NewGetIpsecPolicyOptions(id)
				getIpsecPolicyOptionsModel.SetID("testString")
				getIpsecPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getIpsecPolicyOptionsModel).ToNot(BeNil())
				Expect(getIpsecPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getIpsecPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetKeyOptions successfully`, func() {
				// Construct an instance of the GetKeyOptions model
				id := "testString"
				getKeyOptionsModel := vpcService.NewGetKeyOptions(id)
				getKeyOptionsModel.SetID("testString")
				getKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getKeyOptionsModel).ToNot(BeNil())
				Expect(getKeyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetLoadBalancerListenerOptions successfully`, func() {
				// Construct an instance of the GetLoadBalancerListenerOptions model
				loadBalancerID := "testString"
				id := "testString"
				getLoadBalancerListenerOptionsModel := vpcService.NewGetLoadBalancerListenerOptions(loadBalancerID, id)
				getLoadBalancerListenerOptionsModel.SetLoadBalancerID("testString")
				getLoadBalancerListenerOptionsModel.SetID("testString")
				getLoadBalancerListenerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getLoadBalancerListenerOptionsModel).ToNot(BeNil())
				Expect(getLoadBalancerListenerOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerListenerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerListenerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetLoadBalancerListenerPolicyOptions successfully`, func() {
				// Construct an instance of the GetLoadBalancerListenerPolicyOptions model
				loadBalancerID := "testString"
				listenerID := "testString"
				id := "testString"
				getLoadBalancerListenerPolicyOptionsModel := vpcService.NewGetLoadBalancerListenerPolicyOptions(loadBalancerID, listenerID, id)
				getLoadBalancerListenerPolicyOptionsModel.SetLoadBalancerID("testString")
				getLoadBalancerListenerPolicyOptionsModel.SetListenerID("testString")
				getLoadBalancerListenerPolicyOptionsModel.SetID("testString")
				getLoadBalancerListenerPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getLoadBalancerListenerPolicyOptionsModel).ToNot(BeNil())
				Expect(getLoadBalancerListenerPolicyOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerListenerPolicyOptionsModel.ListenerID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerListenerPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerListenerPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetLoadBalancerListenerPolicyRuleOptions successfully`, func() {
				// Construct an instance of the GetLoadBalancerListenerPolicyRuleOptions model
				loadBalancerID := "testString"
				listenerID := "testString"
				policyID := "testString"
				id := "testString"
				getLoadBalancerListenerPolicyRuleOptionsModel := vpcService.NewGetLoadBalancerListenerPolicyRuleOptions(loadBalancerID, listenerID, policyID, id)
				getLoadBalancerListenerPolicyRuleOptionsModel.SetLoadBalancerID("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.SetListenerID("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.SetPolicyID("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.SetID("testString")
				getLoadBalancerListenerPolicyRuleOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getLoadBalancerListenerPolicyRuleOptionsModel).ToNot(BeNil())
				Expect(getLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerListenerPolicyRuleOptionsModel.ListenerID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerListenerPolicyRuleOptionsModel.PolicyID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerListenerPolicyRuleOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerListenerPolicyRuleOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetLoadBalancerOptions successfully`, func() {
				// Construct an instance of the GetLoadBalancerOptions model
				id := "testString"
				getLoadBalancerOptionsModel := vpcService.NewGetLoadBalancerOptions(id)
				getLoadBalancerOptionsModel.SetID("testString")
				getLoadBalancerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getLoadBalancerOptionsModel).ToNot(BeNil())
				Expect(getLoadBalancerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetLoadBalancerPoolMemberOptions successfully`, func() {
				// Construct an instance of the GetLoadBalancerPoolMemberOptions model
				loadBalancerID := "testString"
				poolID := "testString"
				id := "testString"
				getLoadBalancerPoolMemberOptionsModel := vpcService.NewGetLoadBalancerPoolMemberOptions(loadBalancerID, poolID, id)
				getLoadBalancerPoolMemberOptionsModel.SetLoadBalancerID("testString")
				getLoadBalancerPoolMemberOptionsModel.SetPoolID("testString")
				getLoadBalancerPoolMemberOptionsModel.SetID("testString")
				getLoadBalancerPoolMemberOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getLoadBalancerPoolMemberOptionsModel).ToNot(BeNil())
				Expect(getLoadBalancerPoolMemberOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerPoolMemberOptionsModel.PoolID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerPoolMemberOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerPoolMemberOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetLoadBalancerPoolOptions successfully`, func() {
				// Construct an instance of the GetLoadBalancerPoolOptions model
				loadBalancerID := "testString"
				id := "testString"
				getLoadBalancerPoolOptionsModel := vpcService.NewGetLoadBalancerPoolOptions(loadBalancerID, id)
				getLoadBalancerPoolOptionsModel.SetLoadBalancerID("testString")
				getLoadBalancerPoolOptionsModel.SetID("testString")
				getLoadBalancerPoolOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getLoadBalancerPoolOptionsModel).ToNot(BeNil())
				Expect(getLoadBalancerPoolOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerPoolOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerPoolOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetLoadBalancerProfileOptions successfully`, func() {
				// Construct an instance of the GetLoadBalancerProfileOptions model
				name := "network-fixed"
				getLoadBalancerProfileOptionsModel := vpcService.NewGetLoadBalancerProfileOptions(name)
				getLoadBalancerProfileOptionsModel.SetName("network-fixed")
				getLoadBalancerProfileOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getLoadBalancerProfileOptionsModel).ToNot(BeNil())
				Expect(getLoadBalancerProfileOptionsModel.Name).To(Equal(core.StringPtr("network-fixed")))
				Expect(getLoadBalancerProfileOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetLoadBalancerStatisticsOptions successfully`, func() {
				// Construct an instance of the GetLoadBalancerStatisticsOptions model
				id := "testString"
				getLoadBalancerStatisticsOptionsModel := vpcService.NewGetLoadBalancerStatisticsOptions(id)
				getLoadBalancerStatisticsOptionsModel.SetID("testString")
				getLoadBalancerStatisticsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getLoadBalancerStatisticsOptionsModel).ToNot(BeNil())
				Expect(getLoadBalancerStatisticsOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getLoadBalancerStatisticsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetNetworkACLOptions successfully`, func() {
				// Construct an instance of the GetNetworkACLOptions model
				id := "testString"
				getNetworkACLOptionsModel := vpcService.NewGetNetworkACLOptions(id)
				getNetworkACLOptionsModel.SetID("testString")
				getNetworkACLOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getNetworkACLOptionsModel).ToNot(BeNil())
				Expect(getNetworkACLOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getNetworkACLOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetNetworkACLRuleOptions successfully`, func() {
				// Construct an instance of the GetNetworkACLRuleOptions model
				networkAclid := "testString"
				id := "testString"
				getNetworkACLRuleOptionsModel := vpcService.NewGetNetworkACLRuleOptions(networkAclid, id)
				getNetworkACLRuleOptionsModel.SetNetworkACLID("testString")
				getNetworkACLRuleOptionsModel.SetID("testString")
				getNetworkACLRuleOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getNetworkACLRuleOptionsModel).ToNot(BeNil())
				Expect(getNetworkACLRuleOptionsModel.NetworkACLID).To(Equal(core.StringPtr("testString")))
				Expect(getNetworkACLRuleOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getNetworkACLRuleOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetNetworkInterfaceFloatingIPOptions successfully`, func() {
				// Construct an instance of the GetNetworkInterfaceFloatingIPOptions model
				virtualNetworkInterfaceID := "testString"
				id := "testString"
				getNetworkInterfaceFloatingIPOptionsModel := vpcService.NewGetNetworkInterfaceFloatingIPOptions(virtualNetworkInterfaceID, id)
				getNetworkInterfaceFloatingIPOptionsModel.SetVirtualNetworkInterfaceID("testString")
				getNetworkInterfaceFloatingIPOptionsModel.SetID("testString")
				getNetworkInterfaceFloatingIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getNetworkInterfaceFloatingIPOptionsModel).ToNot(BeNil())
				Expect(getNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(getNetworkInterfaceFloatingIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getNetworkInterfaceFloatingIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetOperatingSystemOptions successfully`, func() {
				// Construct an instance of the GetOperatingSystemOptions model
				name := "red-7-amd64"
				getOperatingSystemOptionsModel := vpcService.NewGetOperatingSystemOptions(name)
				getOperatingSystemOptionsModel.SetName("red-7-amd64")
				getOperatingSystemOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getOperatingSystemOptionsModel).ToNot(BeNil())
				Expect(getOperatingSystemOptionsModel.Name).To(Equal(core.StringPtr("red-7-amd64")))
				Expect(getOperatingSystemOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetPlacementGroupOptions successfully`, func() {
				// Construct an instance of the GetPlacementGroupOptions model
				id := "testString"
				getPlacementGroupOptionsModel := vpcService.NewGetPlacementGroupOptions(id)
				getPlacementGroupOptionsModel.SetID("testString")
				getPlacementGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getPlacementGroupOptionsModel).ToNot(BeNil())
				Expect(getPlacementGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getPlacementGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetPrivatePathServiceGatewayAccountPolicyOptions successfully`, func() {
				// Construct an instance of the GetPrivatePathServiceGatewayAccountPolicyOptions model
				privatePathServiceGatewayID := "testString"
				id := "testString"
				getPrivatePathServiceGatewayAccountPolicyOptionsModel := vpcService.NewGetPrivatePathServiceGatewayAccountPolicyOptions(privatePathServiceGatewayID, id)
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.SetPrivatePathServiceGatewayID("testString")
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.SetID("testString")
				getPrivatePathServiceGatewayAccountPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getPrivatePathServiceGatewayAccountPolicyOptionsModel).ToNot(BeNil())
				Expect(getPrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(getPrivatePathServiceGatewayAccountPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getPrivatePathServiceGatewayAccountPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetPrivatePathServiceGatewayEndpointGatewayBindingOptions successfully`, func() {
				// Construct an instance of the GetPrivatePathServiceGatewayEndpointGatewayBindingOptions model
				privatePathServiceGatewayID := "testString"
				id := "testString"
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel := vpcService.NewGetPrivatePathServiceGatewayEndpointGatewayBindingOptions(privatePathServiceGatewayID, id)
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetPrivatePathServiceGatewayID("testString")
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetID("testString")
				getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel).ToNot(BeNil())
				Expect(getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.PrivatePathServiceGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetPrivatePathServiceGatewayOptions successfully`, func() {
				// Construct an instance of the GetPrivatePathServiceGatewayOptions model
				id := "testString"
				getPrivatePathServiceGatewayOptionsModel := vpcService.NewGetPrivatePathServiceGatewayOptions(id)
				getPrivatePathServiceGatewayOptionsModel.SetID("testString")
				getPrivatePathServiceGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getPrivatePathServiceGatewayOptionsModel).ToNot(BeNil())
				Expect(getPrivatePathServiceGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getPrivatePathServiceGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetPublicAddressRangeOptions successfully`, func() {
				// Construct an instance of the GetPublicAddressRangeOptions model
				id := "testString"
				getPublicAddressRangeOptionsModel := vpcService.NewGetPublicAddressRangeOptions(id)
				getPublicAddressRangeOptionsModel.SetID("testString")
				getPublicAddressRangeOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getPublicAddressRangeOptionsModel).ToNot(BeNil())
				Expect(getPublicAddressRangeOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getPublicAddressRangeOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetPublicGatewayOptions successfully`, func() {
				// Construct an instance of the GetPublicGatewayOptions model
				id := "testString"
				getPublicGatewayOptionsModel := vpcService.NewGetPublicGatewayOptions(id)
				getPublicGatewayOptionsModel.SetID("testString")
				getPublicGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getPublicGatewayOptionsModel).ToNot(BeNil())
				Expect(getPublicGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getPublicGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetRegionOptions successfully`, func() {
				// Construct an instance of the GetRegionOptions model
				name := "us-south"
				getRegionOptionsModel := vpcService.NewGetRegionOptions(name)
				getRegionOptionsModel.SetName("us-south")
				getRegionOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getRegionOptionsModel).ToNot(BeNil())
				Expect(getRegionOptionsModel.Name).To(Equal(core.StringPtr("us-south")))
				Expect(getRegionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetRegionZoneOptions successfully`, func() {
				// Construct an instance of the GetRegionZoneOptions model
				regionName := "us-south"
				name := "us-south-1"
				getRegionZoneOptionsModel := vpcService.NewGetRegionZoneOptions(regionName, name)
				getRegionZoneOptionsModel.SetRegionName("us-south")
				getRegionZoneOptionsModel.SetName("us-south-1")
				getRegionZoneOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getRegionZoneOptionsModel).ToNot(BeNil())
				Expect(getRegionZoneOptionsModel.RegionName).To(Equal(core.StringPtr("us-south")))
				Expect(getRegionZoneOptionsModel.Name).To(Equal(core.StringPtr("us-south-1")))
				Expect(getRegionZoneOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetReservationOptions successfully`, func() {
				// Construct an instance of the GetReservationOptions model
				id := "testString"
				getReservationOptionsModel := vpcService.NewGetReservationOptions(id)
				getReservationOptionsModel.SetID("testString")
				getReservationOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getReservationOptionsModel).ToNot(BeNil())
				Expect(getReservationOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getReservationOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetSecurityGroupOptions successfully`, func() {
				// Construct an instance of the GetSecurityGroupOptions model
				id := "testString"
				getSecurityGroupOptionsModel := vpcService.NewGetSecurityGroupOptions(id)
				getSecurityGroupOptionsModel.SetID("testString")
				getSecurityGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getSecurityGroupOptionsModel).ToNot(BeNil())
				Expect(getSecurityGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getSecurityGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetSecurityGroupRuleOptions successfully`, func() {
				// Construct an instance of the GetSecurityGroupRuleOptions model
				securityGroupID := "testString"
				id := "testString"
				getSecurityGroupRuleOptionsModel := vpcService.NewGetSecurityGroupRuleOptions(securityGroupID, id)
				getSecurityGroupRuleOptionsModel.SetSecurityGroupID("testString")
				getSecurityGroupRuleOptionsModel.SetID("testString")
				getSecurityGroupRuleOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getSecurityGroupRuleOptionsModel).ToNot(BeNil())
				Expect(getSecurityGroupRuleOptionsModel.SecurityGroupID).To(Equal(core.StringPtr("testString")))
				Expect(getSecurityGroupRuleOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getSecurityGroupRuleOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetSecurityGroupTargetOptions successfully`, func() {
				// Construct an instance of the GetSecurityGroupTargetOptions model
				securityGroupID := "testString"
				id := "testString"
				getSecurityGroupTargetOptionsModel := vpcService.NewGetSecurityGroupTargetOptions(securityGroupID, id)
				getSecurityGroupTargetOptionsModel.SetSecurityGroupID("testString")
				getSecurityGroupTargetOptionsModel.SetID("testString")
				getSecurityGroupTargetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getSecurityGroupTargetOptionsModel).ToNot(BeNil())
				Expect(getSecurityGroupTargetOptionsModel.SecurityGroupID).To(Equal(core.StringPtr("testString")))
				Expect(getSecurityGroupTargetOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getSecurityGroupTargetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetShareAccessorBindingOptions successfully`, func() {
				// Construct an instance of the GetShareAccessorBindingOptions model
				shareID := "testString"
				id := "testString"
				getShareAccessorBindingOptionsModel := vpcService.NewGetShareAccessorBindingOptions(shareID, id)
				getShareAccessorBindingOptionsModel.SetShareID("testString")
				getShareAccessorBindingOptionsModel.SetID("testString")
				getShareAccessorBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getShareAccessorBindingOptionsModel).ToNot(BeNil())
				Expect(getShareAccessorBindingOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(getShareAccessorBindingOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getShareAccessorBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetShareMountTargetOptions successfully`, func() {
				// Construct an instance of the GetShareMountTargetOptions model
				shareID := "testString"
				id := "testString"
				getShareMountTargetOptionsModel := vpcService.NewGetShareMountTargetOptions(shareID, id)
				getShareMountTargetOptionsModel.SetShareID("testString")
				getShareMountTargetOptionsModel.SetID("testString")
				getShareMountTargetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getShareMountTargetOptionsModel).ToNot(BeNil())
				Expect(getShareMountTargetOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(getShareMountTargetOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getShareMountTargetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetShareOptions successfully`, func() {
				// Construct an instance of the GetShareOptions model
				id := "testString"
				getShareOptionsModel := vpcService.NewGetShareOptions(id)
				getShareOptionsModel.SetID("testString")
				getShareOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getShareOptionsModel).ToNot(BeNil())
				Expect(getShareOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getShareOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetShareProfileOptions successfully`, func() {
				// Construct an instance of the GetShareProfileOptions model
				name := "dp2"
				getShareProfileOptionsModel := vpcService.NewGetShareProfileOptions(name)
				getShareProfileOptionsModel.SetName("dp2")
				getShareProfileOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getShareProfileOptionsModel).ToNot(BeNil())
				Expect(getShareProfileOptionsModel.Name).To(Equal(core.StringPtr("dp2")))
				Expect(getShareProfileOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetShareSnapshotOptions successfully`, func() {
				// Construct an instance of the GetShareSnapshotOptions model
				shareID := "testString"
				id := "testString"
				getShareSnapshotOptionsModel := vpcService.NewGetShareSnapshotOptions(shareID, id)
				getShareSnapshotOptionsModel.SetShareID("testString")
				getShareSnapshotOptionsModel.SetID("testString")
				getShareSnapshotOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getShareSnapshotOptionsModel).ToNot(BeNil())
				Expect(getShareSnapshotOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(getShareSnapshotOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getShareSnapshotOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetShareSourceOptions successfully`, func() {
				// Construct an instance of the GetShareSourceOptions model
				shareID := "testString"
				getShareSourceOptionsModel := vpcService.NewGetShareSourceOptions(shareID)
				getShareSourceOptionsModel.SetShareID("testString")
				getShareSourceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getShareSourceOptionsModel).ToNot(BeNil())
				Expect(getShareSourceOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(getShareSourceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetSnapshotCloneOptions successfully`, func() {
				// Construct an instance of the GetSnapshotCloneOptions model
				id := "testString"
				zoneName := "us-south-1"
				getSnapshotCloneOptionsModel := vpcService.NewGetSnapshotCloneOptions(id, zoneName)
				getSnapshotCloneOptionsModel.SetID("testString")
				getSnapshotCloneOptionsModel.SetZoneName("us-south-1")
				getSnapshotCloneOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getSnapshotCloneOptionsModel).ToNot(BeNil())
				Expect(getSnapshotCloneOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getSnapshotCloneOptionsModel.ZoneName).To(Equal(core.StringPtr("us-south-1")))
				Expect(getSnapshotCloneOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetSnapshotConsistencyGroupOptions successfully`, func() {
				// Construct an instance of the GetSnapshotConsistencyGroupOptions model
				id := "testString"
				getSnapshotConsistencyGroupOptionsModel := vpcService.NewGetSnapshotConsistencyGroupOptions(id)
				getSnapshotConsistencyGroupOptionsModel.SetID("testString")
				getSnapshotConsistencyGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getSnapshotConsistencyGroupOptionsModel).ToNot(BeNil())
				Expect(getSnapshotConsistencyGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getSnapshotConsistencyGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetSnapshotOptions successfully`, func() {
				// Construct an instance of the GetSnapshotOptions model
				id := "testString"
				getSnapshotOptionsModel := vpcService.NewGetSnapshotOptions(id)
				getSnapshotOptionsModel.SetID("testString")
				getSnapshotOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getSnapshotOptionsModel).ToNot(BeNil())
				Expect(getSnapshotOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getSnapshotOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetSubnetNetworkACLOptions successfully`, func() {
				// Construct an instance of the GetSubnetNetworkACLOptions model
				id := "testString"
				getSubnetNetworkACLOptionsModel := vpcService.NewGetSubnetNetworkACLOptions(id)
				getSubnetNetworkACLOptionsModel.SetID("testString")
				getSubnetNetworkACLOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getSubnetNetworkACLOptionsModel).ToNot(BeNil())
				Expect(getSubnetNetworkACLOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getSubnetNetworkACLOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetSubnetOptions successfully`, func() {
				// Construct an instance of the GetSubnetOptions model
				id := "testString"
				getSubnetOptionsModel := vpcService.NewGetSubnetOptions(id)
				getSubnetOptionsModel.SetID("testString")
				getSubnetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getSubnetOptionsModel).ToNot(BeNil())
				Expect(getSubnetOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getSubnetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetSubnetPublicGatewayOptions successfully`, func() {
				// Construct an instance of the GetSubnetPublicGatewayOptions model
				id := "testString"
				getSubnetPublicGatewayOptionsModel := vpcService.NewGetSubnetPublicGatewayOptions(id)
				getSubnetPublicGatewayOptionsModel.SetID("testString")
				getSubnetPublicGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getSubnetPublicGatewayOptionsModel).ToNot(BeNil())
				Expect(getSubnetPublicGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getSubnetPublicGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetSubnetReservedIPOptions successfully`, func() {
				// Construct an instance of the GetSubnetReservedIPOptions model
				subnetID := "testString"
				id := "testString"
				getSubnetReservedIPOptionsModel := vpcService.NewGetSubnetReservedIPOptions(subnetID, id)
				getSubnetReservedIPOptionsModel.SetSubnetID("testString")
				getSubnetReservedIPOptionsModel.SetID("testString")
				getSubnetReservedIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getSubnetReservedIPOptionsModel).ToNot(BeNil())
				Expect(getSubnetReservedIPOptionsModel.SubnetID).To(Equal(core.StringPtr("testString")))
				Expect(getSubnetReservedIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getSubnetReservedIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetSubnetRoutingTableOptions successfully`, func() {
				// Construct an instance of the GetSubnetRoutingTableOptions model
				id := "testString"
				getSubnetRoutingTableOptionsModel := vpcService.NewGetSubnetRoutingTableOptions(id)
				getSubnetRoutingTableOptionsModel.SetID("testString")
				getSubnetRoutingTableOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getSubnetRoutingTableOptionsModel).ToNot(BeNil())
				Expect(getSubnetRoutingTableOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getSubnetRoutingTableOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVirtualNetworkInterfaceIPOptions successfully`, func() {
				// Construct an instance of the GetVirtualNetworkInterfaceIPOptions model
				virtualNetworkInterfaceID := "testString"
				id := "testString"
				getVirtualNetworkInterfaceIPOptionsModel := vpcService.NewGetVirtualNetworkInterfaceIPOptions(virtualNetworkInterfaceID, id)
				getVirtualNetworkInterfaceIPOptionsModel.SetVirtualNetworkInterfaceID("testString")
				getVirtualNetworkInterfaceIPOptionsModel.SetID("testString")
				getVirtualNetworkInterfaceIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVirtualNetworkInterfaceIPOptionsModel).ToNot(BeNil())
				Expect(getVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(getVirtualNetworkInterfaceIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVirtualNetworkInterfaceIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVirtualNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the GetVirtualNetworkInterfaceOptions model
				id := "testString"
				getVirtualNetworkInterfaceOptionsModel := vpcService.NewGetVirtualNetworkInterfaceOptions(id)
				getVirtualNetworkInterfaceOptionsModel.SetID("testString")
				getVirtualNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVirtualNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(getVirtualNetworkInterfaceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVirtualNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVolumeOptions successfully`, func() {
				// Construct an instance of the GetVolumeOptions model
				id := "testString"
				getVolumeOptionsModel := vpcService.NewGetVolumeOptions(id)
				getVolumeOptionsModel.SetID("testString")
				getVolumeOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVolumeOptionsModel).ToNot(BeNil())
				Expect(getVolumeOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVolumeOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVolumeProfileOptions successfully`, func() {
				// Construct an instance of the GetVolumeProfileOptions model
				name := "10iops-tier"
				getVolumeProfileOptionsModel := vpcService.NewGetVolumeProfileOptions(name)
				getVolumeProfileOptionsModel.SetName("10iops-tier")
				getVolumeProfileOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVolumeProfileOptionsModel).ToNot(BeNil())
				Expect(getVolumeProfileOptionsModel.Name).To(Equal(core.StringPtr("10iops-tier")))
				Expect(getVolumeProfileOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPCAddressPrefixOptions successfully`, func() {
				// Construct an instance of the GetVPCAddressPrefixOptions model
				vpcID := "testString"
				id := "testString"
				getVPCAddressPrefixOptionsModel := vpcService.NewGetVPCAddressPrefixOptions(vpcID, id)
				getVPCAddressPrefixOptionsModel.SetVPCID("testString")
				getVPCAddressPrefixOptionsModel.SetID("testString")
				getVPCAddressPrefixOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPCAddressPrefixOptionsModel).ToNot(BeNil())
				Expect(getVPCAddressPrefixOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCAddressPrefixOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCAddressPrefixOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPCDefaultNetworkACLOptions successfully`, func() {
				// Construct an instance of the GetVPCDefaultNetworkACLOptions model
				id := "testString"
				getVPCDefaultNetworkACLOptionsModel := vpcService.NewGetVPCDefaultNetworkACLOptions(id)
				getVPCDefaultNetworkACLOptionsModel.SetID("testString")
				getVPCDefaultNetworkACLOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPCDefaultNetworkACLOptionsModel).ToNot(BeNil())
				Expect(getVPCDefaultNetworkACLOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCDefaultNetworkACLOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPCDefaultRoutingTableOptions successfully`, func() {
				// Construct an instance of the GetVPCDefaultRoutingTableOptions model
				id := "testString"
				getVPCDefaultRoutingTableOptionsModel := vpcService.NewGetVPCDefaultRoutingTableOptions(id)
				getVPCDefaultRoutingTableOptionsModel.SetID("testString")
				getVPCDefaultRoutingTableOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPCDefaultRoutingTableOptionsModel).ToNot(BeNil())
				Expect(getVPCDefaultRoutingTableOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCDefaultRoutingTableOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPCDefaultSecurityGroupOptions successfully`, func() {
				// Construct an instance of the GetVPCDefaultSecurityGroupOptions model
				id := "testString"
				getVPCDefaultSecurityGroupOptionsModel := vpcService.NewGetVPCDefaultSecurityGroupOptions(id)
				getVPCDefaultSecurityGroupOptionsModel.SetID("testString")
				getVPCDefaultSecurityGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPCDefaultSecurityGroupOptionsModel).ToNot(BeNil())
				Expect(getVPCDefaultSecurityGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCDefaultSecurityGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPCDnsResolutionBindingOptions successfully`, func() {
				// Construct an instance of the GetVPCDnsResolutionBindingOptions model
				vpcID := "testString"
				id := "testString"
				getVPCDnsResolutionBindingOptionsModel := vpcService.NewGetVPCDnsResolutionBindingOptions(vpcID, id)
				getVPCDnsResolutionBindingOptionsModel.SetVPCID("testString")
				getVPCDnsResolutionBindingOptionsModel.SetID("testString")
				getVPCDnsResolutionBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPCDnsResolutionBindingOptionsModel).ToNot(BeNil())
				Expect(getVPCDnsResolutionBindingOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCDnsResolutionBindingOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCDnsResolutionBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPCOptions successfully`, func() {
				// Construct an instance of the GetVPCOptions model
				id := "testString"
				getVPCOptionsModel := vpcService.NewGetVPCOptions(id)
				getVPCOptionsModel.SetID("testString")
				getVPCOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPCOptionsModel).ToNot(BeNil())
				Expect(getVPCOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPCRouteOptions successfully`, func() {
				// Construct an instance of the GetVPCRouteOptions model
				vpcID := "testString"
				id := "testString"
				getVPCRouteOptionsModel := vpcService.NewGetVPCRouteOptions(vpcID, id)
				getVPCRouteOptionsModel.SetVPCID("testString")
				getVPCRouteOptionsModel.SetID("testString")
				getVPCRouteOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPCRouteOptionsModel).ToNot(BeNil())
				Expect(getVPCRouteOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCRouteOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCRouteOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPCRoutingTableOptions successfully`, func() {
				// Construct an instance of the GetVPCRoutingTableOptions model
				vpcID := "testString"
				id := "testString"
				getVPCRoutingTableOptionsModel := vpcService.NewGetVPCRoutingTableOptions(vpcID, id)
				getVPCRoutingTableOptionsModel.SetVPCID("testString")
				getVPCRoutingTableOptionsModel.SetID("testString")
				getVPCRoutingTableOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPCRoutingTableOptionsModel).ToNot(BeNil())
				Expect(getVPCRoutingTableOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCRoutingTableOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCRoutingTableOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPCRoutingTableRouteOptions successfully`, func() {
				// Construct an instance of the GetVPCRoutingTableRouteOptions model
				vpcID := "testString"
				routingTableID := "testString"
				id := "testString"
				getVPCRoutingTableRouteOptionsModel := vpcService.NewGetVPCRoutingTableRouteOptions(vpcID, routingTableID, id)
				getVPCRoutingTableRouteOptionsModel.SetVPCID("testString")
				getVPCRoutingTableRouteOptionsModel.SetRoutingTableID("testString")
				getVPCRoutingTableRouteOptionsModel.SetID("testString")
				getVPCRoutingTableRouteOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPCRoutingTableRouteOptionsModel).ToNot(BeNil())
				Expect(getVPCRoutingTableRouteOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCRoutingTableRouteOptionsModel.RoutingTableID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCRoutingTableRouteOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPCRoutingTableRouteOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPNGatewayConnectionOptions successfully`, func() {
				// Construct an instance of the GetVPNGatewayConnectionOptions model
				vpnGatewayID := "testString"
				id := "testString"
				getVPNGatewayConnectionOptionsModel := vpcService.NewGetVPNGatewayConnectionOptions(vpnGatewayID, id)
				getVPNGatewayConnectionOptionsModel.SetVPNGatewayID("testString")
				getVPNGatewayConnectionOptionsModel.SetID("testString")
				getVPNGatewayConnectionOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPNGatewayConnectionOptionsModel).ToNot(BeNil())
				Expect(getVPNGatewayConnectionOptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(getVPNGatewayConnectionOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPNGatewayConnectionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPNGatewayOptions successfully`, func() {
				// Construct an instance of the GetVPNGatewayOptions model
				id := "testString"
				getVPNGatewayOptionsModel := vpcService.NewGetVPNGatewayOptions(id)
				getVPNGatewayOptionsModel.SetID("testString")
				getVPNGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPNGatewayOptionsModel).ToNot(BeNil())
				Expect(getVPNGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPNGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPNGatewayServiceConnectionOptions successfully`, func() {
				// Construct an instance of the GetVPNGatewayServiceConnectionOptions model
				vpnGatewayID := "testString"
				id := "testString"
				getVPNGatewayServiceConnectionOptionsModel := vpcService.NewGetVPNGatewayServiceConnectionOptions(vpnGatewayID, id)
				getVPNGatewayServiceConnectionOptionsModel.SetVPNGatewayID("testString")
				getVPNGatewayServiceConnectionOptionsModel.SetID("testString")
				getVPNGatewayServiceConnectionOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPNGatewayServiceConnectionOptionsModel).ToNot(BeNil())
				Expect(getVPNGatewayServiceConnectionOptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(getVPNGatewayServiceConnectionOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPNGatewayServiceConnectionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPNServerClientConfigurationOptions successfully`, func() {
				// Construct an instance of the GetVPNServerClientConfigurationOptions model
				id := "testString"
				getVPNServerClientConfigurationOptionsModel := vpcService.NewGetVPNServerClientConfigurationOptions(id)
				getVPNServerClientConfigurationOptionsModel.SetID("testString")
				getVPNServerClientConfigurationOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPNServerClientConfigurationOptionsModel).ToNot(BeNil())
				Expect(getVPNServerClientConfigurationOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPNServerClientConfigurationOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPNServerClientOptions successfully`, func() {
				// Construct an instance of the GetVPNServerClientOptions model
				vpnServerID := "testString"
				id := "testString"
				getVPNServerClientOptionsModel := vpcService.NewGetVPNServerClientOptions(vpnServerID, id)
				getVPNServerClientOptionsModel.SetVPNServerID("testString")
				getVPNServerClientOptionsModel.SetID("testString")
				getVPNServerClientOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPNServerClientOptionsModel).ToNot(BeNil())
				Expect(getVPNServerClientOptionsModel.VPNServerID).To(Equal(core.StringPtr("testString")))
				Expect(getVPNServerClientOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPNServerClientOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPNServerOptions successfully`, func() {
				// Construct an instance of the GetVPNServerOptions model
				id := "testString"
				getVPNServerOptionsModel := vpcService.NewGetVPNServerOptions(id)
				getVPNServerOptionsModel.SetID("testString")
				getVPNServerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPNServerOptionsModel).ToNot(BeNil())
				Expect(getVPNServerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPNServerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewGetVPNServerRouteOptions successfully`, func() {
				// Construct an instance of the GetVPNServerRouteOptions model
				vpnServerID := "testString"
				id := "testString"
				getVPNServerRouteOptionsModel := vpcService.NewGetVPNServerRouteOptions(vpnServerID, id)
				getVPNServerRouteOptionsModel.SetVPNServerID("testString")
				getVPNServerRouteOptionsModel.SetID("testString")
				getVPNServerRouteOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(getVPNServerRouteOptionsModel).ToNot(BeNil())
				Expect(getVPNServerRouteOptionsModel.VPNServerID).To(Equal(core.StringPtr("testString")))
				Expect(getVPNServerRouteOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(getVPNServerRouteOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewIP successfully`, func() {
				address := "192.168.3.4"
				_model, err := vpcService.NewIP(address)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewImageFilePrototype successfully`, func() {
				href := "cos://us-south/custom-image-vpc-bucket/customImage-0.vhd"
				_model, err := vpcService.NewImageFilePrototype(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceClusterNetworkAttachmentPrototypeInstanceContext successfully`, func() {
				var clusterNetworkInterface vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceIntf = nil
				_, err := vpcService.NewInstanceClusterNetworkAttachmentPrototypeInstanceContext(clusterNetworkInterface)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceDefaultTrustedProfilePrototype successfully`, func() {
				var target vpcv1.TrustedProfileIdentityIntf = nil
				_, err := vpcService.NewInstanceDefaultTrustedProfilePrototype(target)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceGroupManagerScheduledActionGroupPrototype successfully`, func() {
				membershipCount := int64(10)
				_model, err := vpcService.NewInstanceGroupManagerScheduledActionGroupPrototype(membershipCount)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceNetworkAttachmentPrototype successfully`, func() {
				var virtualNetworkInterface vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf = nil
				_, err := vpcService.NewInstanceNetworkAttachmentPrototype(virtualNetworkInterface)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewListBackupPoliciesOptions successfully`, func() {
				// Construct an instance of the ListBackupPoliciesOptions model
				listBackupPoliciesOptionsModel := vpcService.NewListBackupPoliciesOptions()
				listBackupPoliciesOptionsModel.SetStart("testString")
				listBackupPoliciesOptionsModel.SetLimit(int64(10))
				listBackupPoliciesOptionsModel.SetResourceGroupID("testString")
				listBackupPoliciesOptionsModel.SetName("my-name")
				listBackupPoliciesOptionsModel.SetTag("testString")
				listBackupPoliciesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listBackupPoliciesOptionsModel).ToNot(BeNil())
				Expect(listBackupPoliciesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listBackupPoliciesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listBackupPoliciesOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listBackupPoliciesOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listBackupPoliciesOptionsModel.Tag).To(Equal(core.StringPtr("testString")))
				Expect(listBackupPoliciesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListBackupPolicyJobsOptions successfully`, func() {
				// Construct an instance of the ListBackupPolicyJobsOptions model
				backupPolicyID := "testString"
				listBackupPolicyJobsOptionsModel := vpcService.NewListBackupPolicyJobsOptions(backupPolicyID)
				listBackupPolicyJobsOptionsModel.SetBackupPolicyID("testString")
				listBackupPolicyJobsOptionsModel.SetStatus("failed")
				listBackupPolicyJobsOptionsModel.SetBackupPolicyPlanID("testString")
				listBackupPolicyJobsOptionsModel.SetStart("testString")
				listBackupPolicyJobsOptionsModel.SetLimit(int64(10))
				listBackupPolicyJobsOptionsModel.SetSort("name")
				listBackupPolicyJobsOptionsModel.SetSourceID("testString")
				listBackupPolicyJobsOptionsModel.SetTargetSnapshotsID("testString")
				listBackupPolicyJobsOptionsModel.SetTargetSnapshotsCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")
				listBackupPolicyJobsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listBackupPolicyJobsOptionsModel).ToNot(BeNil())
				Expect(listBackupPolicyJobsOptionsModel.BackupPolicyID).To(Equal(core.StringPtr("testString")))
				Expect(listBackupPolicyJobsOptionsModel.Status).To(Equal(core.StringPtr("failed")))
				Expect(listBackupPolicyJobsOptionsModel.BackupPolicyPlanID).To(Equal(core.StringPtr("testString")))
				Expect(listBackupPolicyJobsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listBackupPolicyJobsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listBackupPolicyJobsOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listBackupPolicyJobsOptionsModel.SourceID).To(Equal(core.StringPtr("testString")))
				Expect(listBackupPolicyJobsOptionsModel.TargetSnapshotsID).To(Equal(core.StringPtr("testString")))
				Expect(listBackupPolicyJobsOptionsModel.TargetSnapshotsCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")))
				Expect(listBackupPolicyJobsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListBackupPolicyPlansOptions successfully`, func() {
				// Construct an instance of the ListBackupPolicyPlansOptions model
				backupPolicyID := "testString"
				listBackupPolicyPlansOptionsModel := vpcService.NewListBackupPolicyPlansOptions(backupPolicyID)
				listBackupPolicyPlansOptionsModel.SetBackupPolicyID("testString")
				listBackupPolicyPlansOptionsModel.SetName("my-name")
				listBackupPolicyPlansOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listBackupPolicyPlansOptionsModel).ToNot(BeNil())
				Expect(listBackupPolicyPlansOptionsModel.BackupPolicyID).To(Equal(core.StringPtr("testString")))
				Expect(listBackupPolicyPlansOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listBackupPolicyPlansOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListBareMetalServerDisksOptions successfully`, func() {
				// Construct an instance of the ListBareMetalServerDisksOptions model
				bareMetalServerID := "testString"
				listBareMetalServerDisksOptionsModel := vpcService.NewListBareMetalServerDisksOptions(bareMetalServerID)
				listBareMetalServerDisksOptionsModel.SetBareMetalServerID("testString")
				listBareMetalServerDisksOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listBareMetalServerDisksOptionsModel).ToNot(BeNil())
				Expect(listBareMetalServerDisksOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(listBareMetalServerDisksOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListBareMetalServerNetworkAttachmentsOptions successfully`, func() {
				// Construct an instance of the ListBareMetalServerNetworkAttachmentsOptions model
				bareMetalServerID := "testString"
				listBareMetalServerNetworkAttachmentsOptionsModel := vpcService.NewListBareMetalServerNetworkAttachmentsOptions(bareMetalServerID)
				listBareMetalServerNetworkAttachmentsOptionsModel.SetBareMetalServerID("testString")
				listBareMetalServerNetworkAttachmentsOptionsModel.SetStart("testString")
				listBareMetalServerNetworkAttachmentsOptionsModel.SetLimit(int64(10))
				listBareMetalServerNetworkAttachmentsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listBareMetalServerNetworkAttachmentsOptionsModel).ToNot(BeNil())
				Expect(listBareMetalServerNetworkAttachmentsOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(listBareMetalServerNetworkAttachmentsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listBareMetalServerNetworkAttachmentsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listBareMetalServerNetworkAttachmentsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListBareMetalServerNetworkInterfaceFloatingIpsOptions successfully`, func() {
				// Construct an instance of the ListBareMetalServerNetworkInterfaceFloatingIpsOptions model
				bareMetalServerID := "testString"
				networkInterfaceID := "testString"
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel := vpcService.NewListBareMetalServerNetworkInterfaceFloatingIpsOptions(bareMetalServerID, networkInterfaceID)
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.SetBareMetalServerID("testString")
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.SetNetworkInterfaceID("testString")
				listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel).ToNot(BeNil())
				Expect(listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.NetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListBareMetalServerNetworkInterfaceIpsOptions successfully`, func() {
				// Construct an instance of the ListBareMetalServerNetworkInterfaceIpsOptions model
				bareMetalServerID := "testString"
				networkInterfaceID := "testString"
				listBareMetalServerNetworkInterfaceIpsOptionsModel := vpcService.NewListBareMetalServerNetworkInterfaceIpsOptions(bareMetalServerID, networkInterfaceID)
				listBareMetalServerNetworkInterfaceIpsOptionsModel.SetBareMetalServerID("testString")
				listBareMetalServerNetworkInterfaceIpsOptionsModel.SetNetworkInterfaceID("testString")
				listBareMetalServerNetworkInterfaceIpsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listBareMetalServerNetworkInterfaceIpsOptionsModel).ToNot(BeNil())
				Expect(listBareMetalServerNetworkInterfaceIpsOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(listBareMetalServerNetworkInterfaceIpsOptionsModel.NetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(listBareMetalServerNetworkInterfaceIpsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListBareMetalServerNetworkInterfacesOptions successfully`, func() {
				// Construct an instance of the ListBareMetalServerNetworkInterfacesOptions model
				bareMetalServerID := "testString"
				listBareMetalServerNetworkInterfacesOptionsModel := vpcService.NewListBareMetalServerNetworkInterfacesOptions(bareMetalServerID)
				listBareMetalServerNetworkInterfacesOptionsModel.SetBareMetalServerID("testString")
				listBareMetalServerNetworkInterfacesOptionsModel.SetStart("testString")
				listBareMetalServerNetworkInterfacesOptionsModel.SetLimit(int64(10))
				listBareMetalServerNetworkInterfacesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listBareMetalServerNetworkInterfacesOptionsModel).ToNot(BeNil())
				Expect(listBareMetalServerNetworkInterfacesOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(listBareMetalServerNetworkInterfacesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listBareMetalServerNetworkInterfacesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listBareMetalServerNetworkInterfacesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListBareMetalServerProfilesOptions successfully`, func() {
				// Construct an instance of the ListBareMetalServerProfilesOptions model
				listBareMetalServerProfilesOptionsModel := vpcService.NewListBareMetalServerProfilesOptions()
				listBareMetalServerProfilesOptionsModel.SetStart("testString")
				listBareMetalServerProfilesOptionsModel.SetLimit(int64(10))
				listBareMetalServerProfilesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listBareMetalServerProfilesOptionsModel).ToNot(BeNil())
				Expect(listBareMetalServerProfilesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listBareMetalServerProfilesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listBareMetalServerProfilesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListBareMetalServersOptions successfully`, func() {
				// Construct an instance of the ListBareMetalServersOptions model
				listBareMetalServersOptionsModel := vpcService.NewListBareMetalServersOptions()
				listBareMetalServersOptionsModel.SetStart("testString")
				listBareMetalServersOptionsModel.SetLimit(int64(10))
				listBareMetalServersOptionsModel.SetResourceGroupID("testString")
				listBareMetalServersOptionsModel.SetName("my-name")
				listBareMetalServersOptionsModel.SetReservationID("testString")
				listBareMetalServersOptionsModel.SetReservationCRN("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				listBareMetalServersOptionsModel.SetReservationName("my-reservation")
				listBareMetalServersOptionsModel.SetVPCID("testString")
				listBareMetalServersOptionsModel.SetVPCCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listBareMetalServersOptionsModel.SetVPCName("my-vpc")
				listBareMetalServersOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listBareMetalServersOptionsModel).ToNot(BeNil())
				Expect(listBareMetalServersOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listBareMetalServersOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listBareMetalServersOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listBareMetalServersOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listBareMetalServersOptionsModel.ReservationID).To(Equal(core.StringPtr("testString")))
				Expect(listBareMetalServersOptionsModel.ReservationCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")))
				Expect(listBareMetalServersOptionsModel.ReservationName).To(Equal(core.StringPtr("my-reservation")))
				Expect(listBareMetalServersOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(listBareMetalServersOptionsModel.VPCCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))
				Expect(listBareMetalServersOptionsModel.VPCName).To(Equal(core.StringPtr("my-vpc")))
				Expect(listBareMetalServersOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListClusterNetworkInterfacesOptions successfully`, func() {
				// Construct an instance of the ListClusterNetworkInterfacesOptions model
				clusterNetworkID := "testString"
				listClusterNetworkInterfacesOptionsModel := vpcService.NewListClusterNetworkInterfacesOptions(clusterNetworkID)
				listClusterNetworkInterfacesOptionsModel.SetClusterNetworkID("testString")
				listClusterNetworkInterfacesOptionsModel.SetStart("testString")
				listClusterNetworkInterfacesOptionsModel.SetLimit(int64(10))
				listClusterNetworkInterfacesOptionsModel.SetName("my-name")
				listClusterNetworkInterfacesOptionsModel.SetSort("name")
				listClusterNetworkInterfacesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listClusterNetworkInterfacesOptionsModel).ToNot(BeNil())
				Expect(listClusterNetworkInterfacesOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(listClusterNetworkInterfacesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listClusterNetworkInterfacesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listClusterNetworkInterfacesOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listClusterNetworkInterfacesOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listClusterNetworkInterfacesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListClusterNetworkProfilesOptions successfully`, func() {
				// Construct an instance of the ListClusterNetworkProfilesOptions model
				listClusterNetworkProfilesOptionsModel := vpcService.NewListClusterNetworkProfilesOptions()
				listClusterNetworkProfilesOptionsModel.SetStart("testString")
				listClusterNetworkProfilesOptionsModel.SetLimit(int64(10))
				listClusterNetworkProfilesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listClusterNetworkProfilesOptionsModel).ToNot(BeNil())
				Expect(listClusterNetworkProfilesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listClusterNetworkProfilesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listClusterNetworkProfilesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListClusterNetworkSubnetReservedIpsOptions successfully`, func() {
				// Construct an instance of the ListClusterNetworkSubnetReservedIpsOptions model
				clusterNetworkID := "testString"
				clusterNetworkSubnetID := "testString"
				listClusterNetworkSubnetReservedIpsOptionsModel := vpcService.NewListClusterNetworkSubnetReservedIpsOptions(clusterNetworkID, clusterNetworkSubnetID)
				listClusterNetworkSubnetReservedIpsOptionsModel.SetClusterNetworkID("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.SetClusterNetworkSubnetID("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.SetStart("testString")
				listClusterNetworkSubnetReservedIpsOptionsModel.SetLimit(int64(10))
				listClusterNetworkSubnetReservedIpsOptionsModel.SetName("my-name")
				listClusterNetworkSubnetReservedIpsOptionsModel.SetSort("name")
				listClusterNetworkSubnetReservedIpsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listClusterNetworkSubnetReservedIpsOptionsModel).ToNot(BeNil())
				Expect(listClusterNetworkSubnetReservedIpsOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(listClusterNetworkSubnetReservedIpsOptionsModel.ClusterNetworkSubnetID).To(Equal(core.StringPtr("testString")))
				Expect(listClusterNetworkSubnetReservedIpsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listClusterNetworkSubnetReservedIpsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listClusterNetworkSubnetReservedIpsOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listClusterNetworkSubnetReservedIpsOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listClusterNetworkSubnetReservedIpsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListClusterNetworkSubnetsOptions successfully`, func() {
				// Construct an instance of the ListClusterNetworkSubnetsOptions model
				clusterNetworkID := "testString"
				listClusterNetworkSubnetsOptionsModel := vpcService.NewListClusterNetworkSubnetsOptions(clusterNetworkID)
				listClusterNetworkSubnetsOptionsModel.SetClusterNetworkID("testString")
				listClusterNetworkSubnetsOptionsModel.SetStart("testString")
				listClusterNetworkSubnetsOptionsModel.SetLimit(int64(10))
				listClusterNetworkSubnetsOptionsModel.SetName("my-name")
				listClusterNetworkSubnetsOptionsModel.SetSort("name")
				listClusterNetworkSubnetsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listClusterNetworkSubnetsOptionsModel).ToNot(BeNil())
				Expect(listClusterNetworkSubnetsOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(listClusterNetworkSubnetsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listClusterNetworkSubnetsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listClusterNetworkSubnetsOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listClusterNetworkSubnetsOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listClusterNetworkSubnetsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListClusterNetworksOptions successfully`, func() {
				// Construct an instance of the ListClusterNetworksOptions model
				listClusterNetworksOptionsModel := vpcService.NewListClusterNetworksOptions()
				listClusterNetworksOptionsModel.SetStart("testString")
				listClusterNetworksOptionsModel.SetLimit(int64(10))
				listClusterNetworksOptionsModel.SetResourceGroupID("testString")
				listClusterNetworksOptionsModel.SetName("my-name")
				listClusterNetworksOptionsModel.SetSort("name")
				listClusterNetworksOptionsModel.SetVPCID("testString")
				listClusterNetworksOptionsModel.SetVPCCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listClusterNetworksOptionsModel.SetVPCName("my-vpc")
				listClusterNetworksOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listClusterNetworksOptionsModel).ToNot(BeNil())
				Expect(listClusterNetworksOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listClusterNetworksOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listClusterNetworksOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listClusterNetworksOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listClusterNetworksOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listClusterNetworksOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(listClusterNetworksOptionsModel.VPCCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))
				Expect(listClusterNetworksOptionsModel.VPCName).To(Equal(core.StringPtr("my-vpc")))
				Expect(listClusterNetworksOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListDedicatedHostDisksOptions successfully`, func() {
				// Construct an instance of the ListDedicatedHostDisksOptions model
				dedicatedHostID := "testString"
				listDedicatedHostDisksOptionsModel := vpcService.NewListDedicatedHostDisksOptions(dedicatedHostID)
				listDedicatedHostDisksOptionsModel.SetDedicatedHostID("testString")
				listDedicatedHostDisksOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listDedicatedHostDisksOptionsModel).ToNot(BeNil())
				Expect(listDedicatedHostDisksOptionsModel.DedicatedHostID).To(Equal(core.StringPtr("testString")))
				Expect(listDedicatedHostDisksOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListDedicatedHostGroupsOptions successfully`, func() {
				// Construct an instance of the ListDedicatedHostGroupsOptions model
				listDedicatedHostGroupsOptionsModel := vpcService.NewListDedicatedHostGroupsOptions()
				listDedicatedHostGroupsOptionsModel.SetStart("testString")
				listDedicatedHostGroupsOptionsModel.SetLimit(int64(10))
				listDedicatedHostGroupsOptionsModel.SetResourceGroupID("testString")
				listDedicatedHostGroupsOptionsModel.SetZoneName("us-south-1")
				listDedicatedHostGroupsOptionsModel.SetName("my-name")
				listDedicatedHostGroupsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listDedicatedHostGroupsOptionsModel).ToNot(BeNil())
				Expect(listDedicatedHostGroupsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listDedicatedHostGroupsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listDedicatedHostGroupsOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listDedicatedHostGroupsOptionsModel.ZoneName).To(Equal(core.StringPtr("us-south-1")))
				Expect(listDedicatedHostGroupsOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listDedicatedHostGroupsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListDedicatedHostProfilesOptions successfully`, func() {
				// Construct an instance of the ListDedicatedHostProfilesOptions model
				listDedicatedHostProfilesOptionsModel := vpcService.NewListDedicatedHostProfilesOptions()
				listDedicatedHostProfilesOptionsModel.SetStart("testString")
				listDedicatedHostProfilesOptionsModel.SetLimit(int64(10))
				listDedicatedHostProfilesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listDedicatedHostProfilesOptionsModel).ToNot(BeNil())
				Expect(listDedicatedHostProfilesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listDedicatedHostProfilesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listDedicatedHostProfilesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListDedicatedHostsOptions successfully`, func() {
				// Construct an instance of the ListDedicatedHostsOptions model
				listDedicatedHostsOptionsModel := vpcService.NewListDedicatedHostsOptions()
				listDedicatedHostsOptionsModel.SetDedicatedHostGroupID("testString")
				listDedicatedHostsOptionsModel.SetStart("testString")
				listDedicatedHostsOptionsModel.SetLimit(int64(10))
				listDedicatedHostsOptionsModel.SetResourceGroupID("testString")
				listDedicatedHostsOptionsModel.SetZoneName("us-south-1")
				listDedicatedHostsOptionsModel.SetName("my-name")
				listDedicatedHostsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listDedicatedHostsOptionsModel).ToNot(BeNil())
				Expect(listDedicatedHostsOptionsModel.DedicatedHostGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listDedicatedHostsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listDedicatedHostsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listDedicatedHostsOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listDedicatedHostsOptionsModel.ZoneName).To(Equal(core.StringPtr("us-south-1")))
				Expect(listDedicatedHostsOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listDedicatedHostsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListEndpointGatewayIpsOptions successfully`, func() {
				// Construct an instance of the ListEndpointGatewayIpsOptions model
				endpointGatewayID := "testString"
				listEndpointGatewayIpsOptionsModel := vpcService.NewListEndpointGatewayIpsOptions(endpointGatewayID)
				listEndpointGatewayIpsOptionsModel.SetEndpointGatewayID("testString")
				listEndpointGatewayIpsOptionsModel.SetStart("testString")
				listEndpointGatewayIpsOptionsModel.SetLimit(int64(10))
				listEndpointGatewayIpsOptionsModel.SetSort("name")
				listEndpointGatewayIpsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listEndpointGatewayIpsOptionsModel).ToNot(BeNil())
				Expect(listEndpointGatewayIpsOptionsModel.EndpointGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(listEndpointGatewayIpsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listEndpointGatewayIpsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listEndpointGatewayIpsOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listEndpointGatewayIpsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListEndpointGatewayResourceBindingsOptions successfully`, func() {
				// Construct an instance of the ListEndpointGatewayResourceBindingsOptions model
				endpointGatewayID := "testString"
				listEndpointGatewayResourceBindingsOptionsModel := vpcService.NewListEndpointGatewayResourceBindingsOptions(endpointGatewayID)
				listEndpointGatewayResourceBindingsOptionsModel.SetEndpointGatewayID("testString")
				listEndpointGatewayResourceBindingsOptionsModel.SetStart("testString")
				listEndpointGatewayResourceBindingsOptionsModel.SetLimit(int64(10))
				listEndpointGatewayResourceBindingsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listEndpointGatewayResourceBindingsOptionsModel).ToNot(BeNil())
				Expect(listEndpointGatewayResourceBindingsOptionsModel.EndpointGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(listEndpointGatewayResourceBindingsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listEndpointGatewayResourceBindingsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listEndpointGatewayResourceBindingsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListEndpointGatewaysOptions successfully`, func() {
				// Construct an instance of the ListEndpointGatewaysOptions model
				listEndpointGatewaysOptionsModel := vpcService.NewListEndpointGatewaysOptions()
				listEndpointGatewaysOptionsModel.SetAllowResourceBinding(true)
				listEndpointGatewaysOptionsModel.SetName("my-name")
				listEndpointGatewaysOptionsModel.SetStart("testString")
				listEndpointGatewaysOptionsModel.SetLimit(int64(10))
				listEndpointGatewaysOptionsModel.SetResourceGroupID("testString")
				listEndpointGatewaysOptionsModel.SetLifecycleState([]string{"stable"})
				listEndpointGatewaysOptionsModel.SetVPCID("testString")
				listEndpointGatewaysOptionsModel.SetVPCCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listEndpointGatewaysOptionsModel.SetVPCName("my-vpc")
				listEndpointGatewaysOptionsModel.SetAllowDnsResolutionBinding(true)
				listEndpointGatewaysOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listEndpointGatewaysOptionsModel).ToNot(BeNil())
				Expect(listEndpointGatewaysOptionsModel.AllowResourceBinding).To(Equal(core.BoolPtr(true)))
				Expect(listEndpointGatewaysOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listEndpointGatewaysOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listEndpointGatewaysOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listEndpointGatewaysOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listEndpointGatewaysOptionsModel.LifecycleState).To(Equal([]string{"stable"}))
				Expect(listEndpointGatewaysOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(listEndpointGatewaysOptionsModel.VPCCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))
				Expect(listEndpointGatewaysOptionsModel.VPCName).To(Equal(core.StringPtr("my-vpc")))
				Expect(listEndpointGatewaysOptionsModel.AllowDnsResolutionBinding).To(Equal(core.BoolPtr(true)))
				Expect(listEndpointGatewaysOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListFloatingIpsOptions successfully`, func() {
				// Construct an instance of the ListFloatingIpsOptions model
				listFloatingIpsOptionsModel := vpcService.NewListFloatingIpsOptions()
				listFloatingIpsOptionsModel.SetStart("testString")
				listFloatingIpsOptionsModel.SetLimit(int64(10))
				listFloatingIpsOptionsModel.SetResourceGroupID("testString")
				listFloatingIpsOptionsModel.SetSort("name")
				listFloatingIpsOptionsModel.SetTargetID("testString")
				listFloatingIpsOptionsModel.SetTargetCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
				listFloatingIpsOptionsModel.SetTargetName("my-resource")
				listFloatingIpsOptionsModel.SetTargetResourceType("testString")
				listFloatingIpsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listFloatingIpsOptionsModel).ToNot(BeNil())
				Expect(listFloatingIpsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listFloatingIpsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listFloatingIpsOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listFloatingIpsOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listFloatingIpsOptionsModel.TargetID).To(Equal(core.StringPtr("testString")))
				Expect(listFloatingIpsOptionsModel.TargetCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")))
				Expect(listFloatingIpsOptionsModel.TargetName).To(Equal(core.StringPtr("my-resource")))
				Expect(listFloatingIpsOptionsModel.TargetResourceType).To(Equal(core.StringPtr("testString")))
				Expect(listFloatingIpsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListFlowLogCollectorsOptions successfully`, func() {
				// Construct an instance of the ListFlowLogCollectorsOptions model
				listFlowLogCollectorsOptionsModel := vpcService.NewListFlowLogCollectorsOptions()
				listFlowLogCollectorsOptionsModel.SetStart("testString")
				listFlowLogCollectorsOptionsModel.SetLimit(int64(10))
				listFlowLogCollectorsOptionsModel.SetResourceGroupID("testString")
				listFlowLogCollectorsOptionsModel.SetName("my-name")
				listFlowLogCollectorsOptionsModel.SetVPCID("testString")
				listFlowLogCollectorsOptionsModel.SetVPCCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listFlowLogCollectorsOptionsModel.SetVPCName("my-vpc")
				listFlowLogCollectorsOptionsModel.SetTargetID("testString")
				listFlowLogCollectorsOptionsModel.SetTargetResourceType("testString")
				listFlowLogCollectorsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listFlowLogCollectorsOptionsModel).ToNot(BeNil())
				Expect(listFlowLogCollectorsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listFlowLogCollectorsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listFlowLogCollectorsOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listFlowLogCollectorsOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listFlowLogCollectorsOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(listFlowLogCollectorsOptionsModel.VPCCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))
				Expect(listFlowLogCollectorsOptionsModel.VPCName).To(Equal(core.StringPtr("my-vpc")))
				Expect(listFlowLogCollectorsOptionsModel.TargetID).To(Equal(core.StringPtr("testString")))
				Expect(listFlowLogCollectorsOptionsModel.TargetResourceType).To(Equal(core.StringPtr("testString")))
				Expect(listFlowLogCollectorsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListIkePoliciesOptions successfully`, func() {
				// Construct an instance of the ListIkePoliciesOptions model
				listIkePoliciesOptionsModel := vpcService.NewListIkePoliciesOptions()
				listIkePoliciesOptionsModel.SetStart("testString")
				listIkePoliciesOptionsModel.SetLimit(int64(10))
				listIkePoliciesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listIkePoliciesOptionsModel).ToNot(BeNil())
				Expect(listIkePoliciesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listIkePoliciesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listIkePoliciesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListIkePolicyConnectionsOptions successfully`, func() {
				// Construct an instance of the ListIkePolicyConnectionsOptions model
				id := "testString"
				listIkePolicyConnectionsOptionsModel := vpcService.NewListIkePolicyConnectionsOptions(id)
				listIkePolicyConnectionsOptionsModel.SetID("testString")
				listIkePolicyConnectionsOptionsModel.SetStart("testString")
				listIkePolicyConnectionsOptionsModel.SetLimit(int64(10))
				listIkePolicyConnectionsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listIkePolicyConnectionsOptionsModel).ToNot(BeNil())
				Expect(listIkePolicyConnectionsOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(listIkePolicyConnectionsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listIkePolicyConnectionsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listIkePolicyConnectionsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListImageBareMetalServerProfilesOptions successfully`, func() {
				// Construct an instance of the ListImageBareMetalServerProfilesOptions model
				id := "testString"
				listImageBareMetalServerProfilesOptionsModel := vpcService.NewListImageBareMetalServerProfilesOptions(id)
				listImageBareMetalServerProfilesOptionsModel.SetID("testString")
				listImageBareMetalServerProfilesOptionsModel.SetStart("testString")
				listImageBareMetalServerProfilesOptionsModel.SetLimit(int64(10))
				listImageBareMetalServerProfilesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listImageBareMetalServerProfilesOptionsModel).ToNot(BeNil())
				Expect(listImageBareMetalServerProfilesOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(listImageBareMetalServerProfilesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listImageBareMetalServerProfilesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listImageBareMetalServerProfilesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListImageExportJobsOptions successfully`, func() {
				// Construct an instance of the ListImageExportJobsOptions model
				imageID := "testString"
				listImageExportJobsOptionsModel := vpcService.NewListImageExportJobsOptions(imageID)
				listImageExportJobsOptionsModel.SetImageID("testString")
				listImageExportJobsOptionsModel.SetName("my-name")
				listImageExportJobsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listImageExportJobsOptionsModel).ToNot(BeNil())
				Expect(listImageExportJobsOptionsModel.ImageID).To(Equal(core.StringPtr("testString")))
				Expect(listImageExportJobsOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listImageExportJobsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListImageInstanceProfilesOptions successfully`, func() {
				// Construct an instance of the ListImageInstanceProfilesOptions model
				id := "testString"
				listImageInstanceProfilesOptionsModel := vpcService.NewListImageInstanceProfilesOptions(id)
				listImageInstanceProfilesOptionsModel.SetID("testString")
				listImageInstanceProfilesOptionsModel.SetStart("testString")
				listImageInstanceProfilesOptionsModel.SetLimit(int64(10))
				listImageInstanceProfilesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listImageInstanceProfilesOptionsModel).ToNot(BeNil())
				Expect(listImageInstanceProfilesOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(listImageInstanceProfilesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listImageInstanceProfilesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listImageInstanceProfilesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListImagesOptions successfully`, func() {
				// Construct an instance of the ListImagesOptions model
				listImagesOptionsModel := vpcService.NewListImagesOptions()
				listImagesOptionsModel.SetStart("testString")
				listImagesOptionsModel.SetLimit(int64(10))
				listImagesOptionsModel.SetResourceGroupID("testString")
				listImagesOptionsModel.SetName("my-name")
				listImagesOptionsModel.SetStatus([]string{"available"})
				listImagesOptionsModel.SetVisibility("private")
				listImagesOptionsModel.SetUserDataFormat([]string{"cloud_init"})
				listImagesOptionsModel.SetRemoteAccountID("bb1b52262f7441a586f49068482f1e60")
				listImagesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listImagesOptionsModel).ToNot(BeNil())
				Expect(listImagesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listImagesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listImagesOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listImagesOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listImagesOptionsModel.Status).To(Equal([]string{"available"}))
				Expect(listImagesOptionsModel.Visibility).To(Equal(core.StringPtr("private")))
				Expect(listImagesOptionsModel.UserDataFormat).To(Equal([]string{"cloud_init"}))
				Expect(listImagesOptionsModel.RemoteAccountID).To(Equal(core.StringPtr("bb1b52262f7441a586f49068482f1e60")))
				Expect(listImagesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstanceClusterNetworkAttachmentsOptions successfully`, func() {
				// Construct an instance of the ListInstanceClusterNetworkAttachmentsOptions model
				instanceID := "testString"
				listInstanceClusterNetworkAttachmentsOptionsModel := vpcService.NewListInstanceClusterNetworkAttachmentsOptions(instanceID)
				listInstanceClusterNetworkAttachmentsOptionsModel.SetInstanceID("testString")
				listInstanceClusterNetworkAttachmentsOptionsModel.SetStart("testString")
				listInstanceClusterNetworkAttachmentsOptionsModel.SetLimit(int64(10))
				listInstanceClusterNetworkAttachmentsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstanceClusterNetworkAttachmentsOptionsModel).ToNot(BeNil())
				Expect(listInstanceClusterNetworkAttachmentsOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceClusterNetworkAttachmentsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceClusterNetworkAttachmentsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listInstanceClusterNetworkAttachmentsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstanceDisksOptions successfully`, func() {
				// Construct an instance of the ListInstanceDisksOptions model
				instanceID := "testString"
				listInstanceDisksOptionsModel := vpcService.NewListInstanceDisksOptions(instanceID)
				listInstanceDisksOptionsModel.SetInstanceID("testString")
				listInstanceDisksOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstanceDisksOptionsModel).ToNot(BeNil())
				Expect(listInstanceDisksOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceDisksOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstanceGroupManagerActionsOptions successfully`, func() {
				// Construct an instance of the ListInstanceGroupManagerActionsOptions model
				instanceGroupID := "testString"
				instanceGroupManagerID := "testString"
				listInstanceGroupManagerActionsOptionsModel := vpcService.NewListInstanceGroupManagerActionsOptions(instanceGroupID, instanceGroupManagerID)
				listInstanceGroupManagerActionsOptionsModel.SetInstanceGroupID("testString")
				listInstanceGroupManagerActionsOptionsModel.SetInstanceGroupManagerID("testString")
				listInstanceGroupManagerActionsOptionsModel.SetStart("testString")
				listInstanceGroupManagerActionsOptionsModel.SetLimit(int64(10))
				listInstanceGroupManagerActionsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstanceGroupManagerActionsOptionsModel).ToNot(BeNil())
				Expect(listInstanceGroupManagerActionsOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceGroupManagerActionsOptionsModel.InstanceGroupManagerID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceGroupManagerActionsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceGroupManagerActionsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listInstanceGroupManagerActionsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstanceGroupManagerPoliciesOptions successfully`, func() {
				// Construct an instance of the ListInstanceGroupManagerPoliciesOptions model
				instanceGroupID := "testString"
				instanceGroupManagerID := "testString"
				listInstanceGroupManagerPoliciesOptionsModel := vpcService.NewListInstanceGroupManagerPoliciesOptions(instanceGroupID, instanceGroupManagerID)
				listInstanceGroupManagerPoliciesOptionsModel.SetInstanceGroupID("testString")
				listInstanceGroupManagerPoliciesOptionsModel.SetInstanceGroupManagerID("testString")
				listInstanceGroupManagerPoliciesOptionsModel.SetStart("testString")
				listInstanceGroupManagerPoliciesOptionsModel.SetLimit(int64(10))
				listInstanceGroupManagerPoliciesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstanceGroupManagerPoliciesOptionsModel).ToNot(BeNil())
				Expect(listInstanceGroupManagerPoliciesOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceGroupManagerPoliciesOptionsModel.InstanceGroupManagerID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceGroupManagerPoliciesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceGroupManagerPoliciesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listInstanceGroupManagerPoliciesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstanceGroupManagersOptions successfully`, func() {
				// Construct an instance of the ListInstanceGroupManagersOptions model
				instanceGroupID := "testString"
				listInstanceGroupManagersOptionsModel := vpcService.NewListInstanceGroupManagersOptions(instanceGroupID)
				listInstanceGroupManagersOptionsModel.SetInstanceGroupID("testString")
				listInstanceGroupManagersOptionsModel.SetStart("testString")
				listInstanceGroupManagersOptionsModel.SetLimit(int64(10))
				listInstanceGroupManagersOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstanceGroupManagersOptionsModel).ToNot(BeNil())
				Expect(listInstanceGroupManagersOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceGroupManagersOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceGroupManagersOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listInstanceGroupManagersOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstanceGroupMembershipsOptions successfully`, func() {
				// Construct an instance of the ListInstanceGroupMembershipsOptions model
				instanceGroupID := "testString"
				listInstanceGroupMembershipsOptionsModel := vpcService.NewListInstanceGroupMembershipsOptions(instanceGroupID)
				listInstanceGroupMembershipsOptionsModel.SetInstanceGroupID("testString")
				listInstanceGroupMembershipsOptionsModel.SetStart("testString")
				listInstanceGroupMembershipsOptionsModel.SetLimit(int64(10))
				listInstanceGroupMembershipsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstanceGroupMembershipsOptionsModel).ToNot(BeNil())
				Expect(listInstanceGroupMembershipsOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceGroupMembershipsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceGroupMembershipsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listInstanceGroupMembershipsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstanceGroupsOptions successfully`, func() {
				// Construct an instance of the ListInstanceGroupsOptions model
				listInstanceGroupsOptionsModel := vpcService.NewListInstanceGroupsOptions()
				listInstanceGroupsOptionsModel.SetStart("testString")
				listInstanceGroupsOptionsModel.SetLimit(int64(10))
				listInstanceGroupsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstanceGroupsOptionsModel).ToNot(BeNil())
				Expect(listInstanceGroupsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceGroupsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listInstanceGroupsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstanceNetworkAttachmentsOptions successfully`, func() {
				// Construct an instance of the ListInstanceNetworkAttachmentsOptions model
				instanceID := "testString"
				listInstanceNetworkAttachmentsOptionsModel := vpcService.NewListInstanceNetworkAttachmentsOptions(instanceID)
				listInstanceNetworkAttachmentsOptionsModel.SetInstanceID("testString")
				listInstanceNetworkAttachmentsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstanceNetworkAttachmentsOptionsModel).ToNot(BeNil())
				Expect(listInstanceNetworkAttachmentsOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceNetworkAttachmentsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstanceNetworkInterfaceFloatingIpsOptions successfully`, func() {
				// Construct an instance of the ListInstanceNetworkInterfaceFloatingIpsOptions model
				instanceID := "testString"
				networkInterfaceID := "testString"
				listInstanceNetworkInterfaceFloatingIpsOptionsModel := vpcService.NewListInstanceNetworkInterfaceFloatingIpsOptions(instanceID, networkInterfaceID)
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.SetInstanceID("testString")
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.SetNetworkInterfaceID("testString")
				listInstanceNetworkInterfaceFloatingIpsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstanceNetworkInterfaceFloatingIpsOptionsModel).ToNot(BeNil())
				Expect(listInstanceNetworkInterfaceFloatingIpsOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceNetworkInterfaceFloatingIpsOptionsModel.NetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceNetworkInterfaceFloatingIpsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstanceNetworkInterfaceIpsOptions successfully`, func() {
				// Construct an instance of the ListInstanceNetworkInterfaceIpsOptions model
				instanceID := "testString"
				networkInterfaceID := "testString"
				listInstanceNetworkInterfaceIpsOptionsModel := vpcService.NewListInstanceNetworkInterfaceIpsOptions(instanceID, networkInterfaceID)
				listInstanceNetworkInterfaceIpsOptionsModel.SetInstanceID("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.SetNetworkInterfaceID("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.SetStart("testString")
				listInstanceNetworkInterfaceIpsOptionsModel.SetLimit(int64(10))
				listInstanceNetworkInterfaceIpsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstanceNetworkInterfaceIpsOptionsModel).ToNot(BeNil())
				Expect(listInstanceNetworkInterfaceIpsOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceNetworkInterfaceIpsOptionsModel.NetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceNetworkInterfaceIpsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceNetworkInterfaceIpsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listInstanceNetworkInterfaceIpsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstanceNetworkInterfacesOptions successfully`, func() {
				// Construct an instance of the ListInstanceNetworkInterfacesOptions model
				instanceID := "testString"
				listInstanceNetworkInterfacesOptionsModel := vpcService.NewListInstanceNetworkInterfacesOptions(instanceID)
				listInstanceNetworkInterfacesOptionsModel.SetInstanceID("testString")
				listInstanceNetworkInterfacesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstanceNetworkInterfacesOptionsModel).ToNot(BeNil())
				Expect(listInstanceNetworkInterfacesOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceNetworkInterfacesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstanceProfilesOptions successfully`, func() {
				// Construct an instance of the ListInstanceProfilesOptions model
				listInstanceProfilesOptionsModel := vpcService.NewListInstanceProfilesOptions()
				listInstanceProfilesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstanceProfilesOptionsModel).ToNot(BeNil())
				Expect(listInstanceProfilesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstanceTemplatesOptions successfully`, func() {
				// Construct an instance of the ListInstanceTemplatesOptions model
				listInstanceTemplatesOptionsModel := vpcService.NewListInstanceTemplatesOptions()
				listInstanceTemplatesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstanceTemplatesOptionsModel).ToNot(BeNil())
				Expect(listInstanceTemplatesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstanceVolumeAttachmentsOptions successfully`, func() {
				// Construct an instance of the ListInstanceVolumeAttachmentsOptions model
				instanceID := "testString"
				listInstanceVolumeAttachmentsOptionsModel := vpcService.NewListInstanceVolumeAttachmentsOptions(instanceID)
				listInstanceVolumeAttachmentsOptionsModel.SetInstanceID("testString")
				listInstanceVolumeAttachmentsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstanceVolumeAttachmentsOptionsModel).ToNot(BeNil())
				Expect(listInstanceVolumeAttachmentsOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(listInstanceVolumeAttachmentsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListInstancesOptions successfully`, func() {
				// Construct an instance of the ListInstancesOptions model
				listInstancesOptionsModel := vpcService.NewListInstancesOptions()
				listInstancesOptionsModel.SetStart("testString")
				listInstancesOptionsModel.SetLimit(int64(10))
				listInstancesOptionsModel.SetResourceGroupID("testString")
				listInstancesOptionsModel.SetName("my-name")
				listInstancesOptionsModel.SetClusterNetworkID("testString")
				listInstancesOptionsModel.SetClusterNetworkCRN("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573")
				listInstancesOptionsModel.SetClusterNetworkName("my-cluster-network")
				listInstancesOptionsModel.SetDedicatedHostID("testString")
				listInstancesOptionsModel.SetDedicatedHostCRN("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
				listInstancesOptionsModel.SetDedicatedHostName("my-dedicated-host")
				listInstancesOptionsModel.SetInstanceGroupMembershipInstanceGroupID("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60")
				listInstancesOptionsModel.SetInstanceGroupMembershipInstanceGroupCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60")
				listInstancesOptionsModel.SetPlacementGroupID("testString")
				listInstancesOptionsModel.SetPlacementGroupCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871")
				listInstancesOptionsModel.SetPlacementGroupName("my-placement-group")
				listInstancesOptionsModel.SetReservationAffinityPolicy("automatic")
				listInstancesOptionsModel.SetReservationID("testString")
				listInstancesOptionsModel.SetReservationCRN("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
				listInstancesOptionsModel.SetReservationName("my-reservation")
				listInstancesOptionsModel.SetVPCID("testString")
				listInstancesOptionsModel.SetVPCCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listInstancesOptionsModel.SetVPCName("my-vpc")
				listInstancesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listInstancesOptionsModel).ToNot(BeNil())
				Expect(listInstancesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listInstancesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listInstancesOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listInstancesOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listInstancesOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(listInstancesOptionsModel.ClusterNetworkCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573")))
				Expect(listInstancesOptionsModel.ClusterNetworkName).To(Equal(core.StringPtr("my-cluster-network")))
				Expect(listInstancesOptionsModel.DedicatedHostID).To(Equal(core.StringPtr("testString")))
				Expect(listInstancesOptionsModel.DedicatedHostCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a")))
				Expect(listInstancesOptionsModel.DedicatedHostName).To(Equal(core.StringPtr("my-dedicated-host")))
				Expect(listInstancesOptionsModel.InstanceGroupMembershipInstanceGroupID).To(Equal(core.StringPtr("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60")))
				Expect(listInstancesOptionsModel.InstanceGroupMembershipInstanceGroupCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60")))
				Expect(listInstancesOptionsModel.PlacementGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listInstancesOptionsModel.PlacementGroupCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871")))
				Expect(listInstancesOptionsModel.PlacementGroupName).To(Equal(core.StringPtr("my-placement-group")))
				Expect(listInstancesOptionsModel.ReservationAffinityPolicy).To(Equal(core.StringPtr("automatic")))
				Expect(listInstancesOptionsModel.ReservationID).To(Equal(core.StringPtr("testString")))
				Expect(listInstancesOptionsModel.ReservationCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")))
				Expect(listInstancesOptionsModel.ReservationName).To(Equal(core.StringPtr("my-reservation")))
				Expect(listInstancesOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(listInstancesOptionsModel.VPCCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))
				Expect(listInstancesOptionsModel.VPCName).To(Equal(core.StringPtr("my-vpc")))
				Expect(listInstancesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListIpsecPoliciesOptions successfully`, func() {
				// Construct an instance of the ListIpsecPoliciesOptions model
				listIpsecPoliciesOptionsModel := vpcService.NewListIpsecPoliciesOptions()
				listIpsecPoliciesOptionsModel.SetStart("testString")
				listIpsecPoliciesOptionsModel.SetLimit(int64(10))
				listIpsecPoliciesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listIpsecPoliciesOptionsModel).ToNot(BeNil())
				Expect(listIpsecPoliciesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listIpsecPoliciesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listIpsecPoliciesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListIpsecPolicyConnectionsOptions successfully`, func() {
				// Construct an instance of the ListIpsecPolicyConnectionsOptions model
				id := "testString"
				listIpsecPolicyConnectionsOptionsModel := vpcService.NewListIpsecPolicyConnectionsOptions(id)
				listIpsecPolicyConnectionsOptionsModel.SetID("testString")
				listIpsecPolicyConnectionsOptionsModel.SetStart("testString")
				listIpsecPolicyConnectionsOptionsModel.SetLimit(int64(10))
				listIpsecPolicyConnectionsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listIpsecPolicyConnectionsOptionsModel).ToNot(BeNil())
				Expect(listIpsecPolicyConnectionsOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(listIpsecPolicyConnectionsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listIpsecPolicyConnectionsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listIpsecPolicyConnectionsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListKeysOptions successfully`, func() {
				// Construct an instance of the ListKeysOptions model
				listKeysOptionsModel := vpcService.NewListKeysOptions()
				listKeysOptionsModel.SetStart("testString")
				listKeysOptionsModel.SetLimit(int64(10))
				listKeysOptionsModel.SetResourceGroupID("testString")
				listKeysOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listKeysOptionsModel).ToNot(BeNil())
				Expect(listKeysOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listKeysOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listKeysOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listKeysOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListLoadBalancerListenerPoliciesOptions successfully`, func() {
				// Construct an instance of the ListLoadBalancerListenerPoliciesOptions model
				loadBalancerID := "testString"
				listenerID := "testString"
				listLoadBalancerListenerPoliciesOptionsModel := vpcService.NewListLoadBalancerListenerPoliciesOptions(loadBalancerID, listenerID)
				listLoadBalancerListenerPoliciesOptionsModel.SetLoadBalancerID("testString")
				listLoadBalancerListenerPoliciesOptionsModel.SetListenerID("testString")
				listLoadBalancerListenerPoliciesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listLoadBalancerListenerPoliciesOptionsModel).ToNot(BeNil())
				Expect(listLoadBalancerListenerPoliciesOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(listLoadBalancerListenerPoliciesOptionsModel.ListenerID).To(Equal(core.StringPtr("testString")))
				Expect(listLoadBalancerListenerPoliciesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListLoadBalancerListenerPolicyRulesOptions successfully`, func() {
				// Construct an instance of the ListLoadBalancerListenerPolicyRulesOptions model
				loadBalancerID := "testString"
				listenerID := "testString"
				policyID := "testString"
				listLoadBalancerListenerPolicyRulesOptionsModel := vpcService.NewListLoadBalancerListenerPolicyRulesOptions(loadBalancerID, listenerID, policyID)
				listLoadBalancerListenerPolicyRulesOptionsModel.SetLoadBalancerID("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.SetListenerID("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.SetPolicyID("testString")
				listLoadBalancerListenerPolicyRulesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listLoadBalancerListenerPolicyRulesOptionsModel).ToNot(BeNil())
				Expect(listLoadBalancerListenerPolicyRulesOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(listLoadBalancerListenerPolicyRulesOptionsModel.ListenerID).To(Equal(core.StringPtr("testString")))
				Expect(listLoadBalancerListenerPolicyRulesOptionsModel.PolicyID).To(Equal(core.StringPtr("testString")))
				Expect(listLoadBalancerListenerPolicyRulesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListLoadBalancerListenersOptions successfully`, func() {
				// Construct an instance of the ListLoadBalancerListenersOptions model
				loadBalancerID := "testString"
				listLoadBalancerListenersOptionsModel := vpcService.NewListLoadBalancerListenersOptions(loadBalancerID)
				listLoadBalancerListenersOptionsModel.SetLoadBalancerID("testString")
				listLoadBalancerListenersOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listLoadBalancerListenersOptionsModel).ToNot(BeNil())
				Expect(listLoadBalancerListenersOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(listLoadBalancerListenersOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListLoadBalancerPoolMembersOptions successfully`, func() {
				// Construct an instance of the ListLoadBalancerPoolMembersOptions model
				loadBalancerID := "testString"
				poolID := "testString"
				listLoadBalancerPoolMembersOptionsModel := vpcService.NewListLoadBalancerPoolMembersOptions(loadBalancerID, poolID)
				listLoadBalancerPoolMembersOptionsModel.SetLoadBalancerID("testString")
				listLoadBalancerPoolMembersOptionsModel.SetPoolID("testString")
				listLoadBalancerPoolMembersOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listLoadBalancerPoolMembersOptionsModel).ToNot(BeNil())
				Expect(listLoadBalancerPoolMembersOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(listLoadBalancerPoolMembersOptionsModel.PoolID).To(Equal(core.StringPtr("testString")))
				Expect(listLoadBalancerPoolMembersOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListLoadBalancerPoolsOptions successfully`, func() {
				// Construct an instance of the ListLoadBalancerPoolsOptions model
				loadBalancerID := "testString"
				listLoadBalancerPoolsOptionsModel := vpcService.NewListLoadBalancerPoolsOptions(loadBalancerID)
				listLoadBalancerPoolsOptionsModel.SetLoadBalancerID("testString")
				listLoadBalancerPoolsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listLoadBalancerPoolsOptionsModel).ToNot(BeNil())
				Expect(listLoadBalancerPoolsOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(listLoadBalancerPoolsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListLoadBalancerProfilesOptions successfully`, func() {
				// Construct an instance of the ListLoadBalancerProfilesOptions model
				listLoadBalancerProfilesOptionsModel := vpcService.NewListLoadBalancerProfilesOptions()
				listLoadBalancerProfilesOptionsModel.SetStart("testString")
				listLoadBalancerProfilesOptionsModel.SetLimit(int64(10))
				listLoadBalancerProfilesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listLoadBalancerProfilesOptionsModel).ToNot(BeNil())
				Expect(listLoadBalancerProfilesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listLoadBalancerProfilesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listLoadBalancerProfilesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListLoadBalancersOptions successfully`, func() {
				// Construct an instance of the ListLoadBalancersOptions model
				listLoadBalancersOptionsModel := vpcService.NewListLoadBalancersOptions()
				listLoadBalancersOptionsModel.SetStart("testString")
				listLoadBalancersOptionsModel.SetLimit(int64(10))
				listLoadBalancersOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listLoadBalancersOptionsModel).ToNot(BeNil())
				Expect(listLoadBalancersOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listLoadBalancersOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listLoadBalancersOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListNetworkACLRulesOptions successfully`, func() {
				// Construct an instance of the ListNetworkACLRulesOptions model
				networkAclid := "testString"
				listNetworkACLRulesOptionsModel := vpcService.NewListNetworkACLRulesOptions(networkAclid)
				listNetworkACLRulesOptionsModel.SetNetworkACLID("testString")
				listNetworkACLRulesOptionsModel.SetStart("testString")
				listNetworkACLRulesOptionsModel.SetLimit(int64(10))
				listNetworkACLRulesOptionsModel.SetDirection("inbound")
				listNetworkACLRulesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listNetworkACLRulesOptionsModel).ToNot(BeNil())
				Expect(listNetworkACLRulesOptionsModel.NetworkACLID).To(Equal(core.StringPtr("testString")))
				Expect(listNetworkACLRulesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listNetworkACLRulesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listNetworkACLRulesOptionsModel.Direction).To(Equal(core.StringPtr("inbound")))
				Expect(listNetworkACLRulesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListNetworkAclsOptions successfully`, func() {
				// Construct an instance of the ListNetworkAclsOptions model
				listNetworkAclsOptionsModel := vpcService.NewListNetworkAclsOptions()
				listNetworkAclsOptionsModel.SetStart("testString")
				listNetworkAclsOptionsModel.SetLimit(int64(10))
				listNetworkAclsOptionsModel.SetResourceGroupID("testString")
				listNetworkAclsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listNetworkAclsOptionsModel).ToNot(BeNil())
				Expect(listNetworkAclsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listNetworkAclsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listNetworkAclsOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listNetworkAclsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListNetworkInterfaceFloatingIpsOptions successfully`, func() {
				// Construct an instance of the ListNetworkInterfaceFloatingIpsOptions model
				virtualNetworkInterfaceID := "testString"
				listNetworkInterfaceFloatingIpsOptionsModel := vpcService.NewListNetworkInterfaceFloatingIpsOptions(virtualNetworkInterfaceID)
				listNetworkInterfaceFloatingIpsOptionsModel.SetVirtualNetworkInterfaceID("testString")
				listNetworkInterfaceFloatingIpsOptionsModel.SetStart("testString")
				listNetworkInterfaceFloatingIpsOptionsModel.SetLimit(int64(10))
				listNetworkInterfaceFloatingIpsOptionsModel.SetSort("name")
				listNetworkInterfaceFloatingIpsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listNetworkInterfaceFloatingIpsOptionsModel).ToNot(BeNil())
				Expect(listNetworkInterfaceFloatingIpsOptionsModel.VirtualNetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(listNetworkInterfaceFloatingIpsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listNetworkInterfaceFloatingIpsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listNetworkInterfaceFloatingIpsOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listNetworkInterfaceFloatingIpsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListOperatingSystemsOptions successfully`, func() {
				// Construct an instance of the ListOperatingSystemsOptions model
				listOperatingSystemsOptionsModel := vpcService.NewListOperatingSystemsOptions()
				listOperatingSystemsOptionsModel.SetStart("testString")
				listOperatingSystemsOptionsModel.SetLimit(int64(10))
				listOperatingSystemsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listOperatingSystemsOptionsModel).ToNot(BeNil())
				Expect(listOperatingSystemsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listOperatingSystemsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listOperatingSystemsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListPlacementGroupsOptions successfully`, func() {
				// Construct an instance of the ListPlacementGroupsOptions model
				listPlacementGroupsOptionsModel := vpcService.NewListPlacementGroupsOptions()
				listPlacementGroupsOptionsModel.SetStart("testString")
				listPlacementGroupsOptionsModel.SetLimit(int64(10))
				listPlacementGroupsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listPlacementGroupsOptionsModel).ToNot(BeNil())
				Expect(listPlacementGroupsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listPlacementGroupsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listPlacementGroupsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListPrivatePathServiceGatewayAccountPoliciesOptions successfully`, func() {
				// Construct an instance of the ListPrivatePathServiceGatewayAccountPoliciesOptions model
				privatePathServiceGatewayID := "testString"
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel := vpcService.NewListPrivatePathServiceGatewayAccountPoliciesOptions(privatePathServiceGatewayID)
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.SetPrivatePathServiceGatewayID("testString")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.SetStart("testString")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.SetLimit(int64(10))
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.SetAccountID("bb1b52262f7441a586f49068482f1e60")
				listPrivatePathServiceGatewayAccountPoliciesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listPrivatePathServiceGatewayAccountPoliciesOptionsModel).ToNot(BeNil())
				Expect(listPrivatePathServiceGatewayAccountPoliciesOptionsModel.PrivatePathServiceGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listPrivatePathServiceGatewayAccountPoliciesOptionsModel.AccountID).To(Equal(core.StringPtr("bb1b52262f7441a586f49068482f1e60")))
				Expect(listPrivatePathServiceGatewayAccountPoliciesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListPrivatePathServiceGatewayEndpointGatewayBindingsOptions successfully`, func() {
				// Construct an instance of the ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions model
				privatePathServiceGatewayID := "testString"
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel := vpcService.NewListPrivatePathServiceGatewayEndpointGatewayBindingsOptions(privatePathServiceGatewayID)
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.SetPrivatePathServiceGatewayID("testString")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.SetStart("testString")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.SetLimit(int64(10))
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.SetStatus("abandoned")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.SetAccountID("bb1b52262f7441a586f49068482f1e60")
				listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel).ToNot(BeNil())
				Expect(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.PrivatePathServiceGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Status).To(Equal(core.StringPtr("abandoned")))
				Expect(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.AccountID).To(Equal(core.StringPtr("bb1b52262f7441a586f49068482f1e60")))
				Expect(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListPrivatePathServiceGatewaysOptions successfully`, func() {
				// Construct an instance of the ListPrivatePathServiceGatewaysOptions model
				listPrivatePathServiceGatewaysOptionsModel := vpcService.NewListPrivatePathServiceGatewaysOptions()
				listPrivatePathServiceGatewaysOptionsModel.SetStart("testString")
				listPrivatePathServiceGatewaysOptionsModel.SetLimit(int64(10))
				listPrivatePathServiceGatewaysOptionsModel.SetResourceGroupID("testString")
				listPrivatePathServiceGatewaysOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listPrivatePathServiceGatewaysOptionsModel).ToNot(BeNil())
				Expect(listPrivatePathServiceGatewaysOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listPrivatePathServiceGatewaysOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listPrivatePathServiceGatewaysOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listPrivatePathServiceGatewaysOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListPublicAddressRangesOptions successfully`, func() {
				// Construct an instance of the ListPublicAddressRangesOptions model
				listPublicAddressRangesOptionsModel := vpcService.NewListPublicAddressRangesOptions()
				listPublicAddressRangesOptionsModel.SetStart("testString")
				listPublicAddressRangesOptionsModel.SetLimit(int64(10))
				listPublicAddressRangesOptionsModel.SetResourceGroupID("testString")
				listPublicAddressRangesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listPublicAddressRangesOptionsModel).ToNot(BeNil())
				Expect(listPublicAddressRangesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listPublicAddressRangesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listPublicAddressRangesOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listPublicAddressRangesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListPublicGatewaysOptions successfully`, func() {
				// Construct an instance of the ListPublicGatewaysOptions model
				listPublicGatewaysOptionsModel := vpcService.NewListPublicGatewaysOptions()
				listPublicGatewaysOptionsModel.SetStart("testString")
				listPublicGatewaysOptionsModel.SetLimit(int64(10))
				listPublicGatewaysOptionsModel.SetResourceGroupID("testString")
				listPublicGatewaysOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listPublicGatewaysOptionsModel).ToNot(BeNil())
				Expect(listPublicGatewaysOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listPublicGatewaysOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listPublicGatewaysOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listPublicGatewaysOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListRegionZonesOptions successfully`, func() {
				// Construct an instance of the ListRegionZonesOptions model
				regionName := "us-south"
				listRegionZonesOptionsModel := vpcService.NewListRegionZonesOptions(regionName)
				listRegionZonesOptionsModel.SetRegionName("us-south")
				listRegionZonesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listRegionZonesOptionsModel).ToNot(BeNil())
				Expect(listRegionZonesOptionsModel.RegionName).To(Equal(core.StringPtr("us-south")))
				Expect(listRegionZonesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListRegionsOptions successfully`, func() {
				// Construct an instance of the ListRegionsOptions model
				listRegionsOptionsModel := vpcService.NewListRegionsOptions()
				listRegionsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listRegionsOptionsModel).ToNot(BeNil())
				Expect(listRegionsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListReservationsOptions successfully`, func() {
				// Construct an instance of the ListReservationsOptions model
				listReservationsOptionsModel := vpcService.NewListReservationsOptions()
				listReservationsOptionsModel.SetStart("testString")
				listReservationsOptionsModel.SetLimit(int64(10))
				listReservationsOptionsModel.SetName("my-name")
				listReservationsOptionsModel.SetProfileResourceType("testString")
				listReservationsOptionsModel.SetAffinityPolicy("automatic")
				listReservationsOptionsModel.SetResourceGroupID("testString")
				listReservationsOptionsModel.SetZoneName("us-south-1")
				listReservationsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listReservationsOptionsModel).ToNot(BeNil())
				Expect(listReservationsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listReservationsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listReservationsOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listReservationsOptionsModel.ProfileResourceType).To(Equal(core.StringPtr("testString")))
				Expect(listReservationsOptionsModel.AffinityPolicy).To(Equal(core.StringPtr("automatic")))
				Expect(listReservationsOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listReservationsOptionsModel.ZoneName).To(Equal(core.StringPtr("us-south-1")))
				Expect(listReservationsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListSecurityGroupRulesOptions successfully`, func() {
				// Construct an instance of the ListSecurityGroupRulesOptions model
				securityGroupID := "testString"
				listSecurityGroupRulesOptionsModel := vpcService.NewListSecurityGroupRulesOptions(securityGroupID)
				listSecurityGroupRulesOptionsModel.SetSecurityGroupID("testString")
				listSecurityGroupRulesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listSecurityGroupRulesOptionsModel).ToNot(BeNil())
				Expect(listSecurityGroupRulesOptionsModel.SecurityGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listSecurityGroupRulesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListSecurityGroupTargetsOptions successfully`, func() {
				// Construct an instance of the ListSecurityGroupTargetsOptions model
				securityGroupID := "testString"
				listSecurityGroupTargetsOptionsModel := vpcService.NewListSecurityGroupTargetsOptions(securityGroupID)
				listSecurityGroupTargetsOptionsModel.SetSecurityGroupID("testString")
				listSecurityGroupTargetsOptionsModel.SetStart("testString")
				listSecurityGroupTargetsOptionsModel.SetLimit(int64(10))
				listSecurityGroupTargetsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listSecurityGroupTargetsOptionsModel).ToNot(BeNil())
				Expect(listSecurityGroupTargetsOptionsModel.SecurityGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listSecurityGroupTargetsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listSecurityGroupTargetsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listSecurityGroupTargetsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListSecurityGroupsOptions successfully`, func() {
				// Construct an instance of the ListSecurityGroupsOptions model
				listSecurityGroupsOptionsModel := vpcService.NewListSecurityGroupsOptions()
				listSecurityGroupsOptionsModel.SetStart("testString")
				listSecurityGroupsOptionsModel.SetLimit(int64(10))
				listSecurityGroupsOptionsModel.SetResourceGroupID("testString")
				listSecurityGroupsOptionsModel.SetVPCID("testString")
				listSecurityGroupsOptionsModel.SetVPCCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listSecurityGroupsOptionsModel.SetVPCName("my-vpc")
				listSecurityGroupsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listSecurityGroupsOptionsModel).ToNot(BeNil())
				Expect(listSecurityGroupsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listSecurityGroupsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listSecurityGroupsOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listSecurityGroupsOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(listSecurityGroupsOptionsModel.VPCCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))
				Expect(listSecurityGroupsOptionsModel.VPCName).To(Equal(core.StringPtr("my-vpc")))
				Expect(listSecurityGroupsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListShareAccessorBindingsOptions successfully`, func() {
				// Construct an instance of the ListShareAccessorBindingsOptions model
				id := "testString"
				listShareAccessorBindingsOptionsModel := vpcService.NewListShareAccessorBindingsOptions(id)
				listShareAccessorBindingsOptionsModel.SetID("testString")
				listShareAccessorBindingsOptionsModel.SetStart("testString")
				listShareAccessorBindingsOptionsModel.SetLimit(int64(10))
				listShareAccessorBindingsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listShareAccessorBindingsOptionsModel).ToNot(BeNil())
				Expect(listShareAccessorBindingsOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(listShareAccessorBindingsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listShareAccessorBindingsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listShareAccessorBindingsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListShareMountTargetsOptions successfully`, func() {
				// Construct an instance of the ListShareMountTargetsOptions model
				shareID := "testString"
				listShareMountTargetsOptionsModel := vpcService.NewListShareMountTargetsOptions(shareID)
				listShareMountTargetsOptionsModel.SetShareID("testString")
				listShareMountTargetsOptionsModel.SetName("my-name")
				listShareMountTargetsOptionsModel.SetStart("testString")
				listShareMountTargetsOptionsModel.SetLimit(int64(10))
				listShareMountTargetsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listShareMountTargetsOptionsModel).ToNot(BeNil())
				Expect(listShareMountTargetsOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(listShareMountTargetsOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listShareMountTargetsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listShareMountTargetsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listShareMountTargetsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListShareProfilesOptions successfully`, func() {
				// Construct an instance of the ListShareProfilesOptions model
				listShareProfilesOptionsModel := vpcService.NewListShareProfilesOptions()
				listShareProfilesOptionsModel.SetStart("testString")
				listShareProfilesOptionsModel.SetLimit(int64(10))
				listShareProfilesOptionsModel.SetSort("name")
				listShareProfilesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listShareProfilesOptionsModel).ToNot(BeNil())
				Expect(listShareProfilesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listShareProfilesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listShareProfilesOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listShareProfilesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListShareSnapshotsOptions successfully`, func() {
				// Construct an instance of the ListShareSnapshotsOptions model
				shareID := "testString"
				listShareSnapshotsOptionsModel := vpcService.NewListShareSnapshotsOptions(shareID)
				listShareSnapshotsOptionsModel.SetShareID("testString")
				listShareSnapshotsOptionsModel.SetBackupPolicyPlanID("testString")
				listShareSnapshotsOptionsModel.SetName("my-name")
				listShareSnapshotsOptionsModel.SetStart("testString")
				listShareSnapshotsOptionsModel.SetLimit(int64(10))
				listShareSnapshotsOptionsModel.SetSort("name")
				listShareSnapshotsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listShareSnapshotsOptionsModel).ToNot(BeNil())
				Expect(listShareSnapshotsOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(listShareSnapshotsOptionsModel.BackupPolicyPlanID).To(Equal(core.StringPtr("testString")))
				Expect(listShareSnapshotsOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listShareSnapshotsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listShareSnapshotsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listShareSnapshotsOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listShareSnapshotsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListSharesOptions successfully`, func() {
				// Construct an instance of the ListSharesOptions model
				listSharesOptionsModel := vpcService.NewListSharesOptions()
				listSharesOptionsModel.SetStart("testString")
				listSharesOptionsModel.SetLimit(int64(10))
				listSharesOptionsModel.SetResourceGroupID("testString")
				listSharesOptionsModel.SetName("my-name")
				listSharesOptionsModel.SetSort("name")
				listSharesOptionsModel.SetReplicationRole("none")
				listSharesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listSharesOptionsModel).ToNot(BeNil())
				Expect(listSharesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listSharesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listSharesOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listSharesOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listSharesOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listSharesOptionsModel.ReplicationRole).To(Equal(core.StringPtr("none")))
				Expect(listSharesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListSnapshotClonesOptions successfully`, func() {
				// Construct an instance of the ListSnapshotClonesOptions model
				id := "testString"
				listSnapshotClonesOptionsModel := vpcService.NewListSnapshotClonesOptions(id)
				listSnapshotClonesOptionsModel.SetID("testString")
				listSnapshotClonesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listSnapshotClonesOptionsModel).ToNot(BeNil())
				Expect(listSnapshotClonesOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotClonesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListSnapshotConsistencyGroupsOptions successfully`, func() {
				// Construct an instance of the ListSnapshotConsistencyGroupsOptions model
				listSnapshotConsistencyGroupsOptionsModel := vpcService.NewListSnapshotConsistencyGroupsOptions()
				listSnapshotConsistencyGroupsOptionsModel.SetStart("testString")
				listSnapshotConsistencyGroupsOptionsModel.SetLimit(int64(10))
				listSnapshotConsistencyGroupsOptionsModel.SetResourceGroupID("testString")
				listSnapshotConsistencyGroupsOptionsModel.SetName("my-name")
				listSnapshotConsistencyGroupsOptionsModel.SetSort("name")
				listSnapshotConsistencyGroupsOptionsModel.SetBackupPolicyPlanID("testString")
				listSnapshotConsistencyGroupsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listSnapshotConsistencyGroupsOptionsModel).ToNot(BeNil())
				Expect(listSnapshotConsistencyGroupsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotConsistencyGroupsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listSnapshotConsistencyGroupsOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotConsistencyGroupsOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listSnapshotConsistencyGroupsOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listSnapshotConsistencyGroupsOptionsModel.BackupPolicyPlanID).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotConsistencyGroupsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListSnapshotInstanceProfilesOptions successfully`, func() {
				// Construct an instance of the ListSnapshotInstanceProfilesOptions model
				id := "testString"
				listSnapshotInstanceProfilesOptionsModel := vpcService.NewListSnapshotInstanceProfilesOptions(id)
				listSnapshotInstanceProfilesOptionsModel.SetID("testString")
				listSnapshotInstanceProfilesOptionsModel.SetStart("testString")
				listSnapshotInstanceProfilesOptionsModel.SetLimit(int64(10))
				listSnapshotInstanceProfilesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listSnapshotInstanceProfilesOptionsModel).ToNot(BeNil())
				Expect(listSnapshotInstanceProfilesOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotInstanceProfilesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotInstanceProfilesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listSnapshotInstanceProfilesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListSnapshotsOptions successfully`, func() {
				// Construct an instance of the ListSnapshotsOptions model
				listSnapshotsOptionsModel := vpcService.NewListSnapshotsOptions()
				listSnapshotsOptionsModel.SetStart("testString")
				listSnapshotsOptionsModel.SetLimit(int64(10))
				listSnapshotsOptionsModel.SetTag("testString")
				listSnapshotsOptionsModel.SetResourceGroupID("testString")
				listSnapshotsOptionsModel.SetName("my-name")
				listSnapshotsOptionsModel.SetSourceVolumeID("testString")
				listSnapshotsOptionsModel.SetSourceVolumeCRN("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
				listSnapshotsOptionsModel.SetSourceImageID("testString")
				listSnapshotsOptionsModel.SetSourceImageCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")
				listSnapshotsOptionsModel.SetSort("name")
				listSnapshotsOptionsModel.SetBackupPolicyPlanID("testString")
				listSnapshotsOptionsModel.SetCopiesID("testString")
				listSnapshotsOptionsModel.SetCopiesName("my-snapshot-copy")
				listSnapshotsOptionsModel.SetCopiesCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")
				listSnapshotsOptionsModel.SetCopiesRemoteRegionName("us-south")
				listSnapshotsOptionsModel.SetSourceSnapshotID("testString")
				listSnapshotsOptionsModel.SetSourceSnapshotRemoteRegionName("us-south")
				listSnapshotsOptionsModel.SetSourceVolumeRemoteRegionName("us-east")
				listSnapshotsOptionsModel.SetSourceImageRemoteRegionName("us-south")
				listSnapshotsOptionsModel.SetClonesZoneName("us-south-1")
				listSnapshotsOptionsModel.SetSnapshotConsistencyGroupID("testString")
				listSnapshotsOptionsModel.SetSnapshotConsistencyGroupCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263")
				listSnapshotsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listSnapshotsOptionsModel).ToNot(BeNil())
				Expect(listSnapshotsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listSnapshotsOptionsModel.Tag).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotsOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotsOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listSnapshotsOptionsModel.SourceVolumeID).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotsOptionsModel.SourceVolumeCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")))
				Expect(listSnapshotsOptionsModel.SourceImageID).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotsOptionsModel.SourceImageCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")))
				Expect(listSnapshotsOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listSnapshotsOptionsModel.BackupPolicyPlanID).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotsOptionsModel.CopiesID).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotsOptionsModel.CopiesName).To(Equal(core.StringPtr("my-snapshot-copy")))
				Expect(listSnapshotsOptionsModel.CopiesCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")))
				Expect(listSnapshotsOptionsModel.CopiesRemoteRegionName).To(Equal(core.StringPtr("us-south")))
				Expect(listSnapshotsOptionsModel.SourceSnapshotID).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotsOptionsModel.SourceSnapshotRemoteRegionName).To(Equal(core.StringPtr("us-south")))
				Expect(listSnapshotsOptionsModel.SourceVolumeRemoteRegionName).To(Equal(core.StringPtr("us-east")))
				Expect(listSnapshotsOptionsModel.SourceImageRemoteRegionName).To(Equal(core.StringPtr("us-south")))
				Expect(listSnapshotsOptionsModel.ClonesZoneName).To(Equal(core.StringPtr("us-south-1")))
				Expect(listSnapshotsOptionsModel.SnapshotConsistencyGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listSnapshotsOptionsModel.SnapshotConsistencyGroupCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263")))
				Expect(listSnapshotsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListSubnetReservedIpsOptions successfully`, func() {
				// Construct an instance of the ListSubnetReservedIpsOptions model
				subnetID := "testString"
				listSubnetReservedIpsOptionsModel := vpcService.NewListSubnetReservedIpsOptions(subnetID)
				listSubnetReservedIpsOptionsModel.SetSubnetID("testString")
				listSubnetReservedIpsOptionsModel.SetStart("testString")
				listSubnetReservedIpsOptionsModel.SetLimit(int64(10))
				listSubnetReservedIpsOptionsModel.SetSort("name")
				listSubnetReservedIpsOptionsModel.SetTargetID("testString")
				listSubnetReservedIpsOptionsModel.SetTargetCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
				listSubnetReservedIpsOptionsModel.SetTargetName("my-resource")
				listSubnetReservedIpsOptionsModel.SetTargetResourceType("testString")
				listSubnetReservedIpsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listSubnetReservedIpsOptionsModel).ToNot(BeNil())
				Expect(listSubnetReservedIpsOptionsModel.SubnetID).To(Equal(core.StringPtr("testString")))
				Expect(listSubnetReservedIpsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listSubnetReservedIpsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listSubnetReservedIpsOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listSubnetReservedIpsOptionsModel.TargetID).To(Equal(core.StringPtr("testString")))
				Expect(listSubnetReservedIpsOptionsModel.TargetCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")))
				Expect(listSubnetReservedIpsOptionsModel.TargetName).To(Equal(core.StringPtr("my-resource")))
				Expect(listSubnetReservedIpsOptionsModel.TargetResourceType).To(Equal(core.StringPtr("testString")))
				Expect(listSubnetReservedIpsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListSubnetsOptions successfully`, func() {
				// Construct an instance of the ListSubnetsOptions model
				listSubnetsOptionsModel := vpcService.NewListSubnetsOptions()
				listSubnetsOptionsModel.SetStart("testString")
				listSubnetsOptionsModel.SetLimit(int64(10))
				listSubnetsOptionsModel.SetResourceGroupID("testString")
				listSubnetsOptionsModel.SetZoneName("us-south-1")
				listSubnetsOptionsModel.SetVPCID("testString")
				listSubnetsOptionsModel.SetVPCCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listSubnetsOptionsModel.SetVPCName("my-vpc")
				listSubnetsOptionsModel.SetRoutingTableID("testString")
				listSubnetsOptionsModel.SetRoutingTableName("my-routing-table")
				listSubnetsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listSubnetsOptionsModel).ToNot(BeNil())
				Expect(listSubnetsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listSubnetsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listSubnetsOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listSubnetsOptionsModel.ZoneName).To(Equal(core.StringPtr("us-south-1")))
				Expect(listSubnetsOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(listSubnetsOptionsModel.VPCCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))
				Expect(listSubnetsOptionsModel.VPCName).To(Equal(core.StringPtr("my-vpc")))
				Expect(listSubnetsOptionsModel.RoutingTableID).To(Equal(core.StringPtr("testString")))
				Expect(listSubnetsOptionsModel.RoutingTableName).To(Equal(core.StringPtr("my-routing-table")))
				Expect(listSubnetsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVirtualNetworkInterfaceIpsOptions successfully`, func() {
				// Construct an instance of the ListVirtualNetworkInterfaceIpsOptions model
				virtualNetworkInterfaceID := "testString"
				listVirtualNetworkInterfaceIpsOptionsModel := vpcService.NewListVirtualNetworkInterfaceIpsOptions(virtualNetworkInterfaceID)
				listVirtualNetworkInterfaceIpsOptionsModel.SetVirtualNetworkInterfaceID("testString")
				listVirtualNetworkInterfaceIpsOptionsModel.SetStart("testString")
				listVirtualNetworkInterfaceIpsOptionsModel.SetLimit(int64(10))
				listVirtualNetworkInterfaceIpsOptionsModel.SetSort("name")
				listVirtualNetworkInterfaceIpsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVirtualNetworkInterfaceIpsOptionsModel).ToNot(BeNil())
				Expect(listVirtualNetworkInterfaceIpsOptionsModel.VirtualNetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(listVirtualNetworkInterfaceIpsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVirtualNetworkInterfaceIpsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVirtualNetworkInterfaceIpsOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listVirtualNetworkInterfaceIpsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVirtualNetworkInterfacesOptions successfully`, func() {
				// Construct an instance of the ListVirtualNetworkInterfacesOptions model
				listVirtualNetworkInterfacesOptionsModel := vpcService.NewListVirtualNetworkInterfacesOptions()
				listVirtualNetworkInterfacesOptionsModel.SetStart("testString")
				listVirtualNetworkInterfacesOptionsModel.SetLimit(int64(10))
				listVirtualNetworkInterfacesOptionsModel.SetResourceGroupID("testString")
				listVirtualNetworkInterfacesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVirtualNetworkInterfacesOptionsModel).ToNot(BeNil())
				Expect(listVirtualNetworkInterfacesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVirtualNetworkInterfacesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVirtualNetworkInterfacesOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listVirtualNetworkInterfacesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVolumeInstanceProfilesOptions successfully`, func() {
				// Construct an instance of the ListVolumeInstanceProfilesOptions model
				id := "testString"
				listVolumeInstanceProfilesOptionsModel := vpcService.NewListVolumeInstanceProfilesOptions(id)
				listVolumeInstanceProfilesOptionsModel.SetID("testString")
				listVolumeInstanceProfilesOptionsModel.SetStart("testString")
				listVolumeInstanceProfilesOptionsModel.SetLimit(int64(10))
				listVolumeInstanceProfilesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVolumeInstanceProfilesOptionsModel).ToNot(BeNil())
				Expect(listVolumeInstanceProfilesOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(listVolumeInstanceProfilesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVolumeInstanceProfilesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVolumeInstanceProfilesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVolumeProfilesOptions successfully`, func() {
				// Construct an instance of the ListVolumeProfilesOptions model
				listVolumeProfilesOptionsModel := vpcService.NewListVolumeProfilesOptions()
				listVolumeProfilesOptionsModel.SetStart("testString")
				listVolumeProfilesOptionsModel.SetLimit(int64(10))
				listVolumeProfilesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVolumeProfilesOptionsModel).ToNot(BeNil())
				Expect(listVolumeProfilesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVolumeProfilesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVolumeProfilesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVolumesOptions successfully`, func() {
				// Construct an instance of the ListVolumesOptions model
				listVolumesOptionsModel := vpcService.NewListVolumesOptions()
				listVolumesOptionsModel.SetStart("testString")
				listVolumesOptionsModel.SetLimit(int64(10))
				listVolumesOptionsModel.SetAttachmentState("attached")
				listVolumesOptionsModel.SetEncryption("provider_managed")
				listVolumesOptionsModel.SetName("my-name")
				listVolumesOptionsModel.SetOperatingSystemFamily("Ubuntu Server")
				listVolumesOptionsModel.SetOperatingSystemArchitecture("amd64")
				listVolumesOptionsModel.SetTag("testString")
				listVolumesOptionsModel.SetZoneName("us-south-1")
				listVolumesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVolumesOptionsModel).ToNot(BeNil())
				Expect(listVolumesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVolumesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVolumesOptionsModel.AttachmentState).To(Equal(core.StringPtr("attached")))
				Expect(listVolumesOptionsModel.Encryption).To(Equal(core.StringPtr("provider_managed")))
				Expect(listVolumesOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listVolumesOptionsModel.OperatingSystemFamily).To(Equal(core.StringPtr("Ubuntu Server")))
				Expect(listVolumesOptionsModel.OperatingSystemArchitecture).To(Equal(core.StringPtr("amd64")))
				Expect(listVolumesOptionsModel.Tag).To(Equal(core.StringPtr("testString")))
				Expect(listVolumesOptionsModel.ZoneName).To(Equal(core.StringPtr("us-south-1")))
				Expect(listVolumesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVPCAddressPrefixesOptions successfully`, func() {
				// Construct an instance of the ListVPCAddressPrefixesOptions model
				vpcID := "testString"
				listVPCAddressPrefixesOptionsModel := vpcService.NewListVPCAddressPrefixesOptions(vpcID)
				listVPCAddressPrefixesOptionsModel.SetVPCID("testString")
				listVPCAddressPrefixesOptionsModel.SetStart("testString")
				listVPCAddressPrefixesOptionsModel.SetLimit(int64(10))
				listVPCAddressPrefixesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVPCAddressPrefixesOptionsModel).ToNot(BeNil())
				Expect(listVPCAddressPrefixesOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(listVPCAddressPrefixesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVPCAddressPrefixesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVPCAddressPrefixesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVPCDnsResolutionBindingsOptions successfully`, func() {
				// Construct an instance of the ListVPCDnsResolutionBindingsOptions model
				vpcID := "testString"
				listVPCDnsResolutionBindingsOptionsModel := vpcService.NewListVPCDnsResolutionBindingsOptions(vpcID)
				listVPCDnsResolutionBindingsOptionsModel.SetVPCID("testString")
				listVPCDnsResolutionBindingsOptionsModel.SetSort("name")
				listVPCDnsResolutionBindingsOptionsModel.SetStart("testString")
				listVPCDnsResolutionBindingsOptionsModel.SetLimit(int64(10))
				listVPCDnsResolutionBindingsOptionsModel.SetName("my-name")
				listVPCDnsResolutionBindingsOptionsModel.SetVPCCRN("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
				listVPCDnsResolutionBindingsOptionsModel.SetVPCName("my-vpc")
				listVPCDnsResolutionBindingsOptionsModel.SetAccountID("bb1b52262f7441a586f49068482f1e60")
				listVPCDnsResolutionBindingsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVPCDnsResolutionBindingsOptionsModel).ToNot(BeNil())
				Expect(listVPCDnsResolutionBindingsOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(listVPCDnsResolutionBindingsOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listVPCDnsResolutionBindingsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVPCDnsResolutionBindingsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVPCDnsResolutionBindingsOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listVPCDnsResolutionBindingsOptionsModel.VPCCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")))
				Expect(listVPCDnsResolutionBindingsOptionsModel.VPCName).To(Equal(core.StringPtr("my-vpc")))
				Expect(listVPCDnsResolutionBindingsOptionsModel.AccountID).To(Equal(core.StringPtr("bb1b52262f7441a586f49068482f1e60")))
				Expect(listVPCDnsResolutionBindingsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVPCRoutesOptions successfully`, func() {
				// Construct an instance of the ListVPCRoutesOptions model
				vpcID := "testString"
				listVPCRoutesOptionsModel := vpcService.NewListVPCRoutesOptions(vpcID)
				listVPCRoutesOptionsModel.SetVPCID("testString")
				listVPCRoutesOptionsModel.SetZoneName("us-south-1")
				listVPCRoutesOptionsModel.SetStart("testString")
				listVPCRoutesOptionsModel.SetLimit(int64(10))
				listVPCRoutesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVPCRoutesOptionsModel).ToNot(BeNil())
				Expect(listVPCRoutesOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(listVPCRoutesOptionsModel.ZoneName).To(Equal(core.StringPtr("us-south-1")))
				Expect(listVPCRoutesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVPCRoutesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVPCRoutesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVPCRoutingTableRoutesOptions successfully`, func() {
				// Construct an instance of the ListVPCRoutingTableRoutesOptions model
				vpcID := "testString"
				routingTableID := "testString"
				listVPCRoutingTableRoutesOptionsModel := vpcService.NewListVPCRoutingTableRoutesOptions(vpcID, routingTableID)
				listVPCRoutingTableRoutesOptionsModel.SetVPCID("testString")
				listVPCRoutingTableRoutesOptionsModel.SetRoutingTableID("testString")
				listVPCRoutingTableRoutesOptionsModel.SetStart("testString")
				listVPCRoutingTableRoutesOptionsModel.SetLimit(int64(10))
				listVPCRoutingTableRoutesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVPCRoutingTableRoutesOptionsModel).ToNot(BeNil())
				Expect(listVPCRoutingTableRoutesOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(listVPCRoutingTableRoutesOptionsModel.RoutingTableID).To(Equal(core.StringPtr("testString")))
				Expect(listVPCRoutingTableRoutesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVPCRoutingTableRoutesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVPCRoutingTableRoutesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVPCRoutingTablesOptions successfully`, func() {
				// Construct an instance of the ListVPCRoutingTablesOptions model
				vpcID := "testString"
				listVPCRoutingTablesOptionsModel := vpcService.NewListVPCRoutingTablesOptions(vpcID)
				listVPCRoutingTablesOptionsModel.SetVPCID("testString")
				listVPCRoutingTablesOptionsModel.SetStart("testString")
				listVPCRoutingTablesOptionsModel.SetLimit(int64(10))
				listVPCRoutingTablesOptionsModel.SetIsDefault(true)
				listVPCRoutingTablesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVPCRoutingTablesOptionsModel).ToNot(BeNil())
				Expect(listVPCRoutingTablesOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(listVPCRoutingTablesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVPCRoutingTablesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVPCRoutingTablesOptionsModel.IsDefault).To(Equal(core.BoolPtr(true)))
				Expect(listVPCRoutingTablesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVpcsOptions successfully`, func() {
				// Construct an instance of the ListVpcsOptions model
				listVpcsOptionsModel := vpcService.NewListVpcsOptions()
				listVpcsOptionsModel.SetStart("testString")
				listVpcsOptionsModel.SetLimit(int64(10))
				listVpcsOptionsModel.SetResourceGroupID("testString")
				listVpcsOptionsModel.SetClassicAccess(true)
				listVpcsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVpcsOptionsModel).ToNot(BeNil())
				Expect(listVpcsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVpcsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVpcsOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listVpcsOptionsModel.ClassicAccess).To(Equal(core.BoolPtr(true)))
				Expect(listVpcsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVPNGatewayAdvertisedCIDRsOptions successfully`, func() {
				// Construct an instance of the ListVPNGatewayAdvertisedCIDRsOptions model
				vpnGatewayID := "testString"
				listVPNGatewayAdvertisedCIDRsOptionsModel := vpcService.NewListVPNGatewayAdvertisedCIDRsOptions(vpnGatewayID)
				listVPNGatewayAdvertisedCIDRsOptionsModel.SetVPNGatewayID("testString")
				listVPNGatewayAdvertisedCIDRsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVPNGatewayAdvertisedCIDRsOptionsModel).ToNot(BeNil())
				Expect(listVPNGatewayAdvertisedCIDRsOptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(listVPNGatewayAdvertisedCIDRsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVPNGatewayConnectionsLocalCIDRsOptions successfully`, func() {
				// Construct an instance of the ListVPNGatewayConnectionsLocalCIDRsOptions model
				vpnGatewayID := "testString"
				id := "testString"
				listVPNGatewayConnectionsLocalCIDRsOptionsModel := vpcService.NewListVPNGatewayConnectionsLocalCIDRsOptions(vpnGatewayID, id)
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.SetVPNGatewayID("testString")
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.SetID("testString")
				listVPNGatewayConnectionsLocalCIDRsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVPNGatewayConnectionsLocalCIDRsOptionsModel).ToNot(BeNil())
				Expect(listVPNGatewayConnectionsLocalCIDRsOptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(listVPNGatewayConnectionsLocalCIDRsOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(listVPNGatewayConnectionsLocalCIDRsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVPNGatewayConnectionsOptions successfully`, func() {
				// Construct an instance of the ListVPNGatewayConnectionsOptions model
				vpnGatewayID := "testString"
				listVPNGatewayConnectionsOptionsModel := vpcService.NewListVPNGatewayConnectionsOptions(vpnGatewayID)
				listVPNGatewayConnectionsOptionsModel.SetVPNGatewayID("testString")
				listVPNGatewayConnectionsOptionsModel.SetStart("testString")
				listVPNGatewayConnectionsOptionsModel.SetLimit(int64(10))
				listVPNGatewayConnectionsOptionsModel.SetStatus("down")
				listVPNGatewayConnectionsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVPNGatewayConnectionsOptionsModel).ToNot(BeNil())
				Expect(listVPNGatewayConnectionsOptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(listVPNGatewayConnectionsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVPNGatewayConnectionsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVPNGatewayConnectionsOptionsModel.Status).To(Equal(core.StringPtr("down")))
				Expect(listVPNGatewayConnectionsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVPNGatewayConnectionsPeerCIDRsOptions successfully`, func() {
				// Construct an instance of the ListVPNGatewayConnectionsPeerCIDRsOptions model
				vpnGatewayID := "testString"
				id := "testString"
				listVPNGatewayConnectionsPeerCIDRsOptionsModel := vpcService.NewListVPNGatewayConnectionsPeerCIDRsOptions(vpnGatewayID, id)
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.SetVPNGatewayID("testString")
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.SetID("testString")
				listVPNGatewayConnectionsPeerCIDRsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVPNGatewayConnectionsPeerCIDRsOptionsModel).ToNot(BeNil())
				Expect(listVPNGatewayConnectionsPeerCIDRsOptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(listVPNGatewayConnectionsPeerCIDRsOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(listVPNGatewayConnectionsPeerCIDRsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVPNGatewayServiceConnectionsOptions successfully`, func() {
				// Construct an instance of the ListVPNGatewayServiceConnectionsOptions model
				vpnGatewayID := "testString"
				listVPNGatewayServiceConnectionsOptionsModel := vpcService.NewListVPNGatewayServiceConnectionsOptions(vpnGatewayID)
				listVPNGatewayServiceConnectionsOptionsModel.SetVPNGatewayID("testString")
				listVPNGatewayServiceConnectionsOptionsModel.SetStart("testString")
				listVPNGatewayServiceConnectionsOptionsModel.SetLimit(int64(10))
				listVPNGatewayServiceConnectionsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVPNGatewayServiceConnectionsOptionsModel).ToNot(BeNil())
				Expect(listVPNGatewayServiceConnectionsOptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(listVPNGatewayServiceConnectionsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVPNGatewayServiceConnectionsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVPNGatewayServiceConnectionsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVPNGatewaysOptions successfully`, func() {
				// Construct an instance of the ListVPNGatewaysOptions model
				listVPNGatewaysOptionsModel := vpcService.NewListVPNGatewaysOptions()
				listVPNGatewaysOptionsModel.SetStart("testString")
				listVPNGatewaysOptionsModel.SetLimit(int64(10))
				listVPNGatewaysOptionsModel.SetResourceGroupID("testString")
				listVPNGatewaysOptionsModel.SetSort("name")
				listVPNGatewaysOptionsModel.SetMode("policy")
				listVPNGatewaysOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVPNGatewaysOptionsModel).ToNot(BeNil())
				Expect(listVPNGatewaysOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVPNGatewaysOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVPNGatewaysOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listVPNGatewaysOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listVPNGatewaysOptionsModel.Mode).To(Equal(core.StringPtr("policy")))
				Expect(listVPNGatewaysOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVPNServerClientsOptions successfully`, func() {
				// Construct an instance of the ListVPNServerClientsOptions model
				vpnServerID := "testString"
				listVPNServerClientsOptionsModel := vpcService.NewListVPNServerClientsOptions(vpnServerID)
				listVPNServerClientsOptionsModel.SetVPNServerID("testString")
				listVPNServerClientsOptionsModel.SetStart("testString")
				listVPNServerClientsOptionsModel.SetLimit(int64(10))
				listVPNServerClientsOptionsModel.SetSort("created_at")
				listVPNServerClientsOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVPNServerClientsOptionsModel).ToNot(BeNil())
				Expect(listVPNServerClientsOptionsModel.VPNServerID).To(Equal(core.StringPtr("testString")))
				Expect(listVPNServerClientsOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVPNServerClientsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVPNServerClientsOptionsModel.Sort).To(Equal(core.StringPtr("created_at")))
				Expect(listVPNServerClientsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVPNServerRoutesOptions successfully`, func() {
				// Construct an instance of the ListVPNServerRoutesOptions model
				vpnServerID := "testString"
				listVPNServerRoutesOptionsModel := vpcService.NewListVPNServerRoutesOptions(vpnServerID)
				listVPNServerRoutesOptionsModel.SetVPNServerID("testString")
				listVPNServerRoutesOptionsModel.SetStart("testString")
				listVPNServerRoutesOptionsModel.SetLimit(int64(10))
				listVPNServerRoutesOptionsModel.SetSort("name")
				listVPNServerRoutesOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVPNServerRoutesOptionsModel).ToNot(BeNil())
				Expect(listVPNServerRoutesOptionsModel.VPNServerID).To(Equal(core.StringPtr("testString")))
				Expect(listVPNServerRoutesOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVPNServerRoutesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVPNServerRoutesOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listVPNServerRoutesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewListVPNServersOptions successfully`, func() {
				// Construct an instance of the ListVPNServersOptions model
				listVPNServersOptionsModel := vpcService.NewListVPNServersOptions()
				listVPNServersOptionsModel.SetName("my-name")
				listVPNServersOptionsModel.SetStart("testString")
				listVPNServersOptionsModel.SetLimit(int64(10))
				listVPNServersOptionsModel.SetResourceGroupID("testString")
				listVPNServersOptionsModel.SetSort("name")
				listVPNServersOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(listVPNServersOptionsModel).ToNot(BeNil())
				Expect(listVPNServersOptionsModel.Name).To(Equal(core.StringPtr("my-name")))
				Expect(listVPNServersOptionsModel.Start).To(Equal(core.StringPtr("testString")))
				Expect(listVPNServersOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10))))
				Expect(listVPNServersOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(listVPNServersOptionsModel.Sort).To(Equal(core.StringPtr("name")))
				Expect(listVPNServersOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewLoadBalancerDnsPrototype successfully`, func() {
				var instance vpcv1.DnsInstanceIdentityIntf = nil
				var zone vpcv1.DnsZoneIdentityIntf = nil
				_, err := vpcService.NewLoadBalancerDnsPrototype(instance, zone)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerHTTPSRedirectPrototype successfully`, func() {
				httpStatusCode := int64(301)
				var listener vpcv1.LoadBalancerListenerIdentityIntf = nil
				_, err := vpcService.NewLoadBalancerListenerHTTPSRedirectPrototype(httpStatusCode, listener)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerPolicyPrototype successfully`, func() {
				action := "forward_to_listener"
				priority := int64(5)
				_model, err := vpcService.NewLoadBalancerListenerPolicyPrototype(action, priority)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerPolicyRulePrototype successfully`, func() {
				condition := "contains"
				typeVar := "body"
				value := "testString"
				_model, err := vpcService.NewLoadBalancerListenerPolicyRulePrototype(condition, typeVar, value)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerPrototypeLoadBalancerContext successfully`, func() {
				protocol := "http"
				_model, err := vpcService.NewLoadBalancerListenerPrototypeLoadBalancerContext(protocol)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolHealthMonitorPatch successfully`, func() {
				delay := int64(5)
				maxRetries := int64(2)
				timeout := int64(2)
				typeVar := "http"
				_model, err := vpcService.NewLoadBalancerPoolHealthMonitorPatch(delay, maxRetries, timeout, typeVar)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolIdentityByName successfully`, func() {
				name := "my-load-balancer-pool"
				_model, err := vpcService.NewLoadBalancerPoolIdentityByName(name)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolMemberPrototype successfully`, func() {
				port := int64(80)
				var target vpcv1.LoadBalancerPoolMemberTargetPrototypeIntf = nil
				_, err := vpcService.NewLoadBalancerPoolMemberPrototype(port, target)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolPrototypeLoadBalancerContext successfully`, func() {
				algorithm := "least_connections"
				var healthMonitor vpcv1.LoadBalancerPoolHealthMonitorPrototypeIntf = nil
				protocol := "http"
				_, err := vpcService.NewLoadBalancerPoolPrototypeLoadBalancerContext(algorithm, healthMonitor, protocol)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolSessionPersistencePrototype successfully`, func() {
				typeVar := "app_cookie"
				_model, err := vpcService.NewLoadBalancerPoolSessionPersistencePrototype(typeVar)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkInterfacePrototype successfully`, func() {
				var subnet vpcv1.SubnetIdentityIntf = nil
				_, err := vpcService.NewNetworkInterfacePrototype(subnet)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewObsoleteImageOptions successfully`, func() {
				// Construct an instance of the ObsoleteImageOptions model
				id := "testString"
				obsoleteImageOptionsModel := vpcService.NewObsoleteImageOptions(id)
				obsoleteImageOptionsModel.SetID("testString")
				obsoleteImageOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(obsoleteImageOptionsModel).ToNot(BeNil())
				Expect(obsoleteImageOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(obsoleteImageOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewPermitPrivatePathServiceGatewayEndpointGatewayBindingOptions successfully`, func() {
				// Construct an instance of the PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions model
				privatePathServiceGatewayID := "testString"
				id := "testString"
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel := vpcService.NewPermitPrivatePathServiceGatewayEndpointGatewayBindingOptions(privatePathServiceGatewayID, id)
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetPrivatePathServiceGatewayID("testString")
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetID("testString")
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetSetAccountPolicy(true)
				permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel).ToNot(BeNil())
				Expect(permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.PrivatePathServiceGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.SetAccountPolicy).To(Equal(core.BoolPtr(true)))
				Expect(permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewPublicAddressRangeTargetPrototype successfully`, func() {
				var vpc vpcv1.VPCIdentityIntf = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				_, err := vpcService.NewPublicAddressRangeTargetPrototype(vpc, zone)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewPublishPrivatePathServiceGatewayOptions successfully`, func() {
				// Construct an instance of the PublishPrivatePathServiceGatewayOptions model
				privatePathServiceGatewayID := "testString"
				publishPrivatePathServiceGatewayOptionsModel := vpcService.NewPublishPrivatePathServiceGatewayOptions(privatePathServiceGatewayID)
				publishPrivatePathServiceGatewayOptionsModel.SetPrivatePathServiceGatewayID("testString")
				publishPrivatePathServiceGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(publishPrivatePathServiceGatewayOptionsModel).ToNot(BeNil())
				Expect(publishPrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(publishPrivatePathServiceGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewRemoveBareMetalServerNetworkInterfaceFloatingIPOptions successfully`, func() {
				// Construct an instance of the RemoveBareMetalServerNetworkInterfaceFloatingIPOptions model
				bareMetalServerID := "testString"
				networkInterfaceID := "testString"
				id := "testString"
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel := vpcService.NewRemoveBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID, networkInterfaceID, id)
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.SetBareMetalServerID("testString")
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.SetNetworkInterfaceID("testString")
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.SetID("testString")
				removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel).ToNot(BeNil())
				Expect(removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(removeBareMetalServerNetworkInterfaceFloatingIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewRemoveEndpointGatewayIPOptions successfully`, func() {
				// Construct an instance of the RemoveEndpointGatewayIPOptions model
				endpointGatewayID := "testString"
				id := "testString"
				removeEndpointGatewayIPOptionsModel := vpcService.NewRemoveEndpointGatewayIPOptions(endpointGatewayID, id)
				removeEndpointGatewayIPOptionsModel.SetEndpointGatewayID("testString")
				removeEndpointGatewayIPOptionsModel.SetID("testString")
				removeEndpointGatewayIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(removeEndpointGatewayIPOptionsModel).ToNot(BeNil())
				Expect(removeEndpointGatewayIPOptionsModel.EndpointGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(removeEndpointGatewayIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(removeEndpointGatewayIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewRemoveInstanceNetworkInterfaceFloatingIPOptions successfully`, func() {
				// Construct an instance of the RemoveInstanceNetworkInterfaceFloatingIPOptions model
				instanceID := "testString"
				networkInterfaceID := "testString"
				id := "testString"
				removeInstanceNetworkInterfaceFloatingIPOptionsModel := vpcService.NewRemoveInstanceNetworkInterfaceFloatingIPOptions(instanceID, networkInterfaceID, id)
				removeInstanceNetworkInterfaceFloatingIPOptionsModel.SetInstanceID("testString")
				removeInstanceNetworkInterfaceFloatingIPOptionsModel.SetNetworkInterfaceID("testString")
				removeInstanceNetworkInterfaceFloatingIPOptionsModel.SetID("testString")
				removeInstanceNetworkInterfaceFloatingIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(removeInstanceNetworkInterfaceFloatingIPOptionsModel).ToNot(BeNil())
				Expect(removeInstanceNetworkInterfaceFloatingIPOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(removeInstanceNetworkInterfaceFloatingIPOptionsModel.NetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(removeInstanceNetworkInterfaceFloatingIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(removeInstanceNetworkInterfaceFloatingIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewRemoveNetworkInterfaceFloatingIPOptions successfully`, func() {
				// Construct an instance of the RemoveNetworkInterfaceFloatingIPOptions model
				virtualNetworkInterfaceID := "testString"
				id := "testString"
				removeNetworkInterfaceFloatingIPOptionsModel := vpcService.NewRemoveNetworkInterfaceFloatingIPOptions(virtualNetworkInterfaceID, id)
				removeNetworkInterfaceFloatingIPOptionsModel.SetVirtualNetworkInterfaceID("testString")
				removeNetworkInterfaceFloatingIPOptionsModel.SetID("testString")
				removeNetworkInterfaceFloatingIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(removeNetworkInterfaceFloatingIPOptionsModel).ToNot(BeNil())
				Expect(removeNetworkInterfaceFloatingIPOptionsModel.VirtualNetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(removeNetworkInterfaceFloatingIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(removeNetworkInterfaceFloatingIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewRemoveVirtualNetworkInterfaceIPOptions successfully`, func() {
				// Construct an instance of the RemoveVirtualNetworkInterfaceIPOptions model
				virtualNetworkInterfaceID := "testString"
				id := "testString"
				removeVirtualNetworkInterfaceIPOptionsModel := vpcService.NewRemoveVirtualNetworkInterfaceIPOptions(virtualNetworkInterfaceID, id)
				removeVirtualNetworkInterfaceIPOptionsModel.SetVirtualNetworkInterfaceID("testString")
				removeVirtualNetworkInterfaceIPOptionsModel.SetID("testString")
				removeVirtualNetworkInterfaceIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(removeVirtualNetworkInterfaceIPOptionsModel).ToNot(BeNil())
				Expect(removeVirtualNetworkInterfaceIPOptionsModel.VirtualNetworkInterfaceID).To(Equal(core.StringPtr("testString")))
				Expect(removeVirtualNetworkInterfaceIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(removeVirtualNetworkInterfaceIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewRemoveVPNGatewayAdvertisedCIDROptions successfully`, func() {
				// Construct an instance of the RemoveVPNGatewayAdvertisedCIDROptions model
				vpnGatewayID := "testString"
				cidr := "192.168.1.0/24"
				removeVPNGatewayAdvertisedCIDROptionsModel := vpcService.NewRemoveVPNGatewayAdvertisedCIDROptions(vpnGatewayID, cidr)
				removeVPNGatewayAdvertisedCIDROptionsModel.SetVPNGatewayID("testString")
				removeVPNGatewayAdvertisedCIDROptionsModel.SetCIDR("192.168.1.0/24")
				removeVPNGatewayAdvertisedCIDROptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(removeVPNGatewayAdvertisedCIDROptionsModel).ToNot(BeNil())
				Expect(removeVPNGatewayAdvertisedCIDROptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(removeVPNGatewayAdvertisedCIDROptionsModel.CIDR).To(Equal(core.StringPtr("192.168.1.0/24")))
				Expect(removeVPNGatewayAdvertisedCIDROptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewRemoveVPNGatewayConnectionsLocalCIDROptions successfully`, func() {
				// Construct an instance of the RemoveVPNGatewayConnectionsLocalCIDROptions model
				vpnGatewayID := "testString"
				id := "testString"
				cidr := "192.168.1.0/24"
				removeVPNGatewayConnectionsLocalCIDROptionsModel := vpcService.NewRemoveVPNGatewayConnectionsLocalCIDROptions(vpnGatewayID, id, cidr)
				removeVPNGatewayConnectionsLocalCIDROptionsModel.SetVPNGatewayID("testString")
				removeVPNGatewayConnectionsLocalCIDROptionsModel.SetID("testString")
				removeVPNGatewayConnectionsLocalCIDROptionsModel.SetCIDR("192.168.1.0/24")
				removeVPNGatewayConnectionsLocalCIDROptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(removeVPNGatewayConnectionsLocalCIDROptionsModel).ToNot(BeNil())
				Expect(removeVPNGatewayConnectionsLocalCIDROptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(removeVPNGatewayConnectionsLocalCIDROptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(removeVPNGatewayConnectionsLocalCIDROptionsModel.CIDR).To(Equal(core.StringPtr("192.168.1.0/24")))
				Expect(removeVPNGatewayConnectionsLocalCIDROptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewRemoveVPNGatewayConnectionsPeerCIDROptions successfully`, func() {
				// Construct an instance of the RemoveVPNGatewayConnectionsPeerCIDROptions model
				vpnGatewayID := "testString"
				id := "testString"
				cidr := "192.168.1.0/24"
				removeVPNGatewayConnectionsPeerCIDROptionsModel := vpcService.NewRemoveVPNGatewayConnectionsPeerCIDROptions(vpnGatewayID, id, cidr)
				removeVPNGatewayConnectionsPeerCIDROptionsModel.SetVPNGatewayID("testString")
				removeVPNGatewayConnectionsPeerCIDROptionsModel.SetID("testString")
				removeVPNGatewayConnectionsPeerCIDROptionsModel.SetCIDR("192.168.1.0/24")
				removeVPNGatewayConnectionsPeerCIDROptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(removeVPNGatewayConnectionsPeerCIDROptionsModel).ToNot(BeNil())
				Expect(removeVPNGatewayConnectionsPeerCIDROptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(removeVPNGatewayConnectionsPeerCIDROptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(removeVPNGatewayConnectionsPeerCIDROptionsModel.CIDR).To(Equal(core.StringPtr("192.168.1.0/24")))
				Expect(removeVPNGatewayConnectionsPeerCIDROptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewReplaceBareMetalServerInitializationOptions successfully`, func() {
				// Construct an instance of the ImageIdentityByID model
				imageIdentityModel := new(vpcv1.ImageIdentityByID)
				Expect(imageIdentityModel).ToNot(BeNil())
				imageIdentityModel.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")
				Expect(imageIdentityModel.ID).To(Equal(core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")))

				// Construct an instance of the KeyIdentityByID model
				keyIdentityModel := new(vpcv1.KeyIdentityByID)
				Expect(keyIdentityModel).ToNot(BeNil())
				keyIdentityModel.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")
				Expect(keyIdentityModel.ID).To(Equal(core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")))

				// Construct an instance of the TrustedProfileIdentityByID model
				trustedProfileIdentityModel := new(vpcv1.TrustedProfileIdentityByID)
				Expect(trustedProfileIdentityModel).ToNot(BeNil())
				trustedProfileIdentityModel.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")
				Expect(trustedProfileIdentityModel.ID).To(Equal(core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")))

				// Construct an instance of the BareMetalServerInitializationDefaultTrustedProfilePrototype model
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel := new(vpcv1.BareMetalServerInitializationDefaultTrustedProfilePrototype)
				Expect(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel).ToNot(BeNil())
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.AutoLink = core.BoolPtr(false)
				bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.Target = trustedProfileIdentityModel
				Expect(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.AutoLink).To(Equal(core.BoolPtr(false)))
				Expect(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.Target).To(Equal(trustedProfileIdentityModel))

				// Construct an instance of the ReplaceBareMetalServerInitializationOptions model
				id := "testString"
				var replaceBareMetalServerInitializationOptionsImage vpcv1.ImageIdentityIntf = nil
				replaceBareMetalServerInitializationOptionsKeys := []vpcv1.KeyIdentityIntf{}
				replaceBareMetalServerInitializationOptionsModel := vpcService.NewReplaceBareMetalServerInitializationOptions(id, replaceBareMetalServerInitializationOptionsImage, replaceBareMetalServerInitializationOptionsKeys)
				replaceBareMetalServerInitializationOptionsModel.SetID("testString")
				replaceBareMetalServerInitializationOptionsModel.SetImage(imageIdentityModel)
				replaceBareMetalServerInitializationOptionsModel.SetKeys([]vpcv1.KeyIdentityIntf{keyIdentityModel})
				replaceBareMetalServerInitializationOptionsModel.SetDefaultTrustedProfile(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel)
				replaceBareMetalServerInitializationOptionsModel.SetUserData("testString")
				replaceBareMetalServerInitializationOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(replaceBareMetalServerInitializationOptionsModel).ToNot(BeNil())
				Expect(replaceBareMetalServerInitializationOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(replaceBareMetalServerInitializationOptionsModel.Image).To(Equal(imageIdentityModel))
				Expect(replaceBareMetalServerInitializationOptionsModel.Keys).To(Equal([]vpcv1.KeyIdentityIntf{keyIdentityModel}))
				Expect(replaceBareMetalServerInitializationOptionsModel.DefaultTrustedProfile).To(Equal(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel))
				Expect(replaceBareMetalServerInitializationOptionsModel.UserData).To(Equal(core.StringPtr("testString")))
				Expect(replaceBareMetalServerInitializationOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewReplaceLoadBalancerPoolMembersOptions successfully`, func() {
				// Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID model
				loadBalancerPoolMemberTargetPrototypeModel := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
				Expect(loadBalancerPoolMemberTargetPrototypeModel).ToNot(BeNil())
				loadBalancerPoolMemberTargetPrototypeModel.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")
				Expect(loadBalancerPoolMemberTargetPrototypeModel.ID).To(Equal(core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")))

				// Construct an instance of the LoadBalancerPoolMemberPrototype model
				loadBalancerPoolMemberPrototypeModel := new(vpcv1.LoadBalancerPoolMemberPrototype)
				Expect(loadBalancerPoolMemberPrototypeModel).ToNot(BeNil())
				loadBalancerPoolMemberPrototypeModel.Port = core.Int64Ptr(int64(80))
				loadBalancerPoolMemberPrototypeModel.Target = loadBalancerPoolMemberTargetPrototypeModel
				loadBalancerPoolMemberPrototypeModel.Weight = core.Int64Ptr(int64(50))
				Expect(loadBalancerPoolMemberPrototypeModel.Port).To(Equal(core.Int64Ptr(int64(80))))
				Expect(loadBalancerPoolMemberPrototypeModel.Target).To(Equal(loadBalancerPoolMemberTargetPrototypeModel))
				Expect(loadBalancerPoolMemberPrototypeModel.Weight).To(Equal(core.Int64Ptr(int64(50))))

				// Construct an instance of the ReplaceLoadBalancerPoolMembersOptions model
				loadBalancerID := "testString"
				poolID := "testString"
				replaceLoadBalancerPoolMembersOptionsMembers := []vpcv1.LoadBalancerPoolMemberPrototype{}
				replaceLoadBalancerPoolMembersOptionsModel := vpcService.NewReplaceLoadBalancerPoolMembersOptions(loadBalancerID, poolID, replaceLoadBalancerPoolMembersOptionsMembers)
				replaceLoadBalancerPoolMembersOptionsModel.SetLoadBalancerID("testString")
				replaceLoadBalancerPoolMembersOptionsModel.SetPoolID("testString")
				replaceLoadBalancerPoolMembersOptionsModel.SetMembers([]vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel})
				replaceLoadBalancerPoolMembersOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(replaceLoadBalancerPoolMembersOptionsModel).ToNot(BeNil())
				Expect(replaceLoadBalancerPoolMembersOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(replaceLoadBalancerPoolMembersOptionsModel.PoolID).To(Equal(core.StringPtr("testString")))
				Expect(replaceLoadBalancerPoolMembersOptionsModel.Members).To(Equal([]vpcv1.LoadBalancerPoolMemberPrototype{*loadBalancerPoolMemberPrototypeModel}))
				Expect(replaceLoadBalancerPoolMembersOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewReplaceSubnetNetworkACLOptions successfully`, func() {
				// Construct an instance of the NetworkACLIdentityByID model
				networkACLIdentityModel := new(vpcv1.NetworkACLIdentityByID)
				Expect(networkACLIdentityModel).ToNot(BeNil())
				networkACLIdentityModel.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")
				Expect(networkACLIdentityModel.ID).To(Equal(core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")))

				// Construct an instance of the ReplaceSubnetNetworkACLOptions model
				id := "testString"
				var networkACLIdentity vpcv1.NetworkACLIdentityIntf = nil
				replaceSubnetNetworkACLOptionsModel := vpcService.NewReplaceSubnetNetworkACLOptions(id, networkACLIdentity)
				replaceSubnetNetworkACLOptionsModel.SetID("testString")
				replaceSubnetNetworkACLOptionsModel.SetNetworkACLIdentity(networkACLIdentityModel)
				replaceSubnetNetworkACLOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(replaceSubnetNetworkACLOptionsModel).ToNot(BeNil())
				Expect(replaceSubnetNetworkACLOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(replaceSubnetNetworkACLOptionsModel.NetworkACLIdentity).To(Equal(networkACLIdentityModel))
				Expect(replaceSubnetNetworkACLOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewReplaceSubnetRoutingTableOptions successfully`, func() {
				// Construct an instance of the RoutingTableIdentityByCRN model
				routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByCRN)
				Expect(routingTableIdentityModel).ToNot(BeNil())
				routingTableIdentityModel.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")
				Expect(routingTableIdentityModel.CRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")))

				// Construct an instance of the ReplaceSubnetRoutingTableOptions model
				id := "testString"
				var routingTableIdentity vpcv1.RoutingTableIdentityIntf = nil
				replaceSubnetRoutingTableOptionsModel := vpcService.NewReplaceSubnetRoutingTableOptions(id, routingTableIdentity)
				replaceSubnetRoutingTableOptionsModel.SetID("testString")
				replaceSubnetRoutingTableOptionsModel.SetRoutingTableIdentity(routingTableIdentityModel)
				replaceSubnetRoutingTableOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(replaceSubnetRoutingTableOptionsModel).ToNot(BeNil())
				Expect(replaceSubnetRoutingTableOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(replaceSubnetRoutingTableOptionsModel.RoutingTableIdentity).To(Equal(routingTableIdentityModel))
				Expect(replaceSubnetRoutingTableOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewReservationCapacityPrototype successfully`, func() {
				total := int64(10)
				_model, err := vpcService.NewReservationCapacityPrototype(total)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewReservationCommittedUsePrototype successfully`, func() {
				term := "testString"
				_model, err := vpcService.NewReservationCommittedUsePrototype(term)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewReservationProfilePrototype successfully`, func() {
				name := "bx2-4x16"
				resourceType := "bare_metal_server_profile"
				_model, err := vpcService.NewReservationProfilePrototype(name, resourceType)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewRestartBareMetalServerOptions successfully`, func() {
				// Construct an instance of the RestartBareMetalServerOptions model
				id := "testString"
				restartBareMetalServerOptionsModel := vpcService.NewRestartBareMetalServerOptions(id)
				restartBareMetalServerOptionsModel.SetID("testString")
				restartBareMetalServerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(restartBareMetalServerOptionsModel).ToNot(BeNil())
				Expect(restartBareMetalServerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(restartBareMetalServerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewRevokeAccountForPrivatePathServiceGatewayOptions successfully`, func() {
				// Construct an instance of the AccountIdentityByID model
				accountIdentityModel := new(vpcv1.AccountIdentityByID)
				Expect(accountIdentityModel).ToNot(BeNil())
				accountIdentityModel.ID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")
				Expect(accountIdentityModel.ID).To(Equal(core.StringPtr("bb1b52262f7441a586f49068482f1e60")))

				// Construct an instance of the RevokeAccountForPrivatePathServiceGatewayOptions model
				privatePathServiceGatewayID := "testString"
				var revokeAccountForPrivatePathServiceGatewayOptionsAccount vpcv1.AccountIdentityIntf = nil
				revokeAccountForPrivatePathServiceGatewayOptionsModel := vpcService.NewRevokeAccountForPrivatePathServiceGatewayOptions(privatePathServiceGatewayID, revokeAccountForPrivatePathServiceGatewayOptionsAccount)
				revokeAccountForPrivatePathServiceGatewayOptionsModel.SetPrivatePathServiceGatewayID("testString")
				revokeAccountForPrivatePathServiceGatewayOptionsModel.SetAccount(accountIdentityModel)
				revokeAccountForPrivatePathServiceGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(revokeAccountForPrivatePathServiceGatewayOptionsModel).ToNot(BeNil())
				Expect(revokeAccountForPrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(revokeAccountForPrivatePathServiceGatewayOptionsModel.Account).To(Equal(accountIdentityModel))
				Expect(revokeAccountForPrivatePathServiceGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewRoutePrototype successfully`, func() {
				destination := "192.168.3.0/24"
				var zone vpcv1.ZoneIdentityIntf = nil
				_, err := vpcService.NewRoutePrototype(destination, zone)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewSetSubnetPublicGatewayOptions successfully`, func() {
				// Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityByID model
				publicGatewayIdentityModel := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByID)
				Expect(publicGatewayIdentityModel).ToNot(BeNil())
				publicGatewayIdentityModel.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")
				Expect(publicGatewayIdentityModel.ID).To(Equal(core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")))

				// Construct an instance of the SetSubnetPublicGatewayOptions model
				id := "testString"
				var publicGatewayIdentity vpcv1.PublicGatewayIdentityIntf = nil
				setSubnetPublicGatewayOptionsModel := vpcService.NewSetSubnetPublicGatewayOptions(id, publicGatewayIdentity)
				setSubnetPublicGatewayOptionsModel.SetID("testString")
				setSubnetPublicGatewayOptionsModel.SetPublicGatewayIdentity(publicGatewayIdentityModel)
				setSubnetPublicGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(setSubnetPublicGatewayOptionsModel).ToNot(BeNil())
				Expect(setSubnetPublicGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(setSubnetPublicGatewayOptionsModel.PublicGatewayIdentity).To(Equal(publicGatewayIdentityModel))
				Expect(setSubnetPublicGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewSharePrototypeShareContext successfully`, func() {
				var profile vpcv1.ShareProfileIdentityIntf = nil
				replicationCronSpec := "0 */5 * * *"
				_, err := vpcService.NewSharePrototypeShareContext(profile, replicationCronSpec)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewSnapshotClonePrototype successfully`, func() {
				var zone vpcv1.ZoneIdentityIntf = nil
				_, err := vpcService.NewSnapshotClonePrototype(zone)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewSnapshotPrototypeSnapshotConsistencyGroupContext successfully`, func() {
				var sourceVolume vpcv1.VolumeIdentityIntf = nil
				_, err := vpcService.NewSnapshotPrototypeSnapshotConsistencyGroupContext(sourceVolume)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewStartBareMetalServerOptions successfully`, func() {
				// Construct an instance of the StartBareMetalServerOptions model
				id := "testString"
				startBareMetalServerOptionsModel := vpcService.NewStartBareMetalServerOptions(id)
				startBareMetalServerOptionsModel.SetID("testString")
				startBareMetalServerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(startBareMetalServerOptionsModel).ToNot(BeNil())
				Expect(startBareMetalServerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(startBareMetalServerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewStopBareMetalServerOptions successfully`, func() {
				// Construct an instance of the StopBareMetalServerOptions model
				id := "testString"
				stopBareMetalServerOptionsType := "hard"
				stopBareMetalServerOptionsModel := vpcService.NewStopBareMetalServerOptions(id, stopBareMetalServerOptionsType)
				stopBareMetalServerOptionsModel.SetID("testString")
				stopBareMetalServerOptionsModel.SetType("hard")
				stopBareMetalServerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(stopBareMetalServerOptionsModel).ToNot(BeNil())
				Expect(stopBareMetalServerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(stopBareMetalServerOptionsModel.Type).To(Equal(core.StringPtr("hard")))
				Expect(stopBareMetalServerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUnpublishPrivatePathServiceGatewayOptions successfully`, func() {
				// Construct an instance of the UnpublishPrivatePathServiceGatewayOptions model
				privatePathServiceGatewayID := "testString"
				unpublishPrivatePathServiceGatewayOptionsModel := vpcService.NewUnpublishPrivatePathServiceGatewayOptions(privatePathServiceGatewayID)
				unpublishPrivatePathServiceGatewayOptionsModel.SetPrivatePathServiceGatewayID("testString")
				unpublishPrivatePathServiceGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(unpublishPrivatePathServiceGatewayOptionsModel).ToNot(BeNil())
				Expect(unpublishPrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(unpublishPrivatePathServiceGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUnsetSubnetPublicGatewayOptions successfully`, func() {
				// Construct an instance of the UnsetSubnetPublicGatewayOptions model
				id := "testString"
				unsetSubnetPublicGatewayOptionsModel := vpcService.NewUnsetSubnetPublicGatewayOptions(id)
				unsetSubnetPublicGatewayOptionsModel.SetID("testString")
				unsetSubnetPublicGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(unsetSubnetPublicGatewayOptionsModel).ToNot(BeNil())
				Expect(unsetSubnetPublicGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(unsetSubnetPublicGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateBackupPolicyOptions successfully`, func() {
				// Construct an instance of the UpdateBackupPolicyOptions model
				id := "testString"
				backupPolicyPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateBackupPolicyOptionsModel := vpcService.NewUpdateBackupPolicyOptions(id, backupPolicyPatch)
				updateBackupPolicyOptionsModel.SetID("testString")
				updateBackupPolicyOptionsModel.SetBackupPolicyPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateBackupPolicyOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateBackupPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateBackupPolicyOptionsModel).ToNot(BeNil())
				Expect(updateBackupPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateBackupPolicyOptionsModel.BackupPolicyPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateBackupPolicyOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateBackupPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateBackupPolicyPlanOptions successfully`, func() {
				// Construct an instance of the UpdateBackupPolicyPlanOptions model
				backupPolicyID := "testString"
				id := "testString"
				backupPolicyPlanPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateBackupPolicyPlanOptionsModel := vpcService.NewUpdateBackupPolicyPlanOptions(backupPolicyID, id, backupPolicyPlanPatch)
				updateBackupPolicyPlanOptionsModel.SetBackupPolicyID("testString")
				updateBackupPolicyPlanOptionsModel.SetID("testString")
				updateBackupPolicyPlanOptionsModel.SetBackupPolicyPlanPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateBackupPolicyPlanOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateBackupPolicyPlanOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateBackupPolicyPlanOptionsModel).ToNot(BeNil())
				Expect(updateBackupPolicyPlanOptionsModel.BackupPolicyID).To(Equal(core.StringPtr("testString")))
				Expect(updateBackupPolicyPlanOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateBackupPolicyPlanOptionsModel.BackupPolicyPlanPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateBackupPolicyPlanOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateBackupPolicyPlanOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateBareMetalServerDiskOptions successfully`, func() {
				// Construct an instance of the UpdateBareMetalServerDiskOptions model
				bareMetalServerID := "testString"
				id := "testString"
				bareMetalServerDiskPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateBareMetalServerDiskOptionsModel := vpcService.NewUpdateBareMetalServerDiskOptions(bareMetalServerID, id, bareMetalServerDiskPatch)
				updateBareMetalServerDiskOptionsModel.SetBareMetalServerID("testString")
				updateBareMetalServerDiskOptionsModel.SetID("testString")
				updateBareMetalServerDiskOptionsModel.SetBareMetalServerDiskPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateBareMetalServerDiskOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateBareMetalServerDiskOptionsModel).ToNot(BeNil())
				Expect(updateBareMetalServerDiskOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(updateBareMetalServerDiskOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateBareMetalServerDiskOptionsModel.BareMetalServerDiskPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateBareMetalServerDiskOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateBareMetalServerNetworkAttachmentOptions successfully`, func() {
				// Construct an instance of the UpdateBareMetalServerNetworkAttachmentOptions model
				bareMetalServerID := "testString"
				id := "testString"
				bareMetalServerNetworkAttachmentPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateBareMetalServerNetworkAttachmentOptionsModel := vpcService.NewUpdateBareMetalServerNetworkAttachmentOptions(bareMetalServerID, id, bareMetalServerNetworkAttachmentPatch)
				updateBareMetalServerNetworkAttachmentOptionsModel.SetBareMetalServerID("testString")
				updateBareMetalServerNetworkAttachmentOptionsModel.SetID("testString")
				updateBareMetalServerNetworkAttachmentOptionsModel.SetBareMetalServerNetworkAttachmentPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateBareMetalServerNetworkAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateBareMetalServerNetworkAttachmentOptionsModel).ToNot(BeNil())
				Expect(updateBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(updateBareMetalServerNetworkAttachmentOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateBareMetalServerNetworkAttachmentOptionsModel.BareMetalServerNetworkAttachmentPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateBareMetalServerNetworkAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateBareMetalServerNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the UpdateBareMetalServerNetworkInterfaceOptions model
				bareMetalServerID := "testString"
				id := "testString"
				bareMetalServerNetworkInterfacePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateBareMetalServerNetworkInterfaceOptionsModel := vpcService.NewUpdateBareMetalServerNetworkInterfaceOptions(bareMetalServerID, id, bareMetalServerNetworkInterfacePatch)
				updateBareMetalServerNetworkInterfaceOptionsModel.SetBareMetalServerID("testString")
				updateBareMetalServerNetworkInterfaceOptionsModel.SetID("testString")
				updateBareMetalServerNetworkInterfaceOptionsModel.SetBareMetalServerNetworkInterfacePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateBareMetalServerNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateBareMetalServerNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(updateBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerID).To(Equal(core.StringPtr("testString")))
				Expect(updateBareMetalServerNetworkInterfaceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateBareMetalServerNetworkInterfaceOptionsModel.BareMetalServerNetworkInterfacePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateBareMetalServerNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateBareMetalServerOptions successfully`, func() {
				// Construct an instance of the UpdateBareMetalServerOptions model
				id := "testString"
				bareMetalServerPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateBareMetalServerOptionsModel := vpcService.NewUpdateBareMetalServerOptions(id, bareMetalServerPatch)
				updateBareMetalServerOptionsModel.SetID("testString")
				updateBareMetalServerOptionsModel.SetBareMetalServerPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateBareMetalServerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateBareMetalServerOptionsModel).ToNot(BeNil())
				Expect(updateBareMetalServerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateBareMetalServerOptionsModel.BareMetalServerPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateBareMetalServerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateClusterNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the UpdateClusterNetworkInterfaceOptions model
				clusterNetworkID := "testString"
				id := "testString"
				clusterNetworkInterfacePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateClusterNetworkInterfaceOptionsModel := vpcService.NewUpdateClusterNetworkInterfaceOptions(clusterNetworkID, id, clusterNetworkInterfacePatch)
				updateClusterNetworkInterfaceOptionsModel.SetClusterNetworkID("testString")
				updateClusterNetworkInterfaceOptionsModel.SetID("testString")
				updateClusterNetworkInterfaceOptionsModel.SetClusterNetworkInterfacePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateClusterNetworkInterfaceOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateClusterNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(updateClusterNetworkInterfaceOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(updateClusterNetworkInterfaceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateClusterNetworkInterfaceOptionsModel.ClusterNetworkInterfacePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateClusterNetworkInterfaceOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateClusterNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateClusterNetworkOptions successfully`, func() {
				// Construct an instance of the UpdateClusterNetworkOptions model
				id := "testString"
				clusterNetworkPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateClusterNetworkOptionsModel := vpcService.NewUpdateClusterNetworkOptions(id, clusterNetworkPatch)
				updateClusterNetworkOptionsModel.SetID("testString")
				updateClusterNetworkOptionsModel.SetClusterNetworkPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateClusterNetworkOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateClusterNetworkOptionsModel).ToNot(BeNil())
				Expect(updateClusterNetworkOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateClusterNetworkOptionsModel.ClusterNetworkPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateClusterNetworkOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateClusterNetworkOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateClusterNetworkSubnetOptions successfully`, func() {
				// Construct an instance of the UpdateClusterNetworkSubnetOptions model
				clusterNetworkID := "testString"
				id := "testString"
				clusterNetworkSubnetPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateClusterNetworkSubnetOptionsModel := vpcService.NewUpdateClusterNetworkSubnetOptions(clusterNetworkID, id, clusterNetworkSubnetPatch)
				updateClusterNetworkSubnetOptionsModel.SetClusterNetworkID("testString")
				updateClusterNetworkSubnetOptionsModel.SetID("testString")
				updateClusterNetworkSubnetOptionsModel.SetClusterNetworkSubnetPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateClusterNetworkSubnetOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkSubnetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateClusterNetworkSubnetOptionsModel).ToNot(BeNil())
				Expect(updateClusterNetworkSubnetOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(updateClusterNetworkSubnetOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateClusterNetworkSubnetOptionsModel.ClusterNetworkSubnetPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateClusterNetworkSubnetOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateClusterNetworkSubnetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateClusterNetworkSubnetReservedIPOptions successfully`, func() {
				// Construct an instance of the UpdateClusterNetworkSubnetReservedIPOptions model
				clusterNetworkID := "testString"
				clusterNetworkSubnetID := "testString"
				id := "testString"
				clusterNetworkSubnetReservedIPPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateClusterNetworkSubnetReservedIPOptionsModel := vpcService.NewUpdateClusterNetworkSubnetReservedIPOptions(clusterNetworkID, clusterNetworkSubnetID, id, clusterNetworkSubnetReservedIPPatch)
				updateClusterNetworkSubnetReservedIPOptionsModel.SetClusterNetworkID("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.SetClusterNetworkSubnetID("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.SetID("testString")
				updateClusterNetworkSubnetReservedIPOptionsModel.SetClusterNetworkSubnetReservedIPPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateClusterNetworkSubnetReservedIPOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateClusterNetworkSubnetReservedIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateClusterNetworkSubnetReservedIPOptionsModel).ToNot(BeNil())
				Expect(updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkID).To(Equal(core.StringPtr("testString")))
				Expect(updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetID).To(Equal(core.StringPtr("testString")))
				Expect(updateClusterNetworkSubnetReservedIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateClusterNetworkSubnetReservedIPOptionsModel.ClusterNetworkSubnetReservedIPPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateClusterNetworkSubnetReservedIPOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateClusterNetworkSubnetReservedIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateDedicatedHostDiskOptions successfully`, func() {
				// Construct an instance of the UpdateDedicatedHostDiskOptions model
				dedicatedHostID := "testString"
				id := "testString"
				dedicatedHostDiskPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateDedicatedHostDiskOptionsModel := vpcService.NewUpdateDedicatedHostDiskOptions(dedicatedHostID, id, dedicatedHostDiskPatch)
				updateDedicatedHostDiskOptionsModel.SetDedicatedHostID("testString")
				updateDedicatedHostDiskOptionsModel.SetID("testString")
				updateDedicatedHostDiskOptionsModel.SetDedicatedHostDiskPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateDedicatedHostDiskOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateDedicatedHostDiskOptionsModel).ToNot(BeNil())
				Expect(updateDedicatedHostDiskOptionsModel.DedicatedHostID).To(Equal(core.StringPtr("testString")))
				Expect(updateDedicatedHostDiskOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateDedicatedHostDiskOptionsModel.DedicatedHostDiskPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateDedicatedHostDiskOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateDedicatedHostGroupOptions successfully`, func() {
				// Construct an instance of the UpdateDedicatedHostGroupOptions model
				id := "testString"
				dedicatedHostGroupPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateDedicatedHostGroupOptionsModel := vpcService.NewUpdateDedicatedHostGroupOptions(id, dedicatedHostGroupPatch)
				updateDedicatedHostGroupOptionsModel.SetID("testString")
				updateDedicatedHostGroupOptionsModel.SetDedicatedHostGroupPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateDedicatedHostGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateDedicatedHostGroupOptionsModel).ToNot(BeNil())
				Expect(updateDedicatedHostGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateDedicatedHostGroupOptionsModel.DedicatedHostGroupPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateDedicatedHostGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateDedicatedHostOptions successfully`, func() {
				// Construct an instance of the UpdateDedicatedHostOptions model
				id := "testString"
				dedicatedHostPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateDedicatedHostOptionsModel := vpcService.NewUpdateDedicatedHostOptions(id, dedicatedHostPatch)
				updateDedicatedHostOptionsModel.SetID("testString")
				updateDedicatedHostOptionsModel.SetDedicatedHostPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateDedicatedHostOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateDedicatedHostOptionsModel).ToNot(BeNil())
				Expect(updateDedicatedHostOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateDedicatedHostOptionsModel.DedicatedHostPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateDedicatedHostOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateEndpointGatewayOptions successfully`, func() {
				// Construct an instance of the UpdateEndpointGatewayOptions model
				id := "testString"
				endpointGatewayPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateEndpointGatewayOptionsModel := vpcService.NewUpdateEndpointGatewayOptions(id, endpointGatewayPatch)
				updateEndpointGatewayOptionsModel.SetID("testString")
				updateEndpointGatewayOptionsModel.SetEndpointGatewayPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateEndpointGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateEndpointGatewayOptionsModel).ToNot(BeNil())
				Expect(updateEndpointGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateEndpointGatewayOptionsModel.EndpointGatewayPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateEndpointGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateEndpointGatewayResourceBindingOptions successfully`, func() {
				// Construct an instance of the UpdateEndpointGatewayResourceBindingOptions model
				endpointGatewayID := "testString"
				id := "testString"
				endpointGatewayResourceBindingPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateEndpointGatewayResourceBindingOptionsModel := vpcService.NewUpdateEndpointGatewayResourceBindingOptions(endpointGatewayID, id, endpointGatewayResourceBindingPatch)
				updateEndpointGatewayResourceBindingOptionsModel.SetEndpointGatewayID("testString")
				updateEndpointGatewayResourceBindingOptionsModel.SetID("testString")
				updateEndpointGatewayResourceBindingOptionsModel.SetEndpointGatewayResourceBindingPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateEndpointGatewayResourceBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateEndpointGatewayResourceBindingOptionsModel).ToNot(BeNil())
				Expect(updateEndpointGatewayResourceBindingOptionsModel.EndpointGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(updateEndpointGatewayResourceBindingOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateEndpointGatewayResourceBindingOptionsModel.EndpointGatewayResourceBindingPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateEndpointGatewayResourceBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateFirmwareForBareMetalServerOptions successfully`, func() {
				// Construct an instance of the UpdateFirmwareForBareMetalServerOptions model
				id := "testString"
				updateFirmwareForBareMetalServerOptionsModel := vpcService.NewUpdateFirmwareForBareMetalServerOptions(id)
				updateFirmwareForBareMetalServerOptionsModel.SetID("testString")
				updateFirmwareForBareMetalServerOptionsModel.SetAutoStart(true)
				updateFirmwareForBareMetalServerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateFirmwareForBareMetalServerOptionsModel).ToNot(BeNil())
				Expect(updateFirmwareForBareMetalServerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateFirmwareForBareMetalServerOptionsModel.AutoStart).To(Equal(core.BoolPtr(true)))
				Expect(updateFirmwareForBareMetalServerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateFloatingIPOptions successfully`, func() {
				// Construct an instance of the UpdateFloatingIPOptions model
				id := "testString"
				floatingIPPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateFloatingIPOptionsModel := vpcService.NewUpdateFloatingIPOptions(id, floatingIPPatch)
				updateFloatingIPOptionsModel.SetID("testString")
				updateFloatingIPOptionsModel.SetFloatingIPPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateFloatingIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateFloatingIPOptionsModel).ToNot(BeNil())
				Expect(updateFloatingIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateFloatingIPOptionsModel.FloatingIPPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateFloatingIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateFlowLogCollectorOptions successfully`, func() {
				// Construct an instance of the UpdateFlowLogCollectorOptions model
				id := "testString"
				flowLogCollectorPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateFlowLogCollectorOptionsModel := vpcService.NewUpdateFlowLogCollectorOptions(id, flowLogCollectorPatch)
				updateFlowLogCollectorOptionsModel.SetID("testString")
				updateFlowLogCollectorOptionsModel.SetFlowLogCollectorPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateFlowLogCollectorOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateFlowLogCollectorOptionsModel).ToNot(BeNil())
				Expect(updateFlowLogCollectorOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateFlowLogCollectorOptionsModel.FlowLogCollectorPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateFlowLogCollectorOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateIkePolicyOptions successfully`, func() {
				// Construct an instance of the UpdateIkePolicyOptions model
				id := "testString"
				ikePolicyPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateIkePolicyOptionsModel := vpcService.NewUpdateIkePolicyOptions(id, ikePolicyPatch)
				updateIkePolicyOptionsModel.SetID("testString")
				updateIkePolicyOptionsModel.SetIkePolicyPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateIkePolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateIkePolicyOptionsModel).ToNot(BeNil())
				Expect(updateIkePolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateIkePolicyOptionsModel.IkePolicyPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateIkePolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateImageExportJobOptions successfully`, func() {
				// Construct an instance of the UpdateImageExportJobOptions model
				imageID := "testString"
				id := "testString"
				imageExportJobPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateImageExportJobOptionsModel := vpcService.NewUpdateImageExportJobOptions(imageID, id, imageExportJobPatch)
				updateImageExportJobOptionsModel.SetImageID("testString")
				updateImageExportJobOptionsModel.SetID("testString")
				updateImageExportJobOptionsModel.SetImageExportJobPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateImageExportJobOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateImageExportJobOptionsModel).ToNot(BeNil())
				Expect(updateImageExportJobOptionsModel.ImageID).To(Equal(core.StringPtr("testString")))
				Expect(updateImageExportJobOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateImageExportJobOptionsModel.ImageExportJobPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateImageExportJobOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateImageOptions successfully`, func() {
				// Construct an instance of the UpdateImageOptions model
				id := "testString"
				imagePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateImageOptionsModel := vpcService.NewUpdateImageOptions(id, imagePatch)
				updateImageOptionsModel.SetID("testString")
				updateImageOptionsModel.SetImagePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateImageOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateImageOptionsModel).ToNot(BeNil())
				Expect(updateImageOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateImageOptionsModel.ImagePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateImageOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateInstanceClusterNetworkAttachmentOptions successfully`, func() {
				// Construct an instance of the UpdateInstanceClusterNetworkAttachmentOptions model
				instanceID := "testString"
				id := "testString"
				instanceClusterNetworkAttachmentPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateInstanceClusterNetworkAttachmentOptionsModel := vpcService.NewUpdateInstanceClusterNetworkAttachmentOptions(instanceID, id, instanceClusterNetworkAttachmentPatch)
				updateInstanceClusterNetworkAttachmentOptionsModel.SetInstanceID("testString")
				updateInstanceClusterNetworkAttachmentOptionsModel.SetID("testString")
				updateInstanceClusterNetworkAttachmentOptionsModel.SetInstanceClusterNetworkAttachmentPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateInstanceClusterNetworkAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateInstanceClusterNetworkAttachmentOptionsModel).ToNot(BeNil())
				Expect(updateInstanceClusterNetworkAttachmentOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceClusterNetworkAttachmentOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceClusterNetworkAttachmentOptionsModel.InstanceClusterNetworkAttachmentPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateInstanceClusterNetworkAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateInstanceDiskOptions successfully`, func() {
				// Construct an instance of the UpdateInstanceDiskOptions model
				instanceID := "testString"
				id := "testString"
				instanceDiskPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateInstanceDiskOptionsModel := vpcService.NewUpdateInstanceDiskOptions(instanceID, id, instanceDiskPatch)
				updateInstanceDiskOptionsModel.SetInstanceID("testString")
				updateInstanceDiskOptionsModel.SetID("testString")
				updateInstanceDiskOptionsModel.SetInstanceDiskPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateInstanceDiskOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateInstanceDiskOptionsModel).ToNot(BeNil())
				Expect(updateInstanceDiskOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceDiskOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceDiskOptionsModel.InstanceDiskPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateInstanceDiskOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateInstanceGroupManagerActionOptions successfully`, func() {
				// Construct an instance of the UpdateInstanceGroupManagerActionOptions model
				instanceGroupID := "testString"
				instanceGroupManagerID := "testString"
				id := "testString"
				instanceGroupManagerActionPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateInstanceGroupManagerActionOptionsModel := vpcService.NewUpdateInstanceGroupManagerActionOptions(instanceGroupID, instanceGroupManagerID, id, instanceGroupManagerActionPatch)
				updateInstanceGroupManagerActionOptionsModel.SetInstanceGroupID("testString")
				updateInstanceGroupManagerActionOptionsModel.SetInstanceGroupManagerID("testString")
				updateInstanceGroupManagerActionOptionsModel.SetID("testString")
				updateInstanceGroupManagerActionOptionsModel.SetInstanceGroupManagerActionPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateInstanceGroupManagerActionOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateInstanceGroupManagerActionOptionsModel).ToNot(BeNil())
				Expect(updateInstanceGroupManagerActionOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceGroupManagerActionOptionsModel.InstanceGroupManagerID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceGroupManagerActionOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceGroupManagerActionOptionsModel.InstanceGroupManagerActionPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateInstanceGroupManagerActionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateInstanceGroupManagerOptions successfully`, func() {
				// Construct an instance of the UpdateInstanceGroupManagerOptions model
				instanceGroupID := "testString"
				id := "testString"
				instanceGroupManagerPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateInstanceGroupManagerOptionsModel := vpcService.NewUpdateInstanceGroupManagerOptions(instanceGroupID, id, instanceGroupManagerPatch)
				updateInstanceGroupManagerOptionsModel.SetInstanceGroupID("testString")
				updateInstanceGroupManagerOptionsModel.SetID("testString")
				updateInstanceGroupManagerOptionsModel.SetInstanceGroupManagerPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateInstanceGroupManagerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateInstanceGroupManagerOptionsModel).ToNot(BeNil())
				Expect(updateInstanceGroupManagerOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceGroupManagerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceGroupManagerOptionsModel.InstanceGroupManagerPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateInstanceGroupManagerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateInstanceGroupManagerPolicyOptions successfully`, func() {
				// Construct an instance of the UpdateInstanceGroupManagerPolicyOptions model
				instanceGroupID := "testString"
				instanceGroupManagerID := "testString"
				id := "testString"
				instanceGroupManagerPolicyPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateInstanceGroupManagerPolicyOptionsModel := vpcService.NewUpdateInstanceGroupManagerPolicyOptions(instanceGroupID, instanceGroupManagerID, id, instanceGroupManagerPolicyPatch)
				updateInstanceGroupManagerPolicyOptionsModel.SetInstanceGroupID("testString")
				updateInstanceGroupManagerPolicyOptionsModel.SetInstanceGroupManagerID("testString")
				updateInstanceGroupManagerPolicyOptionsModel.SetID("testString")
				updateInstanceGroupManagerPolicyOptionsModel.SetInstanceGroupManagerPolicyPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateInstanceGroupManagerPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateInstanceGroupManagerPolicyOptionsModel).ToNot(BeNil())
				Expect(updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceGroupManagerPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceGroupManagerPolicyOptionsModel.InstanceGroupManagerPolicyPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateInstanceGroupManagerPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateInstanceGroupMembershipOptions successfully`, func() {
				// Construct an instance of the UpdateInstanceGroupMembershipOptions model
				instanceGroupID := "testString"
				id := "testString"
				instanceGroupMembershipPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateInstanceGroupMembershipOptionsModel := vpcService.NewUpdateInstanceGroupMembershipOptions(instanceGroupID, id, instanceGroupMembershipPatch)
				updateInstanceGroupMembershipOptionsModel.SetInstanceGroupID("testString")
				updateInstanceGroupMembershipOptionsModel.SetID("testString")
				updateInstanceGroupMembershipOptionsModel.SetInstanceGroupMembershipPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateInstanceGroupMembershipOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateInstanceGroupMembershipOptionsModel).ToNot(BeNil())
				Expect(updateInstanceGroupMembershipOptionsModel.InstanceGroupID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceGroupMembershipOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceGroupMembershipOptionsModel.InstanceGroupMembershipPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateInstanceGroupMembershipOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateInstanceGroupOptions successfully`, func() {
				// Construct an instance of the UpdateInstanceGroupOptions model
				id := "testString"
				instanceGroupPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateInstanceGroupOptionsModel := vpcService.NewUpdateInstanceGroupOptions(id, instanceGroupPatch)
				updateInstanceGroupOptionsModel.SetID("testString")
				updateInstanceGroupOptionsModel.SetInstanceGroupPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateInstanceGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateInstanceGroupOptionsModel).ToNot(BeNil())
				Expect(updateInstanceGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceGroupOptionsModel.InstanceGroupPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateInstanceGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateInstanceNetworkAttachmentOptions successfully`, func() {
				// Construct an instance of the UpdateInstanceNetworkAttachmentOptions model
				instanceID := "testString"
				id := "testString"
				instanceNetworkAttachmentPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateInstanceNetworkAttachmentOptionsModel := vpcService.NewUpdateInstanceNetworkAttachmentOptions(instanceID, id, instanceNetworkAttachmentPatch)
				updateInstanceNetworkAttachmentOptionsModel.SetInstanceID("testString")
				updateInstanceNetworkAttachmentOptionsModel.SetID("testString")
				updateInstanceNetworkAttachmentOptionsModel.SetInstanceNetworkAttachmentPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateInstanceNetworkAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateInstanceNetworkAttachmentOptionsModel).ToNot(BeNil())
				Expect(updateInstanceNetworkAttachmentOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceNetworkAttachmentOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceNetworkAttachmentOptionsModel.InstanceNetworkAttachmentPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateInstanceNetworkAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateInstanceNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the UpdateInstanceNetworkInterfaceOptions model
				instanceID := "testString"
				id := "testString"
				networkInterfacePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateInstanceNetworkInterfaceOptionsModel := vpcService.NewUpdateInstanceNetworkInterfaceOptions(instanceID, id, networkInterfacePatch)
				updateInstanceNetworkInterfaceOptionsModel.SetInstanceID("testString")
				updateInstanceNetworkInterfaceOptionsModel.SetID("testString")
				updateInstanceNetworkInterfaceOptionsModel.SetNetworkInterfacePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateInstanceNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateInstanceNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(updateInstanceNetworkInterfaceOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceNetworkInterfaceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceNetworkInterfaceOptionsModel.NetworkInterfacePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateInstanceNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateInstanceOptions successfully`, func() {
				// Construct an instance of the UpdateInstanceOptions model
				id := "testString"
				instancePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateInstanceOptionsModel := vpcService.NewUpdateInstanceOptions(id, instancePatch)
				updateInstanceOptionsModel.SetID("testString")
				updateInstanceOptionsModel.SetInstancePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateInstanceOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateInstanceOptionsModel).ToNot(BeNil())
				Expect(updateInstanceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceOptionsModel.InstancePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateInstanceOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateInstanceTemplateOptions successfully`, func() {
				// Construct an instance of the UpdateInstanceTemplateOptions model
				id := "testString"
				instanceTemplatePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateInstanceTemplateOptionsModel := vpcService.NewUpdateInstanceTemplateOptions(id, instanceTemplatePatch)
				updateInstanceTemplateOptionsModel.SetID("testString")
				updateInstanceTemplateOptionsModel.SetInstanceTemplatePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateInstanceTemplateOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateInstanceTemplateOptionsModel).ToNot(BeNil())
				Expect(updateInstanceTemplateOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceTemplateOptionsModel.InstanceTemplatePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateInstanceTemplateOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateInstanceVolumeAttachmentOptions successfully`, func() {
				// Construct an instance of the UpdateInstanceVolumeAttachmentOptions model
				instanceID := "testString"
				id := "testString"
				volumeAttachmentPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateInstanceVolumeAttachmentOptionsModel := vpcService.NewUpdateInstanceVolumeAttachmentOptions(instanceID, id, volumeAttachmentPatch)
				updateInstanceVolumeAttachmentOptionsModel.SetInstanceID("testString")
				updateInstanceVolumeAttachmentOptionsModel.SetID("testString")
				updateInstanceVolumeAttachmentOptionsModel.SetVolumeAttachmentPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateInstanceVolumeAttachmentOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateInstanceVolumeAttachmentOptionsModel).ToNot(BeNil())
				Expect(updateInstanceVolumeAttachmentOptionsModel.InstanceID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceVolumeAttachmentOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateInstanceVolumeAttachmentOptionsModel.VolumeAttachmentPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateInstanceVolumeAttachmentOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateIpsecPolicyOptions successfully`, func() {
				// Construct an instance of the UpdateIpsecPolicyOptions model
				id := "testString"
				iPsecPolicyPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateIpsecPolicyOptionsModel := vpcService.NewUpdateIpsecPolicyOptions(id, iPsecPolicyPatch)
				updateIpsecPolicyOptionsModel.SetID("testString")
				updateIpsecPolicyOptionsModel.SetIPsecPolicyPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateIpsecPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateIpsecPolicyOptionsModel).ToNot(BeNil())
				Expect(updateIpsecPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateIpsecPolicyOptionsModel.IPsecPolicyPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateIpsecPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateKeyOptions successfully`, func() {
				// Construct an instance of the UpdateKeyOptions model
				id := "testString"
				keyPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateKeyOptionsModel := vpcService.NewUpdateKeyOptions(id, keyPatch)
				updateKeyOptionsModel.SetID("testString")
				updateKeyOptionsModel.SetKeyPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateKeyOptionsModel).ToNot(BeNil())
				Expect(updateKeyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateKeyOptionsModel.KeyPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateLoadBalancerListenerOptions successfully`, func() {
				// Construct an instance of the UpdateLoadBalancerListenerOptions model
				loadBalancerID := "testString"
				id := "testString"
				loadBalancerListenerPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateLoadBalancerListenerOptionsModel := vpcService.NewUpdateLoadBalancerListenerOptions(loadBalancerID, id, loadBalancerListenerPatch)
				updateLoadBalancerListenerOptionsModel.SetLoadBalancerID("testString")
				updateLoadBalancerListenerOptionsModel.SetID("testString")
				updateLoadBalancerListenerOptionsModel.SetLoadBalancerListenerPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateLoadBalancerListenerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateLoadBalancerListenerOptionsModel).ToNot(BeNil())
				Expect(updateLoadBalancerListenerOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerListenerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerListenerOptionsModel.LoadBalancerListenerPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateLoadBalancerListenerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateLoadBalancerListenerPolicyOptions successfully`, func() {
				// Construct an instance of the UpdateLoadBalancerListenerPolicyOptions model
				loadBalancerID := "testString"
				listenerID := "testString"
				id := "testString"
				loadBalancerListenerPolicyPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateLoadBalancerListenerPolicyOptionsModel := vpcService.NewUpdateLoadBalancerListenerPolicyOptions(loadBalancerID, listenerID, id, loadBalancerListenerPolicyPatch)
				updateLoadBalancerListenerPolicyOptionsModel.SetLoadBalancerID("testString")
				updateLoadBalancerListenerPolicyOptionsModel.SetListenerID("testString")
				updateLoadBalancerListenerPolicyOptionsModel.SetID("testString")
				updateLoadBalancerListenerPolicyOptionsModel.SetLoadBalancerListenerPolicyPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateLoadBalancerListenerPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateLoadBalancerListenerPolicyOptionsModel).ToNot(BeNil())
				Expect(updateLoadBalancerListenerPolicyOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerListenerPolicyOptionsModel.ListenerID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerListenerPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerListenerPolicyOptionsModel.LoadBalancerListenerPolicyPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateLoadBalancerListenerPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateLoadBalancerListenerPolicyRuleOptions successfully`, func() {
				// Construct an instance of the UpdateLoadBalancerListenerPolicyRuleOptions model
				loadBalancerID := "testString"
				listenerID := "testString"
				policyID := "testString"
				id := "testString"
				loadBalancerListenerPolicyRulePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateLoadBalancerListenerPolicyRuleOptionsModel := vpcService.NewUpdateLoadBalancerListenerPolicyRuleOptions(loadBalancerID, listenerID, policyID, id, loadBalancerListenerPolicyRulePatch)
				updateLoadBalancerListenerPolicyRuleOptionsModel.SetLoadBalancerID("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.SetListenerID("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.SetPolicyID("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.SetID("testString")
				updateLoadBalancerListenerPolicyRuleOptionsModel.SetLoadBalancerListenerPolicyRulePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateLoadBalancerListenerPolicyRuleOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateLoadBalancerListenerPolicyRuleOptionsModel).ToNot(BeNil())
				Expect(updateLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerListenerPolicyRuleOptionsModel.ListenerID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerListenerPolicyRuleOptionsModel.PolicyID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerListenerPolicyRuleOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerListenerPolicyRuleOptionsModel.LoadBalancerListenerPolicyRulePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateLoadBalancerListenerPolicyRuleOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateLoadBalancerOptions successfully`, func() {
				// Construct an instance of the UpdateLoadBalancerOptions model
				id := "testString"
				loadBalancerPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateLoadBalancerOptionsModel := vpcService.NewUpdateLoadBalancerOptions(id, loadBalancerPatch)
				updateLoadBalancerOptionsModel.SetID("testString")
				updateLoadBalancerOptionsModel.SetLoadBalancerPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateLoadBalancerOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateLoadBalancerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateLoadBalancerOptionsModel).ToNot(BeNil())
				Expect(updateLoadBalancerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerOptionsModel.LoadBalancerPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateLoadBalancerOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateLoadBalancerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateLoadBalancerPoolMemberOptions successfully`, func() {
				// Construct an instance of the UpdateLoadBalancerPoolMemberOptions model
				loadBalancerID := "testString"
				poolID := "testString"
				id := "testString"
				loadBalancerPoolMemberPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateLoadBalancerPoolMemberOptionsModel := vpcService.NewUpdateLoadBalancerPoolMemberOptions(loadBalancerID, poolID, id, loadBalancerPoolMemberPatch)
				updateLoadBalancerPoolMemberOptionsModel.SetLoadBalancerID("testString")
				updateLoadBalancerPoolMemberOptionsModel.SetPoolID("testString")
				updateLoadBalancerPoolMemberOptionsModel.SetID("testString")
				updateLoadBalancerPoolMemberOptionsModel.SetLoadBalancerPoolMemberPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateLoadBalancerPoolMemberOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateLoadBalancerPoolMemberOptionsModel).ToNot(BeNil())
				Expect(updateLoadBalancerPoolMemberOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerPoolMemberOptionsModel.PoolID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerPoolMemberOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerPoolMemberOptionsModel.LoadBalancerPoolMemberPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateLoadBalancerPoolMemberOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateLoadBalancerPoolOptions successfully`, func() {
				// Construct an instance of the UpdateLoadBalancerPoolOptions model
				loadBalancerID := "testString"
				id := "testString"
				loadBalancerPoolPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateLoadBalancerPoolOptionsModel := vpcService.NewUpdateLoadBalancerPoolOptions(loadBalancerID, id, loadBalancerPoolPatch)
				updateLoadBalancerPoolOptionsModel.SetLoadBalancerID("testString")
				updateLoadBalancerPoolOptionsModel.SetID("testString")
				updateLoadBalancerPoolOptionsModel.SetLoadBalancerPoolPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateLoadBalancerPoolOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateLoadBalancerPoolOptionsModel).ToNot(BeNil())
				Expect(updateLoadBalancerPoolOptionsModel.LoadBalancerID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerPoolOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateLoadBalancerPoolOptionsModel.LoadBalancerPoolPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateLoadBalancerPoolOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateNetworkACLOptions successfully`, func() {
				// Construct an instance of the UpdateNetworkACLOptions model
				id := "testString"
				networkACLPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateNetworkACLOptionsModel := vpcService.NewUpdateNetworkACLOptions(id, networkACLPatch)
				updateNetworkACLOptionsModel.SetID("testString")
				updateNetworkACLOptionsModel.SetNetworkACLPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateNetworkACLOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateNetworkACLOptionsModel).ToNot(BeNil())
				Expect(updateNetworkACLOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateNetworkACLOptionsModel.NetworkACLPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateNetworkACLOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateNetworkACLRuleOptions successfully`, func() {
				// Construct an instance of the UpdateNetworkACLRuleOptions model
				networkAclid := "testString"
				id := "testString"
				networkACLRulePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateNetworkACLRuleOptionsModel := vpcService.NewUpdateNetworkACLRuleOptions(networkAclid, id, networkACLRulePatch)
				updateNetworkACLRuleOptionsModel.SetNetworkACLID("testString")
				updateNetworkACLRuleOptionsModel.SetID("testString")
				updateNetworkACLRuleOptionsModel.SetNetworkACLRulePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateNetworkACLRuleOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateNetworkACLRuleOptionsModel).ToNot(BeNil())
				Expect(updateNetworkACLRuleOptionsModel.NetworkACLID).To(Equal(core.StringPtr("testString")))
				Expect(updateNetworkACLRuleOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateNetworkACLRuleOptionsModel.NetworkACLRulePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateNetworkACLRuleOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdatePlacementGroupOptions successfully`, func() {
				// Construct an instance of the UpdatePlacementGroupOptions model
				id := "testString"
				placementGroupPatch := map[string]interface{}{"anyKey": "anyValue"}
				updatePlacementGroupOptionsModel := vpcService.NewUpdatePlacementGroupOptions(id, placementGroupPatch)
				updatePlacementGroupOptionsModel.SetID("testString")
				updatePlacementGroupOptionsModel.SetPlacementGroupPatch(map[string]interface{}{"anyKey": "anyValue"})
				updatePlacementGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updatePlacementGroupOptionsModel).ToNot(BeNil())
				Expect(updatePlacementGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updatePlacementGroupOptionsModel.PlacementGroupPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updatePlacementGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdatePrivatePathServiceGatewayAccountPolicyOptions successfully`, func() {
				// Construct an instance of the UpdatePrivatePathServiceGatewayAccountPolicyOptions model
				privatePathServiceGatewayID := "testString"
				id := "testString"
				privatePathServiceGatewayAccountPolicyPatch := map[string]interface{}{"anyKey": "anyValue"}
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel := vpcService.NewUpdatePrivatePathServiceGatewayAccountPolicyOptions(privatePathServiceGatewayID, id, privatePathServiceGatewayAccountPolicyPatch)
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.SetPrivatePathServiceGatewayID("testString")
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.SetID("testString")
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.SetPrivatePathServiceGatewayAccountPolicyPatch(map[string]interface{}{"anyKey": "anyValue"})
				updatePrivatePathServiceGatewayAccountPolicyOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updatePrivatePathServiceGatewayAccountPolicyOptionsModel).ToNot(BeNil())
				Expect(updatePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(updatePrivatePathServiceGatewayAccountPolicyOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updatePrivatePathServiceGatewayAccountPolicyOptionsModel.PrivatePathServiceGatewayAccountPolicyPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updatePrivatePathServiceGatewayAccountPolicyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdatePrivatePathServiceGatewayOptions successfully`, func() {
				// Construct an instance of the UpdatePrivatePathServiceGatewayOptions model
				id := "testString"
				privatePathServiceGatewayPatch := map[string]interface{}{"anyKey": "anyValue"}
				updatePrivatePathServiceGatewayOptionsModel := vpcService.NewUpdatePrivatePathServiceGatewayOptions(id, privatePathServiceGatewayPatch)
				updatePrivatePathServiceGatewayOptionsModel.SetID("testString")
				updatePrivatePathServiceGatewayOptionsModel.SetPrivatePathServiceGatewayPatch(map[string]interface{}{"anyKey": "anyValue"})
				updatePrivatePathServiceGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updatePrivatePathServiceGatewayOptionsModel).ToNot(BeNil())
				Expect(updatePrivatePathServiceGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updatePrivatePathServiceGatewayOptionsModel.PrivatePathServiceGatewayPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updatePrivatePathServiceGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdatePublicAddressRangeOptions successfully`, func() {
				// Construct an instance of the UpdatePublicAddressRangeOptions model
				id := "testString"
				publicAddressRangePatch := map[string]interface{}{"anyKey": "anyValue"}
				updatePublicAddressRangeOptionsModel := vpcService.NewUpdatePublicAddressRangeOptions(id, publicAddressRangePatch)
				updatePublicAddressRangeOptionsModel.SetID("testString")
				updatePublicAddressRangeOptionsModel.SetPublicAddressRangePatch(map[string]interface{}{"anyKey": "anyValue"})
				updatePublicAddressRangeOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updatePublicAddressRangeOptionsModel).ToNot(BeNil())
				Expect(updatePublicAddressRangeOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updatePublicAddressRangeOptionsModel.PublicAddressRangePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updatePublicAddressRangeOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdatePublicGatewayOptions successfully`, func() {
				// Construct an instance of the UpdatePublicGatewayOptions model
				id := "testString"
				publicGatewayPatch := map[string]interface{}{"anyKey": "anyValue"}
				updatePublicGatewayOptionsModel := vpcService.NewUpdatePublicGatewayOptions(id, publicGatewayPatch)
				updatePublicGatewayOptionsModel.SetID("testString")
				updatePublicGatewayOptionsModel.SetPublicGatewayPatch(map[string]interface{}{"anyKey": "anyValue"})
				updatePublicGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updatePublicGatewayOptionsModel).ToNot(BeNil())
				Expect(updatePublicGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updatePublicGatewayOptionsModel.PublicGatewayPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updatePublicGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateReservationOptions successfully`, func() {
				// Construct an instance of the UpdateReservationOptions model
				id := "testString"
				reservationPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateReservationOptionsModel := vpcService.NewUpdateReservationOptions(id, reservationPatch)
				updateReservationOptionsModel.SetID("testString")
				updateReservationOptionsModel.SetReservationPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateReservationOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateReservationOptionsModel).ToNot(BeNil())
				Expect(updateReservationOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateReservationOptionsModel.ReservationPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateReservationOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateSecurityGroupOptions successfully`, func() {
				// Construct an instance of the UpdateSecurityGroupOptions model
				id := "testString"
				securityGroupPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateSecurityGroupOptionsModel := vpcService.NewUpdateSecurityGroupOptions(id, securityGroupPatch)
				updateSecurityGroupOptionsModel.SetID("testString")
				updateSecurityGroupOptionsModel.SetSecurityGroupPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateSecurityGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateSecurityGroupOptionsModel).ToNot(BeNil())
				Expect(updateSecurityGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateSecurityGroupOptionsModel.SecurityGroupPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateSecurityGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateSecurityGroupRuleOptions successfully`, func() {
				// Construct an instance of the UpdateSecurityGroupRuleOptions model
				securityGroupID := "testString"
				id := "testString"
				securityGroupRulePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateSecurityGroupRuleOptionsModel := vpcService.NewUpdateSecurityGroupRuleOptions(securityGroupID, id, securityGroupRulePatch)
				updateSecurityGroupRuleOptionsModel.SetSecurityGroupID("testString")
				updateSecurityGroupRuleOptionsModel.SetID("testString")
				updateSecurityGroupRuleOptionsModel.SetSecurityGroupRulePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateSecurityGroupRuleOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateSecurityGroupRuleOptionsModel).ToNot(BeNil())
				Expect(updateSecurityGroupRuleOptionsModel.SecurityGroupID).To(Equal(core.StringPtr("testString")))
				Expect(updateSecurityGroupRuleOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateSecurityGroupRuleOptionsModel.SecurityGroupRulePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateSecurityGroupRuleOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateShareMountTargetOptions successfully`, func() {
				// Construct an instance of the UpdateShareMountTargetOptions model
				shareID := "testString"
				id := "testString"
				shareMountTargetPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateShareMountTargetOptionsModel := vpcService.NewUpdateShareMountTargetOptions(shareID, id, shareMountTargetPatch)
				updateShareMountTargetOptionsModel.SetShareID("testString")
				updateShareMountTargetOptionsModel.SetID("testString")
				updateShareMountTargetOptionsModel.SetShareMountTargetPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateShareMountTargetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateShareMountTargetOptionsModel).ToNot(BeNil())
				Expect(updateShareMountTargetOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(updateShareMountTargetOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateShareMountTargetOptionsModel.ShareMountTargetPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateShareMountTargetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateShareOptions successfully`, func() {
				// Construct an instance of the UpdateShareOptions model
				id := "testString"
				sharePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateShareOptionsModel := vpcService.NewUpdateShareOptions(id, sharePatch)
				updateShareOptionsModel.SetID("testString")
				updateShareOptionsModel.SetSharePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateShareOptionsModel.SetIfMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				updateShareOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateShareOptionsModel).ToNot(BeNil())
				Expect(updateShareOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateShareOptionsModel.SharePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateShareOptionsModel.IfMatch).To(Equal(core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")))
				Expect(updateShareOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateShareSnapshotOptions successfully`, func() {
				// Construct an instance of the UpdateShareSnapshotOptions model
				shareID := "testString"
				id := "testString"
				shareSnapshotPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateShareSnapshotOptionsModel := vpcService.NewUpdateShareSnapshotOptions(shareID, id, shareSnapshotPatch)
				updateShareSnapshotOptionsModel.SetShareID("testString")
				updateShareSnapshotOptionsModel.SetID("testString")
				updateShareSnapshotOptionsModel.SetShareSnapshotPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateShareSnapshotOptionsModel.SetIfMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")
				updateShareSnapshotOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateShareSnapshotOptionsModel).ToNot(BeNil())
				Expect(updateShareSnapshotOptionsModel.ShareID).To(Equal(core.StringPtr("testString")))
				Expect(updateShareSnapshotOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateShareSnapshotOptionsModel.ShareSnapshotPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateShareSnapshotOptionsModel.IfMatch).To(Equal(core.StringPtr("W/96d225c4-56bd-43d9-98fc-d7148e5c5028")))
				Expect(updateShareSnapshotOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateSnapshotConsistencyGroupOptions successfully`, func() {
				// Construct an instance of the UpdateSnapshotConsistencyGroupOptions model
				id := "testString"
				snapshotConsistencyGroupPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateSnapshotConsistencyGroupOptionsModel := vpcService.NewUpdateSnapshotConsistencyGroupOptions(id, snapshotConsistencyGroupPatch)
				updateSnapshotConsistencyGroupOptionsModel.SetID("testString")
				updateSnapshotConsistencyGroupOptionsModel.SetSnapshotConsistencyGroupPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateSnapshotConsistencyGroupOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateSnapshotConsistencyGroupOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateSnapshotConsistencyGroupOptionsModel).ToNot(BeNil())
				Expect(updateSnapshotConsistencyGroupOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateSnapshotConsistencyGroupOptionsModel.SnapshotConsistencyGroupPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateSnapshotConsistencyGroupOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateSnapshotConsistencyGroupOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateSnapshotOptions successfully`, func() {
				// Construct an instance of the UpdateSnapshotOptions model
				id := "testString"
				snapshotPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateSnapshotOptionsModel := vpcService.NewUpdateSnapshotOptions(id, snapshotPatch)
				updateSnapshotOptionsModel.SetID("testString")
				updateSnapshotOptionsModel.SetSnapshotPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateSnapshotOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateSnapshotOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateSnapshotOptionsModel).ToNot(BeNil())
				Expect(updateSnapshotOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateSnapshotOptionsModel.SnapshotPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateSnapshotOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateSnapshotOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateSubnetOptions successfully`, func() {
				// Construct an instance of the UpdateSubnetOptions model
				id := "testString"
				subnetPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateSubnetOptionsModel := vpcService.NewUpdateSubnetOptions(id, subnetPatch)
				updateSubnetOptionsModel.SetID("testString")
				updateSubnetOptionsModel.SetSubnetPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateSubnetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateSubnetOptionsModel).ToNot(BeNil())
				Expect(updateSubnetOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateSubnetOptionsModel.SubnetPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateSubnetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateSubnetReservedIPOptions successfully`, func() {
				// Construct an instance of the UpdateSubnetReservedIPOptions model
				subnetID := "testString"
				id := "testString"
				reservedIPPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateSubnetReservedIPOptionsModel := vpcService.NewUpdateSubnetReservedIPOptions(subnetID, id, reservedIPPatch)
				updateSubnetReservedIPOptionsModel.SetSubnetID("testString")
				updateSubnetReservedIPOptionsModel.SetID("testString")
				updateSubnetReservedIPOptionsModel.SetReservedIPPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateSubnetReservedIPOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateSubnetReservedIPOptionsModel).ToNot(BeNil())
				Expect(updateSubnetReservedIPOptionsModel.SubnetID).To(Equal(core.StringPtr("testString")))
				Expect(updateSubnetReservedIPOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateSubnetReservedIPOptionsModel.ReservedIPPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateSubnetReservedIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateVirtualNetworkInterfaceOptions successfully`, func() {
				// Construct an instance of the UpdateVirtualNetworkInterfaceOptions model
				id := "testString"
				virtualNetworkInterfacePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateVirtualNetworkInterfaceOptionsModel := vpcService.NewUpdateVirtualNetworkInterfaceOptions(id, virtualNetworkInterfacePatch)
				updateVirtualNetworkInterfaceOptionsModel.SetID("testString")
				updateVirtualNetworkInterfaceOptionsModel.SetVirtualNetworkInterfacePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateVirtualNetworkInterfaceOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVirtualNetworkInterfaceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateVirtualNetworkInterfaceOptionsModel).ToNot(BeNil())
				Expect(updateVirtualNetworkInterfaceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateVirtualNetworkInterfaceOptionsModel.VirtualNetworkInterfacePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateVirtualNetworkInterfaceOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateVirtualNetworkInterfaceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateVolumeOptions successfully`, func() {
				// Construct an instance of the UpdateVolumeOptions model
				id := "testString"
				volumePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateVolumeOptionsModel := vpcService.NewUpdateVolumeOptions(id, volumePatch)
				updateVolumeOptionsModel.SetID("testString")
				updateVolumeOptionsModel.SetVolumePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateVolumeOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVolumeOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateVolumeOptionsModel).ToNot(BeNil())
				Expect(updateVolumeOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateVolumeOptionsModel.VolumePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateVolumeOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateVolumeOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateVPCAddressPrefixOptions successfully`, func() {
				// Construct an instance of the UpdateVPCAddressPrefixOptions model
				vpcID := "testString"
				id := "testString"
				addressPrefixPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateVPCAddressPrefixOptionsModel := vpcService.NewUpdateVPCAddressPrefixOptions(vpcID, id, addressPrefixPatch)
				updateVPCAddressPrefixOptionsModel.SetVPCID("testString")
				updateVPCAddressPrefixOptionsModel.SetID("testString")
				updateVPCAddressPrefixOptionsModel.SetAddressPrefixPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateVPCAddressPrefixOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateVPCAddressPrefixOptionsModel).ToNot(BeNil())
				Expect(updateVPCAddressPrefixOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPCAddressPrefixOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPCAddressPrefixOptionsModel.AddressPrefixPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateVPCAddressPrefixOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateVPCDnsResolutionBindingOptions successfully`, func() {
				// Construct an instance of the UpdateVPCDnsResolutionBindingOptions model
				vpcID := "testString"
				id := "testString"
				vpcdnsResolutionBindingPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateVPCDnsResolutionBindingOptionsModel := vpcService.NewUpdateVPCDnsResolutionBindingOptions(vpcID, id, vpcdnsResolutionBindingPatch)
				updateVPCDnsResolutionBindingOptionsModel.SetVPCID("testString")
				updateVPCDnsResolutionBindingOptionsModel.SetID("testString")
				updateVPCDnsResolutionBindingOptionsModel.SetVpcdnsResolutionBindingPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateVPCDnsResolutionBindingOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateVPCDnsResolutionBindingOptionsModel).ToNot(BeNil())
				Expect(updateVPCDnsResolutionBindingOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPCDnsResolutionBindingOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPCDnsResolutionBindingOptionsModel.VpcdnsResolutionBindingPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateVPCDnsResolutionBindingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateVPCOptions successfully`, func() {
				// Construct an instance of the UpdateVPCOptions model
				id := "testString"
				vpcPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateVPCOptionsModel := vpcService.NewUpdateVPCOptions(id, vpcPatch)
				updateVPCOptionsModel.SetID("testString")
				updateVPCOptionsModel.SetVPCPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateVPCOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPCOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateVPCOptionsModel).ToNot(BeNil())
				Expect(updateVPCOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPCOptionsModel.VPCPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateVPCOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateVPCOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateVPCRouteOptions successfully`, func() {
				// Construct an instance of the UpdateVPCRouteOptions model
				vpcID := "testString"
				id := "testString"
				routePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateVPCRouteOptionsModel := vpcService.NewUpdateVPCRouteOptions(vpcID, id, routePatch)
				updateVPCRouteOptionsModel.SetVPCID("testString")
				updateVPCRouteOptionsModel.SetID("testString")
				updateVPCRouteOptionsModel.SetRoutePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateVPCRouteOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateVPCRouteOptionsModel).ToNot(BeNil())
				Expect(updateVPCRouteOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPCRouteOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPCRouteOptionsModel.RoutePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateVPCRouteOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateVPCRoutingTableOptions successfully`, func() {
				// Construct an instance of the UpdateVPCRoutingTableOptions model
				vpcID := "testString"
				id := "testString"
				routingTablePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateVPCRoutingTableOptionsModel := vpcService.NewUpdateVPCRoutingTableOptions(vpcID, id, routingTablePatch)
				updateVPCRoutingTableOptionsModel.SetVPCID("testString")
				updateVPCRoutingTableOptionsModel.SetID("testString")
				updateVPCRoutingTableOptionsModel.SetRoutingTablePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateVPCRoutingTableOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPCRoutingTableOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateVPCRoutingTableOptionsModel).ToNot(BeNil())
				Expect(updateVPCRoutingTableOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPCRoutingTableOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPCRoutingTableOptionsModel.RoutingTablePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateVPCRoutingTableOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateVPCRoutingTableOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateVPCRoutingTableRouteOptions successfully`, func() {
				// Construct an instance of the UpdateVPCRoutingTableRouteOptions model
				vpcID := "testString"
				routingTableID := "testString"
				id := "testString"
				routePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateVPCRoutingTableRouteOptionsModel := vpcService.NewUpdateVPCRoutingTableRouteOptions(vpcID, routingTableID, id, routePatch)
				updateVPCRoutingTableRouteOptionsModel.SetVPCID("testString")
				updateVPCRoutingTableRouteOptionsModel.SetRoutingTableID("testString")
				updateVPCRoutingTableRouteOptionsModel.SetID("testString")
				updateVPCRoutingTableRouteOptionsModel.SetRoutePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateVPCRoutingTableRouteOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateVPCRoutingTableRouteOptionsModel).ToNot(BeNil())
				Expect(updateVPCRoutingTableRouteOptionsModel.VPCID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPCRoutingTableRouteOptionsModel.RoutingTableID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPCRoutingTableRouteOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPCRoutingTableRouteOptionsModel.RoutePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateVPCRoutingTableRouteOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateVPNGatewayConnectionOptions successfully`, func() {
				// Construct an instance of the UpdateVPNGatewayConnectionOptions model
				vpnGatewayID := "testString"
				id := "testString"
				vpnGatewayConnectionPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateVPNGatewayConnectionOptionsModel := vpcService.NewUpdateVPNGatewayConnectionOptions(vpnGatewayID, id, vpnGatewayConnectionPatch)
				updateVPNGatewayConnectionOptionsModel.SetVPNGatewayID("testString")
				updateVPNGatewayConnectionOptionsModel.SetID("testString")
				updateVPNGatewayConnectionOptionsModel.SetVPNGatewayConnectionPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateVPNGatewayConnectionOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPNGatewayConnectionOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateVPNGatewayConnectionOptionsModel).ToNot(BeNil())
				Expect(updateVPNGatewayConnectionOptionsModel.VPNGatewayID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPNGatewayConnectionOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPNGatewayConnectionOptionsModel.VPNGatewayConnectionPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateVPNGatewayConnectionOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateVPNGatewayConnectionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateVPNGatewayOptions successfully`, func() {
				// Construct an instance of the UpdateVPNGatewayOptions model
				id := "testString"
				vpnGatewayPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateVPNGatewayOptionsModel := vpcService.NewUpdateVPNGatewayOptions(id, vpnGatewayPatch)
				updateVPNGatewayOptionsModel.SetID("testString")
				updateVPNGatewayOptionsModel.SetVPNGatewayPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateVPNGatewayOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateVPNGatewayOptionsModel).ToNot(BeNil())
				Expect(updateVPNGatewayOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPNGatewayOptionsModel.VPNGatewayPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateVPNGatewayOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateVPNServerOptions successfully`, func() {
				// Construct an instance of the UpdateVPNServerOptions model
				id := "testString"
				vpnServerPatch := map[string]interface{}{"anyKey": "anyValue"}
				updateVPNServerOptionsModel := vpcService.NewUpdateVPNServerOptions(id, vpnServerPatch)
				updateVPNServerOptionsModel.SetID("testString")
				updateVPNServerOptionsModel.SetVPNServerPatch(map[string]interface{}{"anyKey": "anyValue"})
				updateVPNServerOptionsModel.SetIfMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")
				updateVPNServerOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateVPNServerOptionsModel).ToNot(BeNil())
				Expect(updateVPNServerOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPNServerOptionsModel.VPNServerPatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateVPNServerOptionsModel.IfMatch).To(Equal(core.StringPtr("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"")))
				Expect(updateVPNServerOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewUpdateVPNServerRouteOptions successfully`, func() {
				// Construct an instance of the UpdateVPNServerRouteOptions model
				vpnServerID := "testString"
				id := "testString"
				vpnServerRoutePatch := map[string]interface{}{"anyKey": "anyValue"}
				updateVPNServerRouteOptionsModel := vpcService.NewUpdateVPNServerRouteOptions(vpnServerID, id, vpnServerRoutePatch)
				updateVPNServerRouteOptionsModel.SetVPNServerID("testString")
				updateVPNServerRouteOptionsModel.SetID("testString")
				updateVPNServerRouteOptionsModel.SetVPNServerRoutePatch(map[string]interface{}{"anyKey": "anyValue"})
				updateVPNServerRouteOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
				Expect(updateVPNServerRouteOptionsModel).ToNot(BeNil())
				Expect(updateVPNServerRouteOptionsModel.VPNServerID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPNServerRouteOptionsModel.ID).To(Equal(core.StringPtr("testString")))
				Expect(updateVPNServerRouteOptionsModel.VPNServerRoutePatch).To(Equal(map[string]interface{}{"anyKey": "anyValue"}))
				Expect(updateVPNServerRouteOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
			})
			It(`Invoke NewVPNGatewayConnectionPolicyModeLocalPrototype successfully`, func() {
				cidrs := []string{"192.0.2.0/24"}
				_model, err := vpcService.NewVPNGatewayConnectionPolicyModeLocalPrototype(cidrs)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionTunnelPrototype successfully`, func() {
				var neighborIP *vpcv1.IP = nil
				var tunnelInterfaceIP *vpcv1.IP = nil
				_, err := vpcService.NewVPNGatewayConnectionTunnelPrototype(neighborIP, tunnelInterfaceIP)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVolumeAttachmentPrototype successfully`, func() {
				var volume vpcv1.VolumeAttachmentPrototypeVolumeIntf = nil
				_, err := vpcService.NewVolumeAttachmentPrototype(volume)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVolumeAttachmentPrototypeInstanceByImageContext successfully`, func() {
				var volume *vpcv1.VolumePrototypeInstanceByImageContext = nil
				_, err := vpcService.NewVolumeAttachmentPrototypeInstanceByImageContext(volume)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVolumeAttachmentPrototypeInstanceBySourceSnapshotContext successfully`, func() {
				var volume *vpcv1.VolumePrototypeInstanceBySourceSnapshotContext = nil
				_, err := vpcService.NewVolumeAttachmentPrototypeInstanceBySourceSnapshotContext(volume)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVolumeAttachmentPrototypeInstanceByVolumeContext successfully`, func() {
				var volume vpcv1.VolumeIdentityIntf = nil
				_, err := vpcService.NewVolumeAttachmentPrototypeInstanceByVolumeContext(volume)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVolumePrototypeInstanceByImageContext successfully`, func() {
				var profile vpcv1.VolumeProfileIdentityIntf = nil
				_, err := vpcService.NewVolumePrototypeInstanceByImageContext(profile)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVolumePrototypeInstanceBySourceSnapshotContext successfully`, func() {
				var profile vpcv1.VolumeProfileIdentityIntf = nil
				var sourceSnapshot vpcv1.SnapshotIdentityIntf = nil
				_, err := vpcService.NewVolumePrototypeInstanceBySourceSnapshotContext(profile, sourceSnapshot)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewAccountIdentityByID successfully`, func() {
				id := "bb1b52262f7441a586f49068482f1e60"
				_model, err := vpcService.NewAccountIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewBackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype successfully`, func() {
				matchUserTags := []string{"my-daily-backup-policy"}
				matchResourceType := "instance"
				_model, err := vpcService.NewBackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype(matchUserTags, matchResourceType)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewBackupPolicyPrototypeBackupPolicyMatchResourceTypeSharePrototype successfully`, func() {
				matchUserTags := []string{"my-daily-backup-policy"}
				matchResourceType := "share"
				_model, err := vpcService.NewBackupPolicyPrototypeBackupPolicyMatchResourceTypeSharePrototype(matchUserTags, matchResourceType)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewBackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype successfully`, func() {
				matchUserTags := []string{"my-daily-backup-policy"}
				matchResourceType := "volume"
				_model, err := vpcService.NewBackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype(matchUserTags, matchResourceType)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype successfully`, func() {
				var virtualNetworkInterface vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf = nil
				interfaceType := "pci"
				_, err := vpcService.NewBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype(virtualNetworkInterface, interfaceType)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype successfully`, func() {
				var virtualNetworkInterface vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf = nil
				interfaceType := "vlan"
				vlan := int64(4)
				_, err := vpcService.NewBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype(virtualNetworkInterface, interfaceType, vlan)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype successfully`, func() {
				var subnet vpcv1.SubnetIdentityIntf = nil
				interfaceType := "hipersocket"
				_, err := vpcService.NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(subnet, interfaceType)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype successfully`, func() {
				var subnet vpcv1.SubnetIdentityIntf = nil
				interfaceType := "pci"
				_, err := vpcService.NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype(subnet, interfaceType)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype successfully`, func() {
				var subnet vpcv1.SubnetIdentityIntf = nil
				interfaceType := "vlan"
				vlan := int64(4)
				_, err := vpcService.NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype(subnet, interfaceType, vlan)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewBareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype successfully`, func() {
				var virtualNetworkInterface vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf = nil
				_, err := vpcService.NewBareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype(virtualNetworkInterface)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewBareMetalServerProfileIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768"
				_model, err := vpcService.NewBareMetalServerProfileIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewBareMetalServerProfileIdentityByName successfully`, func() {
				name := "bx2-metal-192x768"
				_model, err := vpcService.NewBareMetalServerProfileIdentityByName(name)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewBareMetalServerPrototypeBareMetalServerByNetworkAttachment successfully`, func() {
				var initialization *vpcv1.BareMetalServerInitializationPrototype = nil
				var profile vpcv1.BareMetalServerProfileIdentityIntf = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkAttachment vpcv1.BareMetalServerPrimaryNetworkAttachmentPrototypeIntf = nil
				_, err := vpcService.NewBareMetalServerPrototypeBareMetalServerByNetworkAttachment(initialization, profile, zone, primaryNetworkAttachment)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewBareMetalServerPrototypeBareMetalServerByNetworkInterface successfully`, func() {
				var initialization *vpcv1.BareMetalServerInitializationPrototype = nil
				var profile vpcv1.BareMetalServerProfileIdentityIntf = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkInterface *vpcv1.BareMetalServerPrimaryNetworkInterfacePrototype = nil
				_, err := vpcService.NewBareMetalServerPrototypeBareMetalServerByNetworkInterface(initialization, profile, zone, primaryNetworkInterface)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewCatalogOfferingIdentityCatalogOfferingByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442"
				_model, err := vpcService.NewCatalogOfferingIdentityCatalogOfferingByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"
				_model, err := vpcService.NewCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewCatalogOfferingVersionPlanIdentityCatalogOfferingVersionPlanByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e"
				_model, err := vpcService.NewCatalogOfferingVersionPlanIdentityCatalogOfferingVersionPlanByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewCertificateInstanceIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"
				_model, err := vpcService.NewCertificateInstanceIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewCloudObjectStorageBucketIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"
				_model, err := vpcService.NewCloudObjectStorageBucketIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName successfully`, func() {
				name := "bucket-27200-lwx4cfvcue"
				_model, err := vpcService.NewCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(name)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewClusterNetworkProfileIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100"
				_model, err := vpcService.NewClusterNetworkProfileIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewClusterNetworkProfileIdentityByName successfully`, func() {
				name := "h100"
				_model, err := vpcService.NewClusterNetworkProfileIdentityByName(name)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewClusterNetworkSubnetIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"
				_model, err := vpcService.NewClusterNetworkSubnetIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewClusterNetworkSubnetIdentityByID successfully`, func() {
				id := "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"
				_model, err := vpcService.NewClusterNetworkSubnetIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype successfully`, func() {
				ipv4CIDRBlock := "10.0.0.0/24"
				_model, err := vpcService.NewClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype(ipv4CIDRBlock)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype successfully`, func() {
				totalIpv4AddressCount := int64(256)
				_model, err := vpcService.NewClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype(totalIpv4AddressCount)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewDnsInstanceIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"
				_model, err := vpcService.NewDnsInstanceIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewDnsZoneIdentityByID successfully`, func() {
				id := "d66662cc-aa23-4fe1-9987-858487a61f45"
				_model, err := vpcService.NewDnsZoneIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewDedicatedHostGroupIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0"
				_model, err := vpcService.NewDedicatedHostGroupIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewDedicatedHostGroupIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0"
				_model, err := vpcService.NewDedicatedHostGroupIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewDedicatedHostGroupIdentityByID successfully`, func() {
				id := "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0"
				_model, err := vpcService.NewDedicatedHostGroupIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewDedicatedHostProfileIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles/mx2-host-152x1216"
				_model, err := vpcService.NewDedicatedHostProfileIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewDedicatedHostProfileIdentityByName successfully`, func() {
				name := "mx2-host-152x1216"
				_model, err := vpcService.NewDedicatedHostProfileIdentityByName(name)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewDedicatedHostPrototypeDedicatedHostByGroup successfully`, func() {
				var profile vpcv1.DedicatedHostProfileIdentityIntf = nil
				var group vpcv1.DedicatedHostGroupIdentityIntf = nil
				_, err := vpcService.NewDedicatedHostPrototypeDedicatedHostByGroup(profile, group)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewDedicatedHostPrototypeDedicatedHostByZone successfully`, func() {
				var profile vpcv1.DedicatedHostProfileIdentityIntf = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				_, err := vpcService.NewDedicatedHostPrototypeDedicatedHostByZone(profile, zone)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewEncryptionKeyIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"
				_model, err := vpcService.NewEncryptionKeyIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewEndpointGatewayReservedIPReservedIPPrototypeTargetContext successfully`, func() {
				var subnet vpcv1.SubnetIdentityIntf = nil
				_, err := vpcService.NewEndpointGatewayReservedIPReservedIPPrototypeTargetContext(subnet)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewEndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"
				_model, err := vpcService.NewEndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewEndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5"
				resourceType := "private_path_service_gateway"
				_model, err := vpcService.NewEndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype(crn, resourceType)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewEndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderCloudServicePrototype successfully`, func() {
				crn := "crn:v1:bluemix:public:cloudant:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:3527280b-9327-4411-8020-591092e60353::"
				resourceType := "provider_cloud_service"
				_model, err := vpcService.NewEndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderCloudServicePrototype(crn, resourceType)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewEndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype successfully`, func() {
				name := "ibm-ntp-server"
				resourceType := "provider_infrastructure_service"
				_model, err := vpcService.NewEndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype(name, resourceType)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPPrototypeFloatingIPByTarget successfully`, func() {
				var target vpcv1.FloatingIPTargetPrototypeIntf = nil
				_, err := vpcService.NewFloatingIPPrototypeFloatingIPByTarget(target)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewFloatingIPPrototypeFloatingIPByZone successfully`, func() {
				var zone vpcv1.ZoneIdentityIntf = nil
				_, err := vpcService.NewFloatingIPPrototypeFloatingIPByZone(zone)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewImageIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"
				_model, err := vpcService.NewImageIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewImageIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"
				_model, err := vpcService.NewImageIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewImageIdentityByID successfully`, func() {
				id := "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"
				_model, err := vpcService.NewImageIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewImagePrototypeImageByFile successfully`, func() {
				var file *vpcv1.ImageFilePrototype = nil
				var operatingSystem vpcv1.OperatingSystemIdentityIntf = nil
				_, err := vpcService.NewImagePrototypeImageByFile(file, operatingSystem)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewImagePrototypeImageBySourceVolume successfully`, func() {
				var sourceVolume vpcv1.VolumeIdentityIntf = nil
				_, err := vpcService.NewImagePrototypeImageBySourceVolume(sourceVolume)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceCatalogOfferingPrototypeCatalogOfferingByOffering successfully`, func() {
				var offering vpcv1.CatalogOfferingIdentityIntf = nil
				_, err := vpcService.NewInstanceCatalogOfferingPrototypeCatalogOfferingByOffering(offering)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceCatalogOfferingPrototypeCatalogOfferingByVersion successfully`, func() {
				var version vpcv1.CatalogOfferingVersionIdentityIntf = nil
				_, err := vpcService.NewInstanceCatalogOfferingPrototypeCatalogOfferingByVersion(version)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213"
				_model, err := vpcService.NewInstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID successfully`, func() {
				id := "0717-fb880975-db45-4459-8548-64e3995ac213"
				_model, err := vpcService.NewInstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype successfully`, func() {
				metricType := "cpu"
				metricValue := int64(0)
				policyType := "target"
				_model, err := vpcService.NewInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(metricType, metricValue, policyType)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype successfully`, func() {
				managerType := "autoscale"
				maxMembershipCount := int64(10)
				_model, err := vpcService.NewInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(managerType, maxMembershipCount)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype successfully`, func() {
				managerType := "scheduled"
				_model, err := vpcService.NewInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(managerType)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePatchProfileInstanceProfileIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16"
				_model, err := vpcService.NewInstancePatchProfileInstanceProfileIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePatchProfileInstanceProfileIdentityByName successfully`, func() {
				name := "bx2-4x16"
				_model, err := vpcService.NewInstancePatchProfileInstanceProfileIdentityByName(name)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceProfileIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16"
				_model, err := vpcService.NewInstanceProfileIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceProfileIdentityByName successfully`, func() {
				name := "bx2-4x16"
				_model, err := vpcService.NewInstanceProfileIdentityByName(name)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePrototypeInstanceBySourceTemplate successfully`, func() {
				var sourceTemplate vpcv1.InstanceTemplateIdentityIntf = nil
				_, err := vpcService.NewInstancePrototypeInstanceBySourceTemplate(sourceTemplate)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceTemplateIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2"
				_model, err := vpcService.NewInstanceTemplateIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceTemplateIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2"
				_model, err := vpcService.NewInstanceTemplateIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceTemplateIdentityByID successfully`, func() {
				id := "0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2"
				_model, err := vpcService.NewInstanceTemplateIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceTemplatePrototypeInstanceTemplateBySourceTemplate successfully`, func() {
				var sourceTemplate vpcv1.InstanceTemplateIdentityIntf = nil
				_, err := vpcService.NewInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(sourceTemplate)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewKeyIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45"
				_model, err := vpcService.NewKeyIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewKeyIdentityByFingerprint successfully`, func() {
				fingerprint := "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"
				_model, err := vpcService.NewKeyIdentityByFingerprint(fingerprint)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewKeyIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45"
				_model, err := vpcService.NewKeyIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewKeyIdentityByID successfully`, func() {
				id := "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"
				_model, err := vpcService.NewKeyIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName successfully`, func() {
				name := "bucket-27200-lwx4cfvcue"
				_model, err := vpcService.NewLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(name)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"
				_model, err := vpcService.NewLoadBalancerIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"
				_model, err := vpcService.NewLoadBalancerIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerIdentityByID successfully`, func() {
				id := "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"
				_model, err := vpcService.NewLoadBalancerIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004"
				_model, err := vpcService.NewLoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID successfully`, func() {
				id := "r006-70294e14-4e61-11e8-bcf4-0242ac110004"
				_model, err := vpcService.NewLoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"
				_model, err := vpcService.NewLoadBalancerListenerIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerIdentityByID successfully`, func() {
				id := "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"
				_model, err := vpcService.NewLoadBalancerListenerIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyHTTPSRedirectPrototype successfully`, func() {
				httpStatusCode := int64(301)
				var listener vpcv1.LoadBalancerListenerIdentityIntf = nil
				_, err := vpcService.NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyHTTPSRedirectPrototype(httpStatusCode, listener)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype successfully`, func() {
				httpStatusCode := int64(301)
				url := "https://ibm.com:443/new/{path}?{query}"
				_model, err := vpcService.NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(httpStatusCode, url)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004"
				_model, err := vpcService.NewLoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID successfully`, func() {
				id := "r006-70294e14-4e61-11e8-bcf4-0242ac110004"
				_model, err := vpcService.NewLoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeHttphttpsPrototype successfully`, func() {
				delay := int64(5)
				maxRetries := int64(2)
				timeout := int64(2)
				typeVar := "http"
				_model, err := vpcService.NewLoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeHttphttpsPrototype(delay, maxRetries, timeout, typeVar)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype successfully`, func() {
				delay := int64(5)
				maxRetries := int64(2)
				timeout := int64(2)
				typeVar := "tcp"
				_model, err := vpcService.NewLoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype(delay, maxRetries, timeout, typeVar)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004"
				_model, err := vpcService.NewLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID successfully`, func() {
				id := "r006-70294e14-4e61-11e8-bcf4-0242ac110004"
				_model, err := vpcService.NewLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolMemberTargetPrototypeIP successfully`, func() {
				address := "192.168.3.4"
				_model, err := vpcService.NewLoadBalancerPoolMemberTargetPrototypeIP(address)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerProfileIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed"
				_model, err := vpcService.NewLoadBalancerProfileIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerProfileIdentityByName successfully`, func() {
				name := "network-fixed"
				_model, err := vpcService.NewLoadBalancerProfileIdentityByName(name)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkACLIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf"
				_model, err := vpcService.NewNetworkACLIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkACLIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf"
				_model, err := vpcService.NewNetworkACLIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkACLIdentityByID successfully`, func() {
				id := "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf"
				_model, err := vpcService.NewNetworkACLIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkACLPrototypeNetworkACLByRules successfully`, func() {
				var vpc vpcv1.VPCIdentityIntf = nil
				_, err := vpcService.NewNetworkACLPrototypeNetworkACLByRules(vpc)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewNetworkACLPrototypeNetworkACLBySourceNetworkACL successfully`, func() {
				var vpc vpcv1.VPCIdentityIntf = nil
				var sourceNetworkACL vpcv1.NetworkACLIdentityIntf = nil
				_, err := vpcService.NewNetworkACLPrototypeNetworkACLBySourceNetworkACL(vpc, sourceNetworkACL)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9"
				_model, err := vpcService.NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID successfully`, func() {
				id := "r006-8daca77a-4980-4d33-8f3e-7038797be8f9"
				_model, err := vpcService.NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9"
				_model, err := vpcService.NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID successfully`, func() {
				id := "r006-8daca77a-4980-4d33-8f3e-7038797be8f9"
				_model, err := vpcService.NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype successfully`, func() {
				action := "allow"
				destination := "192.168.3.2/32"
				direction := "inbound"
				source := "192.168.3.2/32"
				protocol := "all"
				_model, err := vpcService.NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(action, destination, direction, source, protocol)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype successfully`, func() {
				action := "allow"
				destination := "192.168.3.2/32"
				direction := "inbound"
				source := "192.168.3.2/32"
				protocol := "icmp"
				_model, err := vpcService.NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype(action, destination, direction, source, protocol)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype successfully`, func() {
				action := "allow"
				destination := "192.168.3.2/32"
				direction := "inbound"
				source := "192.168.3.2/32"
				protocol := "tcp"
				_model, err := vpcService.NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype(action, destination, direction, source, protocol)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype successfully`, func() {
				action := "allow"
				destination := "192.168.3.2/32"
				direction := "inbound"
				source := "192.168.3.2/32"
				protocol := "all"
				_model, err := vpcService.NewNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(action, destination, direction, source, protocol)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype successfully`, func() {
				action := "allow"
				destination := "192.168.3.2/32"
				direction := "inbound"
				source := "192.168.3.2/32"
				protocol := "icmp"
				_model, err := vpcService.NewNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype(action, destination, direction, source, protocol)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype successfully`, func() {
				action := "allow"
				destination := "192.168.3.2/32"
				direction := "inbound"
				source := "192.168.3.2/32"
				protocol := "tcp"
				_model, err := vpcService.NewNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype(action, destination, direction, source, protocol)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewOperatingSystemIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64"
				_model, err := vpcService.NewOperatingSystemIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewOperatingSystemIdentityByName successfully`, func() {
				name := "ubuntu-24-04-amd64"
				_model, err := vpcService.NewOperatingSystemIdentityByName(name)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewPublicGatewayIdentityPublicGatewayIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241"
				_model, err := vpcService.NewPublicGatewayIdentityPublicGatewayIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewPublicGatewayIdentityPublicGatewayIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241"
				_model, err := vpcService.NewPublicGatewayIdentityPublicGatewayIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewPublicGatewayIdentityPublicGatewayIdentityByID successfully`, func() {
				id := "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241"
				_model, err := vpcService.NewPublicGatewayIdentityPublicGatewayIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewRegionIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south"
				_model, err := vpcService.NewRegionIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewRegionIdentityByName successfully`, func() {
				name := "us-south"
				_model, err := vpcService.NewRegionIdentityByName(name)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewReservationIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"
				_model, err := vpcService.NewReservationIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewReservationIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63"
				_model, err := vpcService.NewReservationIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewReservationIdentityByID successfully`, func() {
				id := "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"
				_model, err := vpcService.NewReservationIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewResourceGroupIdentityByID successfully`, func() {
				id := "fee82deba12e4c0fb69c3b09d1f12345"
				_model, err := vpcService.NewResourceGroupIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewRoutingTableIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840"
				_model, err := vpcService.NewRoutingTableIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewRoutingTableIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840"
				_model, err := vpcService.NewRoutingTableIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewRoutingTableIdentityByID successfully`, func() {
				id := "r006-6885e83f-03b2-4603-8a86-db2a0f55c840"
				_model, err := vpcService.NewRoutingTableIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"
				_model, err := vpcService.NewSecurityGroupIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"
				_model, err := vpcService.NewSecurityGroupIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupIdentityByID successfully`, func() {
				id := "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"
				_model, err := vpcService.NewSecurityGroupIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRuleLocalPatchCIDR successfully`, func() {
				cidrBlock := "192.168.3.0/24"
				_model, err := vpcService.NewSecurityGroupRuleLocalPatchCIDR(cidrBlock)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRuleLocalPatchIP successfully`, func() {
				address := "192.168.3.4"
				_model, err := vpcService.NewSecurityGroupRuleLocalPatchIP(address)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRuleLocalPrototypeCIDR successfully`, func() {
				cidrBlock := "192.168.3.0/24"
				_model, err := vpcService.NewSecurityGroupRuleLocalPrototypeCIDR(cidrBlock)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRuleLocalPrototypeIP successfully`, func() {
				address := "192.168.3.4"
				_model, err := vpcService.NewSecurityGroupRuleLocalPrototypeIP(address)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll successfully`, func() {
				direction := "inbound"
				protocol := "all"
				_model, err := vpcService.NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(direction, protocol)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp successfully`, func() {
				direction := "inbound"
				protocol := "icmp"
				_model, err := vpcService.NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp(direction, protocol)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp successfully`, func() {
				direction := "inbound"
				protocol := "tcp"
				_model, err := vpcService.NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp(direction, protocol)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRuleRemotePatchCIDR successfully`, func() {
				cidrBlock := "192.168.3.0/24"
				_model, err := vpcService.NewSecurityGroupRuleRemotePatchCIDR(cidrBlock)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRuleRemotePatchIP successfully`, func() {
				address := "192.168.3.4"
				_model, err := vpcService.NewSecurityGroupRuleRemotePatchIP(address)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRuleRemotePrototypeCIDR successfully`, func() {
				cidrBlock := "192.168.3.0/24"
				_model, err := vpcService.NewSecurityGroupRuleRemotePrototypeCIDR(cidrBlock)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRuleRemotePrototypeIP successfully`, func() {
				address := "192.168.3.4"
				_model, err := vpcService.NewSecurityGroupRuleRemotePrototypeIP(address)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewShareIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58"
				_model, err := vpcService.NewShareIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewShareIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58"
				_model, err := vpcService.NewShareIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewShareIdentityByID successfully`, func() {
				id := "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58"
				_model, err := vpcService.NewShareIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup successfully`, func() {
				accessProtocol := "nfs4"
				transitEncryption := "none"
				var virtualNetworkInterface vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeIntf = nil
				_, err := vpcService.NewShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(accessProtocol, transitEncryption, virtualNetworkInterface)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC successfully`, func() {
				accessProtocol := "nfs4"
				transitEncryption := "none"
				var vpc vpcv1.VPCIdentityIntf = nil
				_, err := vpcService.NewShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(accessProtocol, transitEncryption, vpc)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewShareProfileIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops"
				_model, err := vpcService.NewShareProfileIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewShareProfileIdentityByName successfully`, func() {
				name := "tier-3iops"
				_model, err := vpcService.NewShareProfileIdentityByName(name)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSharePrototypeShareByOriginShare successfully`, func() {
				var originShare vpcv1.ShareIdentityIntf = nil
				_, err := vpcService.NewSharePrototypeShareByOriginShare(originShare)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewSharePrototypeShareBySize successfully`, func() {
				var profile vpcv1.ShareProfileIdentityIntf = nil
				size := int64(200)
				_, err := vpcService.NewSharePrototypeShareBySize(profile, size)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewSharePrototypeShareBySourceShare successfully`, func() {
				var profile vpcv1.ShareProfileIdentityIntf = nil
				replicationCronSpec := "0 */5 * * *"
				var sourceShare vpcv1.ShareIdentityIntf = nil
				_, err := vpcService.NewSharePrototypeShareBySourceShare(profile, replicationCronSpec, sourceShare)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewSharePrototypeShareBySourceSnapshot successfully`, func() {
				var profile vpcv1.ShareProfileIdentityIntf = nil
				var sourceSnapshot vpcv1.ShareSourceSnapshotPrototypeIntf = nil
				_, err := vpcService.NewSharePrototypeShareBySourceSnapshot(profile, sourceSnapshot)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots successfully`, func() {
				snapshots := []vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext{}
				_model, err := vpcService.NewSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots(snapshots)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSnapshotIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"
				_model, err := vpcService.NewSnapshotIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSnapshotIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263"
				_model, err := vpcService.NewSnapshotIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSnapshotIdentityByID successfully`, func() {
				id := "r006-f6bfa329-0e36-433f-a3bb-0df632e79263"
				_model, err := vpcService.NewSnapshotIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSnapshotPrototypeSnapshotBySourceSnapshot successfully`, func() {
				var sourceSnapshot *vpcv1.SnapshotIdentityByCRN = nil
				_, err := vpcService.NewSnapshotPrototypeSnapshotBySourceSnapshot(sourceSnapshot)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewSnapshotPrototypeSnapshotBySourceVolume successfully`, func() {
				var sourceVolume vpcv1.VolumeIdentityIntf = nil
				_, err := vpcService.NewSnapshotPrototypeSnapshotBySourceVolume(sourceVolume)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewSubnetIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"
				_model, err := vpcService.NewSubnetIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSubnetIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"
				_model, err := vpcService.NewSubnetIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSubnetIdentityByID successfully`, func() {
				id := "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"
				_model, err := vpcService.NewSubnetIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSubnetPrototypeSubnetByCIDR successfully`, func() {
				var vpc vpcv1.VPCIdentityIntf = nil
				ipv4CIDRBlock := "10.0.0.0/24"
				_, err := vpcService.NewSubnetPrototypeSubnetByCIDR(vpc, ipv4CIDRBlock)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewSubnetPrototypeSubnetByTotalCount successfully`, func() {
				var vpc vpcv1.VPCIdentityIntf = nil
				totalIpv4AddressCount := int64(256)
				var zone vpcv1.ZoneIdentityIntf = nil
				_, err := vpcService.NewSubnetPrototypeSubnetByTotalCount(vpc, totalIpv4AddressCount, zone)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewSubnetPublicGatewayPatchPublicGatewayIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241"
				_model, err := vpcService.NewSubnetPublicGatewayPatchPublicGatewayIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSubnetPublicGatewayPatchPublicGatewayIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241"
				_model, err := vpcService.NewSubnetPublicGatewayPatchPublicGatewayIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSubnetPublicGatewayPatchPublicGatewayIdentityByID successfully`, func() {
				id := "r006-dc5431ef-1fc6-4861-adc9-a59d077d1241"
				_model, err := vpcService.NewSubnetPublicGatewayPatchPublicGatewayIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewTrustedProfileIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"
				_model, err := vpcService.NewTrustedProfileIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewTrustedProfileIdentityByID successfully`, func() {
				id := "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"
				_model, err := vpcService.NewTrustedProfileIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype successfully`, func() {
				manualServers := []vpcv1.DnsServerPrototype{}
				typeVar := "manual"
				_model, err := vpcService.NewVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype(manualServers, typeVar)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVpcdnsResolverVPCPatchVPCIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"
				_model, err := vpcService.NewVpcdnsResolverVPCPatchVPCIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVpcdnsResolverVPCPatchVPCIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"
				_model, err := vpcService.NewVpcdnsResolverVPCPatchVPCIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVpcdnsResolverVPCPatchVPCIdentityByID successfully`, func() {
				id := "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"
				_model, err := vpcService.NewVpcdnsResolverVPCPatchVPCIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPCIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"
				_model, err := vpcService.NewVPCIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPCIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"
				_model, err := vpcService.NewVPCIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPCIdentityByID successfully`, func() {
				id := "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"
				_model, err := vpcService.NewVPCIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress successfully`, func() {
				asn := int64(38)
				address := "192.0.2.5"
				_model, err := vpcService.NewVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress(asn, address)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn successfully`, func() {
				asn := int64(38)
				fqdn := "my-service.example.com"
				_model, err := vpcService.NewVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn(asn, fqdn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn successfully`, func() {
				typeVar := "fqdn"
				value := "my-service.example.com"
				_model, err := vpcService.NewVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn(typeVar, value)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityHostname successfully`, func() {
				typeVar := "fqdn"
				value := "my-hostname"
				_model, err := vpcService.NewVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityHostname(typeVar, value)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityIPv4 successfully`, func() {
				typeVar := "fqdn"
				value := "192.168.3.4"
				_model, err := vpcService.NewVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityIPv4(typeVar, value)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityKeyID successfully`, func() {
				typeVar := "fqdn"
				value := "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ=="
				_model, err := vpcService.NewVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityKeyID(typeVar, value)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d"
				_model, err := vpcService.NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID successfully`, func() {
				id := "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d"
				_model, err := vpcService.NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d"
				_model, err := vpcService.NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID successfully`, func() {
				id := "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d"
				_model, err := vpcService.NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876"
				_model, err := vpcService.NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID successfully`, func() {
				id := "r006-51eae621-dbbc-4c47-b623-b57a43c19876"
				_model, err := vpcService.NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876"
				_model, err := vpcService.NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID successfully`, func() {
				id := "r006-51eae621-dbbc-4c47-b623-b57a43c19876"
				_model, err := vpcService.NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionPolicyModePeerPrototypeVPNGatewayConnectionPeerByAddress successfully`, func() {
				cidrs := []string{"203.0.113.0/24"}
				address := "192.0.2.5"
				_model, err := vpcService.NewVPNGatewayConnectionPolicyModePeerPrototypeVPNGatewayConnectionPeerByAddress(cidrs, address)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionPolicyModePeerPrototypeVPNGatewayConnectionPeerByFqdn successfully`, func() {
				cidrs := []string{"203.0.113.0/24"}
				fqdn := "my-service.example.com"
				_model, err := vpcService.NewVPNGatewayConnectionPolicyModePeerPrototypeVPNGatewayConnectionPeerByFqdn(cidrs, fqdn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype successfully`, func() {
				psk := "lkj14b1oi0alcniejkso"
				var peer vpcv1.VPNGatewayConnectionDynamicRouteModePeerPrototypeIntf = nil
				routingProtocol := "bgp"
				tunnels := []vpcv1.VPNGatewayConnectionTunnelPrototype{}
				_, err := vpcService.NewVPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype(psk, peer, routingProtocol, tunnels)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype successfully`, func() {
				psk := "lkj14b1oi0alcniejkso"
				var local *vpcv1.VPNGatewayConnectionPolicyModeLocalPrototype = nil
				var peer vpcv1.VPNGatewayConnectionPolicyModePeerPrototypeIntf = nil
				_, err := vpcService.NewVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(psk, local, peer)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype successfully`, func() {
				psk := "lkj14b1oi0alcniejkso"
				var peer vpcv1.VPNGatewayConnectionStaticRouteModePeerPrototypeIntf = nil
				_, err := vpcService.NewVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(psk, peer)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress successfully`, func() {
				address := "192.0.2.5"
				_model, err := vpcService.NewVPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress(address)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn successfully`, func() {
				fqdn := "my-service.example.com"
				_model, err := vpcService.NewVPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn(fqdn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNGatewayPrototypeVPNGatewayPolicyModePrototype successfully`, func() {
				var subnet vpcv1.SubnetIdentityIntf = nil
				mode := "policy"
				_, err := vpcService.NewVPNGatewayPrototypeVPNGatewayPolicyModePrototype(subnet, mode)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVPNGatewayPrototypeVPNGatewayRouteModePrototype successfully`, func() {
				var subnet vpcv1.SubnetIdentityIntf = nil
				_, err := vpcService.NewVPNGatewayPrototypeVPNGatewayRouteModePrototype(subnet)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVPNServerAuthenticationByUsernameIDProviderByIam successfully`, func() {
				providerType := "iam"
				_model, err := vpcService.NewVPNServerAuthenticationByUsernameIDProviderByIam(providerType)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype successfully`, func() {
				method := "certificate"
				var clientCa vpcv1.CertificateInstanceIdentityIntf = nil
				_, err := vpcService.NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype(method, clientCa)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype successfully`, func() {
				method := "username"
				var identityProvider vpcv1.VPNServerAuthenticationByUsernameIDProviderIntf = nil
				_, err := vpcService.NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype(method, identityProvider)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVolumeIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"
				_model, err := vpcService.NewVolumeIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVolumeIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"
				_model, err := vpcService.NewVolumeIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVolumeIdentityByID successfully`, func() {
				id := "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"
				_model, err := vpcService.NewVolumeIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVolumeProfileIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose"
				_model, err := vpcService.NewVolumeProfileIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVolumeProfileIdentityByName successfully`, func() {
				name := "general-purpose"
				_model, err := vpcService.NewVolumeProfileIdentityByName(name)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVolumePrototypeVolumeByCapacity successfully`, func() {
				var profile vpcv1.VolumeProfileIdentityIntf = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				capacity := int64(100)
				_, err := vpcService.NewVolumePrototypeVolumeByCapacity(profile, zone, capacity)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVolumePrototypeVolumeBySourceSnapshot successfully`, func() {
				var profile vpcv1.VolumeProfileIdentityIntf = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var sourceSnapshot vpcv1.SnapshotIdentityIntf = nil
				_, err := vpcService.NewVolumePrototypeVolumeBySourceSnapshot(profile, zone, sourceSnapshot)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewZoneIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1"
				_model, err := vpcService.NewZoneIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewZoneIdentityByName successfully`, func() {
				name := "us-south-1"
				_model, err := vpcService.NewZoneIdentityByName(name)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce"
				_model, err := vpcService.NewBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID successfully`, func() {
				id := "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117"
				_model, err := vpcService.NewClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByID successfully`, func() {
				id := "0717-d4d6489a-3bf5-4104-a33a-3572faf2d117"
				_model, err := vpcService.NewClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewEndpointGatewayReservedIPReservedIPIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"
				_model, err := vpcService.NewEndpointGatewayReservedIPReservedIPIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewEndpointGatewayReservedIPReservedIPIdentityByID successfully`, func() {
				id := "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"
				_model, err := vpcService.NewEndpointGatewayReservedIPReservedIPIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6"
				_model, err := vpcService.NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID successfully`, func() {
				id := "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6"
				_model, err := vpcService.NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7"
				_model, err := vpcService.NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID successfully`, func() {
				id := "0717-d54eb633-98ea-459d-aa00-6a8e780175a7"
				_model, err := vpcService.NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID successfully`, func() {
				id := "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6"
				_model, err := vpcService.NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID successfully`, func() {
				id := "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6"
				_model, err := vpcService.NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7"
				_model, err := vpcService.NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID successfully`, func() {
				id := "0717-d54eb633-98ea-459d-aa00-6a8e780175a7"
				_model, err := vpcService.NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID successfully`, func() {
				id := "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID successfully`, func() {
				id := "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID successfully`, func() {
				id := "0717-d54eb633-98ea-459d-aa00-6a8e780175a7"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID successfully`, func() {
				id := "0717-d54eb633-98ea-459d-aa00-6a8e780175a7"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID successfully`, func() {
				id := "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID successfully`, func() {
				id := "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID successfully`, func() {
				id := "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb"
				_model, err := vpcService.NewInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByID successfully`, func() {
				id := "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb"
				_model, err := vpcService.NewInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup successfully`, func() {
				cronSpec := "30 */2 * * 1-5"
				var group *vpcv1.InstanceGroupManagerScheduledActionGroupPrototype = nil
				_, err := vpcService.NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup(cronSpec, group)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager successfully`, func() {
				cronSpec := "30 */2 * * 1-5"
				var manager vpcv1.InstanceGroupManagerScheduledActionManagerPrototypeIntf = nil
				_, err := vpcService.NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager(cronSpec, manager)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup successfully`, func() {
				var group *vpcv1.InstanceGroupManagerScheduledActionGroupPrototype = nil
				runAt := CreateMockDateTime("2019-01-01T12:00:00.000Z")
				_, err := vpcService.NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup(group, runAt)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager successfully`, func() {
				var manager vpcv1.InstanceGroupManagerScheduledActionManagerPrototypeIntf = nil
				runAt := CreateMockDateTime("2019-01-01T12:00:00.000Z")
				_, err := vpcService.NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager(manager, runAt)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea"
				_model, err := vpcService.NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID successfully`, func() {
				id := "r006-bd21f31f-8a05-4451-836d-ab0347e91fea"
				_model, err := vpcService.NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID successfully`, func() {
				id := "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0"
				_model, err := vpcService.NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0"
				_model, err := vpcService.NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID successfully`, func() {
				id := "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0"
				_model, err := vpcService.NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a"
				_model, err := vpcService.NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a"
				_model, err := vpcService.NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID successfully`, func() {
				id := "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"
				_model, err := vpcService.NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0"
				_model, err := vpcService.NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0"
				_model, err := vpcService.NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID successfully`, func() {
				id := "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0"
				_model, err := vpcService.NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a"
				_model, err := vpcService.NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a"
				_model, err := vpcService.NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID successfully`, func() {
				id := "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"
				_model, err := vpcService.NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871"
				_model, err := vpcService.NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871"
				_model, err := vpcService.NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID successfully`, func() {
				id := "r006-418fe842-a3e9-47b9-a938-1aa5bd632871"
				_model, err := vpcService.NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment successfully`, func() {
				var catalogOffering vpcv1.InstanceCatalogOfferingPrototypeIntf = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkAttachment *vpcv1.InstanceNetworkAttachmentPrototype = nil
				_, err := vpcService.NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment(catalogOffering, zone, primaryNetworkAttachment)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface successfully`, func() {
				var catalogOffering vpcv1.InstanceCatalogOfferingPrototypeIntf = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkInterface *vpcv1.NetworkInterfacePrototype = nil
				_, err := vpcService.NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface(catalogOffering, zone, primaryNetworkInterface)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment successfully`, func() {
				var image vpcv1.ImageIdentityIntf = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkAttachment *vpcv1.InstanceNetworkAttachmentPrototype = nil
				_, err := vpcService.NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment(image, zone, primaryNetworkAttachment)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface successfully`, func() {
				var image vpcv1.ImageIdentityIntf = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkInterface *vpcv1.NetworkInterfacePrototype = nil
				_, err := vpcService.NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface(image, zone, primaryNetworkInterface)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment successfully`, func() {
				var bootVolumeAttachment *vpcv1.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkAttachment *vpcv1.InstanceNetworkAttachmentPrototype = nil
				_, err := vpcService.NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment(bootVolumeAttachment, zone, primaryNetworkAttachment)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface successfully`, func() {
				var bootVolumeAttachment *vpcv1.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkInterface *vpcv1.NetworkInterfacePrototype = nil
				_, err := vpcService.NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface(bootVolumeAttachment, zone, primaryNetworkInterface)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment successfully`, func() {
				var bootVolumeAttachment *vpcv1.VolumeAttachmentPrototypeInstanceByVolumeContext = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkAttachment *vpcv1.InstanceNetworkAttachmentPrototype = nil
				_, err := vpcService.NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment(bootVolumeAttachment, zone, primaryNetworkAttachment)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface successfully`, func() {
				var bootVolumeAttachment *vpcv1.VolumeAttachmentPrototypeInstanceByVolumeContext = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkInterface *vpcv1.NetworkInterfacePrototype = nil
				_, err := vpcService.NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface(bootVolumeAttachment, zone, primaryNetworkInterface)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment successfully`, func() {
				var catalogOffering vpcv1.InstanceCatalogOfferingPrototypeIntf = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkAttachment *vpcv1.InstanceNetworkAttachmentPrototype = nil
				_, err := vpcService.NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment(catalogOffering, zone, primaryNetworkAttachment)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface successfully`, func() {
				var catalogOffering vpcv1.InstanceCatalogOfferingPrototypeIntf = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkInterface *vpcv1.NetworkInterfacePrototype = nil
				_, err := vpcService.NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface(catalogOffering, zone, primaryNetworkInterface)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment successfully`, func() {
				var image vpcv1.ImageIdentityIntf = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkAttachment *vpcv1.InstanceNetworkAttachmentPrototype = nil
				_, err := vpcService.NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment(image, zone, primaryNetworkAttachment)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface successfully`, func() {
				var image vpcv1.ImageIdentityIntf = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkInterface *vpcv1.NetworkInterfacePrototype = nil
				_, err := vpcService.NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface(image, zone, primaryNetworkInterface)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment successfully`, func() {
				var bootVolumeAttachment *vpcv1.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkAttachment *vpcv1.InstanceNetworkAttachmentPrototype = nil
				_, err := vpcService.NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment(bootVolumeAttachment, zone, primaryNetworkAttachment)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface successfully`, func() {
				var bootVolumeAttachment *vpcv1.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext = nil
				var zone vpcv1.ZoneIdentityIntf = nil
				var primaryNetworkInterface *vpcv1.NetworkInterfacePrototype = nil
				_, err := vpcService.NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface(bootVolumeAttachment, zone, primaryNetworkInterface)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentityLoadBalancerListenerIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"
				_model, err := vpcService.NewLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentityLoadBalancerListenerIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentityLoadBalancerListenerIdentityByID successfully`, func() {
				id := "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"
				_model, err := vpcService.NewLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentityLoadBalancerListenerIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004"
				_model, err := vpcService.NewLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID successfully`, func() {
				id := "r006-70294e14-4e61-11e8-bcf4-0242ac110004"
				_model, err := vpcService.NewLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentityLoadBalancerListenerIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"
				_model, err := vpcService.NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentityLoadBalancerListenerIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentityLoadBalancerListenerIdentityByID successfully`, func() {
				id := "r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091"
				_model, err := vpcService.NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentityLoadBalancerListenerIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004"
				_model, err := vpcService.NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID successfully`, func() {
				id := "r006-70294e14-4e61-11e8-bcf4-0242ac110004"
				_model, err := vpcService.NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0"
				_model, err := vpcService.NewLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0"
				_model, err := vpcService.NewLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID successfully`, func() {
				id := "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0"
				_model, err := vpcService.NewLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"
				_model, err := vpcService.NewLoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"
				_model, err := vpcService.NewLoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByID successfully`, func() {
				id := "r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"
				_model, err := vpcService.NewLoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"
				_model, err := vpcService.NewLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID successfully`, func() {
				id := "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"
				_model, err := vpcService.NewLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkInterfaceIPPrototypeReservedIPIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"
				_model, err := vpcService.NewNetworkInterfaceIPPrototypeReservedIPIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewNetworkInterfaceIPPrototypeReservedIPIdentityByID successfully`, func() {
				id := "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"
				_model, err := vpcService.NewNetworkInterfaceIPPrototypeReservedIPIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress successfully`, func() {
				address := "203.0.113.1"
				_model, err := vpcService.NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress(address)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd"
				_model, err := vpcService.NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd"
				_model, err := vpcService.NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID successfully`, func() {
				id := "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd"
				_model, err := vpcService.NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0"
				_model, err := vpcService.NewReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0"
				_model, err := vpcService.NewReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID successfully`, func() {
				id := "r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0"
				_model, err := vpcService.NewReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID successfully`, func() {
				id := "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewRouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP successfully`, func() {
				address := "0.0.0.0"
				_model, err := vpcService.NewRouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP(address)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewRouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP successfully`, func() {
				address := "192.168.3.4"
				_model, err := vpcService.NewRouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP(address)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c"
				_model, err := vpcService.NewRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID successfully`, func() {
				id := "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c"
				_model, err := vpcService.NewRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP successfully`, func() {
				address := "0.0.0.0"
				_model, err := vpcService.NewRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP(address)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP successfully`, func() {
				address := "192.168.3.4"
				_model, err := vpcService.NewRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP(address)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c"
				_model, err := vpcService.NewRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID successfully`, func() {
				id := "0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c"
				_model, err := vpcService.NewRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"
				_model, err := vpcService.NewSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"
				_model, err := vpcService.NewSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID successfully`, func() {
				id := "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"
				_model, err := vpcService.NewSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"
				_model, err := vpcService.NewSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"
				_model, err := vpcService.NewSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID successfully`, func() {
				id := "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"
				_model, err := vpcService.NewSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID successfully`, func() {
				id := "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef"
				_model, err := vpcService.NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4"
				_model, err := vpcService.NewShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4"
				_model, err := vpcService.NewShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByID successfully`, func() {
				id := "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4"
				_model, err := vpcService.NewShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"
				_model, err := vpcService.NewVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID successfully`, func() {
				id := "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"
				_model, err := vpcService.NewVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"
				_model, err := vpcService.NewVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID successfully`, func() {
				id := "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"
				_model, err := vpcService.NewVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN successfully`, func() {
				crn := "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"
				_model, err := vpcService.NewVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN(crn)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref successfully`, func() {
				href := "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"
				_model, err := vpcService.NewVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref(href)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID successfully`, func() {
				id := "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"
				_model, err := vpcService.NewVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID(id)
				Expect(_model).ToNot(BeNil())
				Expect(err).To(BeNil())
			})
			It(`Invoke NewVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity successfully`, func() {
				var profile vpcv1.VolumeProfileIdentityIntf = nil
				capacity := int64(100)
				_, err := vpcService.NewVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity(profile, capacity)
				Expect(err).ToNot(BeNil())
			})
			It(`Invoke NewVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot successfully`, func() {
				var profile vpcv1.VolumeProfileIdentityIntf = nil
				var sourceSnapshot vpcv1.SnapshotIdentityIntf = nil
				_, err := vpcService.NewVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot(profile, sourceSnapshot)
				Expect(err).ToNot(BeNil())
			})
		})
	})
	Describe(`Model unmarshaling tests`, func() {
		It(`Invoke UnmarshalAccountIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.AccountIdentity)
			model.ID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.AccountIdentity
			err = vpcv1.UnmarshalAccountIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalAddressPrefixPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.AddressPrefixPatch)
			model.IsDefault = core.BoolPtr(false)
			model.Name = core.StringPtr("my-vpc-address-prefix-zone-1")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.AddressPrefixPatch
			err = vpcv1.UnmarshalAddressPrefixPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyPatch)
			model.IncludedContent = []string{"data_volumes"}
			model.MatchUserTags = []string{"my-daily-backup-policy"}
			model.Name = core.StringPtr("my-backup-policy")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyPatch
			err = vpcv1.UnmarshalBackupPolicyPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyPlanClonePolicyPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyPlanClonePolicyPatch)
			model.MaxSnapshots = core.Int64Ptr(int64(1))
			model.Zones = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyPlanClonePolicyPatch
			err = vpcv1.UnmarshalBackupPolicyPlanClonePolicyPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyPlanClonePolicyPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyPlanClonePolicyPrototype)
			model.MaxSnapshots = core.Int64Ptr(int64(5))
			model.Zones = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyPlanClonePolicyPrototype
			err = vpcv1.UnmarshalBackupPolicyPlanClonePolicyPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyPlanDeletionTriggerPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyPlanDeletionTriggerPatch)
			model.DeleteAfter = core.Int64Ptr(int64(20))
			model.DeleteOverCount = core.Int64Ptr(int64(1))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyPlanDeletionTriggerPatch
			err = vpcv1.UnmarshalBackupPolicyPlanDeletionTriggerPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyPlanDeletionTriggerPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyPlanDeletionTriggerPrototype)
			model.DeleteAfter = core.Int64Ptr(int64(20))
			model.DeleteOverCount = core.Int64Ptr(int64(20))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyPlanDeletionTriggerPrototype
			err = vpcv1.UnmarshalBackupPolicyPlanDeletionTriggerPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyPlanPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyPlanPatch)
			model.Active = core.BoolPtr(true)
			model.AttachUserTags = []string{"my-daily-backup-plan"}
			model.ClonePolicy = nil
			model.CopyUserTags = core.BoolPtr(true)
			model.CronSpec = core.StringPtr("30 */2 * * 1-5")
			model.DeletionTrigger = nil
			model.Name = core.StringPtr("my-policy-plan")
			model.RemoteRegionPolicies = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyPlanPatch
			err = vpcv1.UnmarshalBackupPolicyPlanPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyPlanPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyPlanPrototype)
			model.Active = core.BoolPtr(true)
			model.AttachUserTags = []string{"my-daily-backup-plan"}
			model.ClonePolicy = nil
			model.CopyUserTags = core.BoolPtr(true)
			model.CronSpec = core.StringPtr("30 */2 * * 1-5")
			model.DeletionTrigger = nil
			model.Name = core.StringPtr("my-policy-plan")
			model.RemoteRegionPolicies = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyPlanPrototype
			err = vpcv1.UnmarshalBackupPolicyPlanPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype)
			model.DeleteOverCount = core.Int64Ptr(int64(5))
			model.EncryptionKey = nil
			model.Region = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyPlanRemoteRegionPolicyPrototype
			err = vpcv1.UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyPrototype)
			model.MatchResourceType = core.StringPtr("instance")
			model.MatchUserTags = []string{"my-daily-backup-policy"}
			model.Name = core.StringPtr("my-backup-policy")
			model.Plans = nil
			model.ResourceGroup = nil
			model.Scope = nil
			model.IncludedContent = []string{"boot_volume", "data_volumes"}

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyPrototype
			err = vpcv1.UnmarshalBackupPolicyPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyScopePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyScopePrototype)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyScopePrototype
			err = vpcv1.UnmarshalBackupPolicyScopePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerDiskPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerDiskPatch)
			model.Name = core.StringPtr("my-bare-metal-server-disk-updated")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerDiskPatch
			err = vpcv1.UnmarshalBareMetalServerDiskPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerInitializationDefaultTrustedProfilePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerInitializationDefaultTrustedProfilePrototype)
			model.AutoLink = core.BoolPtr(false)
			model.Target = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerInitializationDefaultTrustedProfilePrototype
			err = vpcv1.UnmarshalBareMetalServerInitializationDefaultTrustedProfilePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerInitializationPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerInitializationPrototype)
			model.DefaultTrustedProfile = nil
			model.Image = nil
			model.Keys = nil
			model.UserData = core.StringPtr("testString")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerInitializationPrototype
			err = vpcv1.UnmarshalBareMetalServerInitializationPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerMetadataServicePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerMetadataServicePatch)
			model.Enabled = core.BoolPtr(true)
			model.Protocol = core.StringPtr("http")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerMetadataServicePatch
			err = vpcv1.UnmarshalBareMetalServerMetadataServicePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerMetadataServicePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerMetadataServicePrototype)
			model.Enabled = core.BoolPtr(true)
			model.Protocol = core.StringPtr("https")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerMetadataServicePrototype
			err = vpcv1.UnmarshalBareMetalServerMetadataServicePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkAttachmentPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkAttachmentPatch)
			model.AllowedVlans = []int64{int64(4)}
			model.Name = core.StringPtr("my-bare-metal-server-network-attachment-updated")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerNetworkAttachmentPatch
			err = vpcv1.UnmarshalBareMetalServerNetworkAttachmentPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkAttachmentPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkAttachmentPrototype)
			model.InterfaceType = core.StringPtr("pci")
			model.Name = core.StringPtr("my-bare-metal-server-network-attachment")
			model.VirtualNetworkInterface = nil
			model.AllowedVlans = nil
			model.AllowToFloat = core.BoolPtr(false)
			model.Vlan = core.Int64Ptr(int64(4))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerNetworkAttachmentPrototype
			err = vpcv1.UnmarshalBareMetalServerNetworkAttachmentPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.AutoDelete = core.BoolPtr(false)
			model.EnableInfrastructureNat = core.BoolPtr(true)
			model.Ips = nil
			model.Name = core.StringPtr("my-virtual-network-interface")
			model.PrimaryIP = nil
			model.ProtocolStateFilteringMode = core.StringPtr("auto")
			model.ResourceGroup = nil
			model.SecurityGroups = nil
			model.Subnet = nil
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface
			err = vpcv1.UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkInterfacePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkInterfacePatch)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.AllowedVlans = []int64{int64(4)}
			model.EnableInfrastructureNat = core.BoolPtr(true)
			model.Name = core.StringPtr("my-bare-metal-server-network-interface")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerNetworkInterfacePatch
			err = vpcv1.UnmarshalBareMetalServerNetworkInterfacePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkInterfacePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkInterfacePrototype)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.EnableInfrastructureNat = core.BoolPtr(true)
			model.InterfaceType = core.StringPtr("hipersocket")
			model.Name = core.StringPtr("my-bare-metal-server-network-interface")
			model.PrimaryIP = nil
			model.SecurityGroups = nil
			model.Subnet = nil
			model.AllowedVlans = nil
			model.AllowInterfaceToFloat = core.BoolPtr(false)
			model.Vlan = core.Int64Ptr(int64(4))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result interface{}
			err = vpcv1.UnmarshalBareMetalServerNetworkInterfacePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
		})
		It(`Invoke UnmarshalBareMetalServerPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerPatch)
			model.Bandwidth = core.Int64Ptr(int64(20000))
			model.EnableSecureBoot = core.BoolPtr(false)
			model.MetadataService = nil
			model.Name = core.StringPtr("my-bare-metal-server")
			model.ReservationAffinity = nil
			model.TrustedPlatformModule = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerPatch
			err = vpcv1.UnmarshalBareMetalServerPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerPrimaryNetworkAttachmentPrototype)
			model.InterfaceType = core.StringPtr("pci")
			model.Name = core.StringPtr("my-bare-metal-server-network-attachment")
			model.VirtualNetworkInterface = nil
			model.AllowedVlans = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerPrimaryNetworkAttachmentPrototype
			err = vpcv1.UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerPrimaryNetworkInterfacePrototype)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.AllowedVlans = []int64{int64(4)}
			model.EnableInfrastructureNat = core.BoolPtr(true)
			model.InterfaceType = core.StringPtr("pci")
			model.Name = core.StringPtr("my-bare-metal-server-network-interface")
			model.PrimaryIP = nil
			model.SecurityGroups = nil
			model.Subnet = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerPrimaryNetworkInterfacePrototype
			err = vpcv1.UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerProfileIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerProfileIdentity)
			model.Name = core.StringPtr("bx2-metal-192x768")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerProfileIdentity
			err = vpcv1.UnmarshalBareMetalServerProfileIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerPrototype)
			model.Bandwidth = core.Int64Ptr(int64(20000))
			model.EnableSecureBoot = core.BoolPtr(false)
			model.Initialization = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-bare-metal-server")
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TrustedPlatformModule = nil
			model.VPC = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerPrototype
			err = vpcv1.UnmarshalBareMetalServerPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerReservationAffinityPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerReservationAffinityPatch)
			model.Policy = core.StringPtr("automatic")
			model.Pool = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerReservationAffinityPatch
			err = vpcv1.UnmarshalBareMetalServerReservationAffinityPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerReservationAffinityPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerReservationAffinityPrototype)
			model.Policy = core.StringPtr("automatic")
			model.Pool = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerReservationAffinityPrototype
			err = vpcv1.UnmarshalBareMetalServerReservationAffinityPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerTrustedPlatformModulePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerTrustedPlatformModulePatch)
			model.Mode = core.StringPtr("disabled")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerTrustedPlatformModulePatch
			err = vpcv1.UnmarshalBareMetalServerTrustedPlatformModulePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerTrustedPlatformModulePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerTrustedPlatformModulePrototype)
			model.Mode = core.StringPtr("disabled")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerTrustedPlatformModulePrototype
			err = vpcv1.UnmarshalBareMetalServerTrustedPlatformModulePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalCatalogOfferingIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.CatalogOfferingIdentity)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.CatalogOfferingIdentity
			err = vpcv1.UnmarshalCatalogOfferingIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalCatalogOfferingVersionIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.CatalogOfferingVersionIdentity)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.CatalogOfferingVersionIdentity
			err = vpcv1.UnmarshalCatalogOfferingVersionIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalCatalogOfferingVersionPlanIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.CatalogOfferingVersionPlanIdentity)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.CatalogOfferingVersionPlanIdentity
			err = vpcv1.UnmarshalCatalogOfferingVersionPlanIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalCertificateInstanceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.CertificateInstanceIdentity)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.CertificateInstanceIdentity
			err = vpcv1.UnmarshalCertificateInstanceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalCloudObjectStorageBucketIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.CloudObjectStorageBucketIdentity)
			model.Name = core.StringPtr("bucket-27200-lwx4cfvcue")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.CloudObjectStorageBucketIdentity
			err = vpcv1.UnmarshalCloudObjectStorageBucketIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkInterfacePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkInterfacePatch)
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-cluster-network-interface")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkInterfacePatch
			err = vpcv1.UnmarshalClusterNetworkInterfacePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkInterfacePrimaryIPPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototype)
			model.ID = core.StringPtr("0717-d4d6489a-3bf5-4104-a33a-3572faf2d117")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117")
			model.Address = core.StringPtr("192.168.3.4")
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkInterfacePrimaryIPPrototype
			err = vpcv1.UnmarshalClusterNetworkInterfacePrimaryIPPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkPatch)
			model.Name = core.StringPtr("my-cluster-network")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkPatch
			err = vpcv1.UnmarshalClusterNetworkPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkProfileIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkProfileIdentity)
			model.Name = core.StringPtr("h100")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkProfileIdentity
			err = vpcv1.UnmarshalClusterNetworkProfileIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkSubnetIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkSubnetIdentity)
			model.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkSubnetIdentity
			err = vpcv1.UnmarshalClusterNetworkSubnetIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkSubnetPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkSubnetPatch)
			model.Name = core.StringPtr("my-cluster-network-subnet")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkSubnetPatch
			err = vpcv1.UnmarshalClusterNetworkSubnetPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkSubnetPrefixPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkSubnetPrefixPrototype)
			model.CIDR = core.StringPtr("10.0.0.0/24")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkSubnetPrefixPrototype
			err = vpcv1.UnmarshalClusterNetworkSubnetPrefixPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkSubnetPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkSubnetPrototype)
			model.IPVersion = core.StringPtr("ipv4")
			model.Name = core.StringPtr("my-cluster-network-subnet")
			model.TotalIpv4AddressCount = core.Int64Ptr(int64(256))
			model.Ipv4CIDRBlock = core.StringPtr("10.0.0.0/24")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkSubnetPrototype
			err = vpcv1.UnmarshalClusterNetworkSubnetPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkSubnetReservedIPPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkSubnetReservedIPPatch)
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkSubnetReservedIPPatch
			err = vpcv1.UnmarshalClusterNetworkSubnetReservedIPPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDnsInstanceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DnsInstanceIdentity)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DnsInstanceIdentity
			err = vpcv1.UnmarshalDnsInstanceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDnsServerPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DnsServerPrototype)
			model.Address = core.StringPtr("192.168.3.4")
			model.ZoneAffinity = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DnsServerPrototype
			err = vpcv1.UnmarshalDnsServerPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDnsZoneIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DnsZoneIdentity)
			model.ID = core.StringPtr("d66662cc-aa23-4fe1-9987-858487a61f45")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DnsZoneIdentity
			err = vpcv1.UnmarshalDnsZoneIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDedicatedHostDiskPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DedicatedHostDiskPatch)
			model.Name = core.StringPtr("my-dedicated-host-disk-updated")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DedicatedHostDiskPatch
			err = vpcv1.UnmarshalDedicatedHostDiskPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDedicatedHostGroupIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DedicatedHostGroupIdentity)
			model.ID = core.StringPtr("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DedicatedHostGroupIdentity
			err = vpcv1.UnmarshalDedicatedHostGroupIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDedicatedHostGroupPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DedicatedHostGroupPatch)
			model.Name = core.StringPtr("my-dedicated-host-group")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DedicatedHostGroupPatch
			err = vpcv1.UnmarshalDedicatedHostGroupPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DedicatedHostGroupPrototypeDedicatedHostByZoneContext)
			model.Name = core.StringPtr("my-dedicated-host-group")
			model.ResourceGroup = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DedicatedHostGroupPrototypeDedicatedHostByZoneContext
			err = vpcv1.UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDedicatedHostPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DedicatedHostPatch)
			model.InstancePlacementEnabled = core.BoolPtr(true)
			model.Name = core.StringPtr("my-host")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DedicatedHostPatch
			err = vpcv1.UnmarshalDedicatedHostPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDedicatedHostProfileIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DedicatedHostProfileIdentity)
			model.Name = core.StringPtr("mx2-host-152x1216")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles/mx2-host-152x1216")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DedicatedHostProfileIdentity
			err = vpcv1.UnmarshalDedicatedHostProfileIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDedicatedHostPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DedicatedHostPrototype)
			model.InstancePlacementEnabled = core.BoolPtr(true)
			model.Name = core.StringPtr("my-host")
			model.Profile = nil
			model.ResourceGroup = nil
			model.Group = nil
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DedicatedHostPrototype
			err = vpcv1.UnmarshalDedicatedHostPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEncryptionKeyIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EncryptionKeyIdentity)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EncryptionKeyIdentity
			err = vpcv1.UnmarshalEncryptionKeyIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEndpointGatewayPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EndpointGatewayPatch)
			model.AllowDnsResolutionBinding = core.BoolPtr(true)
			model.AllowResourceBinding = core.BoolPtr(true)
			model.Name = core.StringPtr("my-endpoint-gateway")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EndpointGatewayPatch
			err = vpcv1.UnmarshalEndpointGatewayPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEndpointGatewayReservedIP successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EndpointGatewayReservedIP)
			model.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
			model.Address = core.StringPtr("192.168.3.4")
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-reserved-ip")
			model.Subnet = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EndpointGatewayReservedIP
			err = vpcv1.UnmarshalEndpointGatewayReservedIP(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEndpointGatewayResourceBindingPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EndpointGatewayResourceBindingPatch)
			model.Name = core.StringPtr("my-resource-binding-updated")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EndpointGatewayResourceBindingPatch
			err = vpcv1.UnmarshalEndpointGatewayResourceBindingPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEndpointGatewayResourceBindingTargetPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EndpointGatewayResourceBindingTargetPrototype)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EndpointGatewayResourceBindingTargetPrototype
			err = vpcv1.UnmarshalEndpointGatewayResourceBindingTargetPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEndpointGatewayTargetPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EndpointGatewayTargetPrototype)
			model.ResourceType = core.StringPtr("private_path_service_gateway")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5")
			model.Name = core.StringPtr("ibm-ntp-server")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EndpointGatewayTargetPrototype
			err = vpcv1.UnmarshalEndpointGatewayTargetPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPPatch)
			model.Name = core.StringPtr("my-floating-ip")
			model.Target = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPPatch
			err = vpcv1.UnmarshalFloatingIPPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPPrototype)
			model.Name = core.StringPtr("my-floating-ip")
			model.ResourceGroup = nil
			model.Zone = nil
			model.Target = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPPrototype
			err = vpcv1.UnmarshalFloatingIPPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPatch)
			model.ID = core.StringPtr("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPatch
			err = vpcv1.UnmarshalFloatingIPTargetPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPrototype)
			model.ID = core.StringPtr("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPrototype
			err = vpcv1.UnmarshalFloatingIPTargetPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorPatch)
			model.Active = core.BoolPtr(true)
			model.Name = core.StringPtr("my-flow-log-collector")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorPatch
			err = vpcv1.UnmarshalFlowLogCollectorPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototype)
			model.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototype
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalIkePolicyPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.IkePolicyPatch)
			model.AuthenticationAlgorithm = core.StringPtr("sha256")
			model.DhGroup = core.Int64Ptr(int64(14))
			model.EncryptionAlgorithm = core.StringPtr("aes128")
			model.IkeVersion = core.Int64Ptr(int64(1))
			model.KeyLifetime = core.Int64Ptr(int64(28800))
			model.Name = core.StringPtr("my-ike-policy")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.IkePolicyPatch
			err = vpcv1.UnmarshalIkePolicyPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalIP successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.IP)
			model.Address = core.StringPtr("192.168.3.4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.IP
			err = vpcv1.UnmarshalIP(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalIPsecPolicyPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.IPsecPolicyPatch)
			model.AuthenticationAlgorithm = core.StringPtr("disabled")
			model.EncryptionAlgorithm = core.StringPtr("aes128")
			model.KeyLifetime = core.Int64Ptr(int64(3600))
			model.Name = core.StringPtr("my-ipsec-policy")
			model.Pfs = core.StringPtr("disabled")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.IPsecPolicyPatch
			err = vpcv1.UnmarshalIPsecPolicyPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalImageAllowedUsePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ImageAllowedUsePatch)
			model.ApiVersion = core.StringPtr("2024-06-23")
			model.BareMetalServer = core.StringPtr("enable_secure_boot == true")
			model.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ImageAllowedUsePatch
			err = vpcv1.UnmarshalImageAllowedUsePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalImageAllowedUsePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ImageAllowedUsePrototype)
			model.ApiVersion = core.StringPtr("2024-06-23")
			model.BareMetalServer = core.StringPtr("enable_secure_boot == true")
			model.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ImageAllowedUsePrototype
			err = vpcv1.UnmarshalImageAllowedUsePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalImageExportJobPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ImageExportJobPatch)
			model.Name = core.StringPtr("my-image-export-job")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ImageExportJobPatch
			err = vpcv1.UnmarshalImageExportJobPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalImageFilePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ImageFilePrototype)
			model.Href = core.StringPtr("cos://us-south/custom-image-vpc-bucket/customImage-0.vhd")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ImageFilePrototype
			err = vpcv1.UnmarshalImageFilePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalImageIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ImageIdentity)
			model.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ImageIdentity
			err = vpcv1.UnmarshalImageIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalImagePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ImagePatch)
			model.AllowedUse = nil
			model.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
			model.Name = core.StringPtr("my-image")
			model.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ImagePatch
			err = vpcv1.UnmarshalImagePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalImagePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ImagePrototype)
			model.AllowedUse = nil
			model.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
			model.Name = core.StringPtr("my-image")
			model.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
			model.ResourceGroup = nil
			model.EncryptedDataKey = core.StringPtr("testString")
			model.EncryptionKey = nil
			model.File = nil
			model.OperatingSystem = nil
			model.SourceVolume = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ImagePrototype
			err = vpcv1.UnmarshalImagePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceAvailabilityPolicyPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceAvailabilityPolicyPatch)
			model.HostFailure = core.StringPtr("restart")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceAvailabilityPolicyPatch
			err = vpcv1.UnmarshalInstanceAvailabilityPolicyPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceAvailabilityPolicyPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceAvailabilityPolicyPrototype)
			model.HostFailure = core.StringPtr("restart")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceAvailabilityPolicyPrototype
			err = vpcv1.UnmarshalInstanceAvailabilityPolicyPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceCatalogOfferingPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceCatalogOfferingPrototype)
			model.Plan = nil
			model.Offering = nil
			model.Version = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceCatalogOfferingPrototype
			err = vpcv1.UnmarshalInstanceCatalogOfferingPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceClusterNetworkAttachmentBeforePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceClusterNetworkAttachmentBeforePrototype)
			model.ID = core.StringPtr("0717-fb880975-db45-4459-8548-64e3995ac213")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceClusterNetworkAttachmentBeforePrototype
			err = vpcv1.UnmarshalInstanceClusterNetworkAttachmentBeforePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceClusterNetworkAttachmentPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceClusterNetworkAttachmentPatch)
			model.Name = core.StringPtr("my-instance-network-attachment-updated")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceClusterNetworkAttachmentPatch
			err = vpcv1.UnmarshalInstanceClusterNetworkAttachmentPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterface successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterface)
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-cluster-network-interface")
			model.PrimaryIP = nil
			model.Subnet = nil
			model.ID = core.StringPtr("0717-ffc092f7-5d02-4b93-ab69-26860529b9fb")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterface
			err = vpcv1.UnmarshalInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterface(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceClusterNetworkAttachmentPrototypeInstanceContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext)
			model.ClusterNetworkInterface = nil
			model.Name = core.StringPtr("my-instance-network-attachment")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceClusterNetworkAttachmentPrototypeInstanceContext
			err = vpcv1.UnmarshalInstanceClusterNetworkAttachmentPrototypeInstanceContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceDefaultTrustedProfilePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceDefaultTrustedProfilePrototype)
			model.AutoLink = core.BoolPtr(false)
			model.Target = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceDefaultTrustedProfilePrototype
			err = vpcv1.UnmarshalInstanceDefaultTrustedProfilePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceDiskPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceDiskPatch)
			model.Name = core.StringPtr("my-instance-disk-updated")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceDiskPatch
			err = vpcv1.UnmarshalInstanceDiskPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerActionGroupPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerActionGroupPatch)
			model.MembershipCount = core.Int64Ptr(int64(10))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerActionGroupPatch
			err = vpcv1.UnmarshalInstanceGroupManagerActionGroupPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerActionManagerPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerActionManagerPatch)
			model.MaxMembershipCount = core.Int64Ptr(int64(10))
			model.MinMembershipCount = core.Int64Ptr(int64(10))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerActionManagerPatch
			err = vpcv1.UnmarshalInstanceGroupManagerActionManagerPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerActionPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerActionPatch)
			model.AutoDelete = core.BoolPtr(true)
			model.AutoDeleteTimeout = core.Int64Ptr(int64(24))
			model.CronSpec = core.StringPtr("30 */2 * * 1-5")
			model.Group = nil
			model.Manager = nil
			model.Name = core.StringPtr("my-instance-group-manager-action")
			model.RunAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerActionPatch
			err = vpcv1.UnmarshalInstanceGroupManagerActionPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerActionPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerActionPrototype)
			model.Name = core.StringPtr("my-instance-group-manager-action")
			model.CronSpec = core.StringPtr("30 */2 * * 1-5")
			model.Group = nil
			model.Manager = nil
			model.RunAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerActionPrototype
			err = vpcv1.UnmarshalInstanceGroupManagerActionPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerPatch)
			model.AggregationWindow = core.Int64Ptr(int64(120))
			model.Cooldown = core.Int64Ptr(int64(210))
			model.ManagementEnabled = core.BoolPtr(true)
			model.MaxMembershipCount = core.Int64Ptr(int64(10))
			model.MinMembershipCount = core.Int64Ptr(int64(10))
			model.Name = core.StringPtr("my-instance-group-manager")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerPatch
			err = vpcv1.UnmarshalInstanceGroupManagerPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerPolicyPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerPolicyPatch)
			model.MetricType = core.StringPtr("cpu")
			model.MetricValue = core.Int64Ptr(int64(0))
			model.Name = core.StringPtr("my-instance-group-manager-policy")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerPolicyPatch
			err = vpcv1.UnmarshalInstanceGroupManagerPolicyPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerPolicyPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerPolicyPrototype)
			model.Name = core.StringPtr("my-instance-group-manager-policy")
			model.MetricType = core.StringPtr("cpu")
			model.MetricValue = core.Int64Ptr(int64(0))
			model.PolicyType = core.StringPtr("target")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerPolicyPrototype
			err = vpcv1.UnmarshalInstanceGroupManagerPolicyPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerPrototype)
			model.ManagementEnabled = core.BoolPtr(true)
			model.Name = core.StringPtr("my-instance-group-manager")
			model.AggregationWindow = core.Int64Ptr(int64(120))
			model.Cooldown = core.Int64Ptr(int64(210))
			model.ManagerType = core.StringPtr("autoscale")
			model.MaxMembershipCount = core.Int64Ptr(int64(10))
			model.MinMembershipCount = core.Int64Ptr(int64(10))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerPrototype
			err = vpcv1.UnmarshalInstanceGroupManagerPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerScheduledActionGroupPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerScheduledActionGroupPrototype)
			model.MembershipCount = core.Int64Ptr(int64(10))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerScheduledActionGroupPrototype
			err = vpcv1.UnmarshalInstanceGroupManagerScheduledActionGroupPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerScheduledActionManagerPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerScheduledActionManagerPrototype)
			model.MaxMembershipCount = core.Int64Ptr(int64(10))
			model.MinMembershipCount = core.Int64Ptr(int64(10))
			model.ID = core.StringPtr("r006-bd21f31f-8a05-4451-836d-ab0347e91fea")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerScheduledActionManagerPrototype
			err = vpcv1.UnmarshalInstanceGroupManagerScheduledActionManagerPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupMembershipPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupMembershipPatch)
			model.DeleteInstanceOnMembershipDelete = core.BoolPtr(true)
			model.Name = core.StringPtr("my-instance-group-membership")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupMembershipPatch
			err = vpcv1.UnmarshalInstanceGroupMembershipPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupPatch)
			model.ApplicationPort = core.Int64Ptr(int64(22))
			model.InstanceTemplate = nil
			model.LoadBalancer = nil
			model.LoadBalancerPool = nil
			model.MembershipCount = core.Int64Ptr(int64(10))
			model.Name = core.StringPtr("my-instance-group")
			model.Subnets = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupPatch
			err = vpcv1.UnmarshalInstanceGroupPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceMetadataServicePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceMetadataServicePatch)
			model.Enabled = core.BoolPtr(true)
			model.Protocol = core.StringPtr("http")
			model.ResponseHopLimit = core.Int64Ptr(int64(1))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceMetadataServicePatch
			err = vpcv1.UnmarshalInstanceMetadataServicePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceMetadataServicePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceMetadataServicePrototype)
			model.Enabled = core.BoolPtr(false)
			model.Protocol = core.StringPtr("https")
			model.ResponseHopLimit = core.Int64Ptr(int64(2))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceMetadataServicePrototype
			err = vpcv1.UnmarshalInstanceMetadataServicePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceNetworkAttachmentPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceNetworkAttachmentPatch)
			model.Name = core.StringPtr("my-instance-network-attachment-updated")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceNetworkAttachmentPatch
			err = vpcv1.UnmarshalInstanceNetworkAttachmentPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceNetworkAttachmentPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceNetworkAttachmentPrototype)
			model.Name = core.StringPtr("my-instance-network-attachment")
			model.VirtualNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceNetworkAttachmentPrototype
			err = vpcv1.UnmarshalInstanceNetworkAttachmentPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterface successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterface)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.AutoDelete = core.BoolPtr(false)
			model.EnableInfrastructureNat = core.BoolPtr(true)
			model.Ips = nil
			model.Name = core.StringPtr("my-virtual-network-interface")
			model.PrimaryIP = nil
			model.ProtocolStateFilteringMode = core.StringPtr("auto")
			model.ResourceGroup = nil
			model.SecurityGroups = nil
			model.Subnet = nil
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterface
			err = vpcv1.UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterface(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePatch)
			model.AvailabilityPolicy = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.EnableSecureBoot = core.BoolPtr(true)
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePatch
			err = vpcv1.UnmarshalInstancePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePatchProfile successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePatchProfile)
			model.Name = core.StringPtr("bx2-4x16")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePatchProfile
			err = vpcv1.UnmarshalInstancePatchProfile(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPatch)
			model.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPatch
			err = vpcv1.UnmarshalInstancePlacementTargetPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPrototype)
			model.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPrototype
			err = vpcv1.UnmarshalInstancePlacementTargetPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceProfileIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceProfileIdentity)
			model.Name = core.StringPtr("bx2-4x16")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceProfileIdentity
			err = vpcv1.UnmarshalInstanceProfileIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePrototype)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Image = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil
			model.CatalogOffering = nil
			model.SourceTemplate = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePrototype
			err = vpcv1.UnmarshalInstancePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceReservationAffinityPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceReservationAffinityPatch)
			model.Policy = core.StringPtr("automatic")
			model.Pool = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceReservationAffinityPatch
			err = vpcv1.UnmarshalInstanceReservationAffinityPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceReservationAffinityPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceReservationAffinityPrototype)
			model.Policy = core.StringPtr("automatic")
			model.Pool = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceReservationAffinityPrototype
			err = vpcv1.UnmarshalInstanceReservationAffinityPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplateIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplateIdentity)
			model.ID = core.StringPtr("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplateIdentity
			err = vpcv1.UnmarshalInstanceTemplateIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplatePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplatePatch)
			model.Name = core.StringPtr("my-instance-template")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplatePatch
			err = vpcv1.UnmarshalInstanceTemplatePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplatePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplatePrototype)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Image = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil
			model.CatalogOffering = nil
			model.SourceTemplate = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplatePrototype
			err = vpcv1.UnmarshalInstanceTemplatePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalKeyIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.KeyIdentity)
			model.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45")
			model.Fingerprint = core.StringPtr("SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.KeyIdentity
			err = vpcv1.UnmarshalKeyIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalKeyPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.KeyPatch)
			model.Name = core.StringPtr("my-key-1")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.KeyPatch
			err = vpcv1.UnmarshalKeyPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLegacyCloudObjectStorageBucketIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LegacyCloudObjectStorageBucketIdentity)
			model.Name = core.StringPtr("bucket-27200-lwx4cfvcue")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LegacyCloudObjectStorageBucketIdentity
			err = vpcv1.UnmarshalLegacyCloudObjectStorageBucketIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerDnsPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerDnsPatch)
			model.Instance = nil
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerDnsPatch
			err = vpcv1.UnmarshalLoadBalancerDnsPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerDnsPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerDnsPrototype)
			model.Instance = nil
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerDnsPrototype
			err = vpcv1.UnmarshalLoadBalancerDnsPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerIdentity)
			model.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerIdentity
			err = vpcv1.UnmarshalLoadBalancerIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerDefaultPoolPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerDefaultPoolPatch)
			model.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerDefaultPoolPatch
			err = vpcv1.UnmarshalLoadBalancerListenerDefaultPoolPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerHTTPSRedirectPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerHTTPSRedirectPatch)
			model.HTTPStatusCode = core.Int64Ptr(int64(301))
			model.Listener = nil
			model.URI = core.StringPtr("/example?doc=get")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerHTTPSRedirectPatch
			err = vpcv1.UnmarshalLoadBalancerListenerHTTPSRedirectPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerHTTPSRedirectPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerHTTPSRedirectPrototype)
			model.HTTPStatusCode = core.Int64Ptr(int64(301))
			model.Listener = nil
			model.URI = core.StringPtr("/example?doc=get")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerHTTPSRedirectPrototype
			err = vpcv1.UnmarshalLoadBalancerListenerHTTPSRedirectPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerIdentity)
			model.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerIdentity
			err = vpcv1.UnmarshalLoadBalancerListenerIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPatch)
			model.AcceptProxyProtocol = core.BoolPtr(true)
			model.CertificateInstance = nil
			model.ConnectionLimit = core.Int64Ptr(int64(2000))
			model.DefaultPool = nil
			model.HTTPSRedirect = nil
			model.IdleConnectionTimeout = core.Int64Ptr(int64(100))
			model.Port = core.Int64Ptr(int64(443))
			model.PortMax = core.Int64Ptr(int64(499))
			model.PortMin = core.Int64Ptr(int64(443))
			model.Protocol = core.StringPtr("http")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPatch
			err = vpcv1.UnmarshalLoadBalancerListenerPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyPatch)
			model.Name = core.StringPtr("my-load-balancer-listener-policy")
			model.Priority = core.Int64Ptr(int64(5))
			model.Target = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyPatch
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyPrototype)
			model.Action = core.StringPtr("forward_to_listener")
			model.Name = core.StringPtr("my-load-balancer-listener-policy")
			model.Priority = core.Int64Ptr(int64(5))
			model.Rules = nil
			model.Target = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyPrototype
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyRulePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyRulePatch)
			model.Condition = core.StringPtr("contains")
			model.Field = core.StringPtr("MY-APP-HEADER")
			model.Type = core.StringPtr("body")
			model.Value = core.StringPtr("testString")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyRulePatch
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyRulePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyRulePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyRulePrototype)
			model.Condition = core.StringPtr("contains")
			model.Field = core.StringPtr("MY-APP-HEADER")
			model.Type = core.StringPtr("body")
			model.Value = core.StringPtr("testString")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyRulePrototype
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyRulePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPatch)
			model.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004")
			model.HTTPStatusCode = core.Int64Ptr(int64(301))
			model.Listener = nil
			model.URI = core.StringPtr("/example?doc=get")
			model.URL = core.StringPtr("https://ibm.com:443/new/{path}?{query}")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPatch
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPrototype)
			model.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004")
			model.HTTPStatusCode = core.Int64Ptr(int64(301))
			model.Listener = nil
			model.URI = core.StringPtr("/example?doc=get")
			model.URL = core.StringPtr("https://ibm.com:443/new/{path}?{query}")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPrototype
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPrototypeLoadBalancerContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext)
			model.AcceptProxyProtocol = core.BoolPtr(true)
			model.CertificateInstance = nil
			model.ConnectionLimit = core.Int64Ptr(int64(2000))
			model.DefaultPool = nil
			model.HTTPSRedirect = nil
			model.IdleConnectionTimeout = core.Int64Ptr(int64(100))
			model.Port = core.Int64Ptr(int64(443))
			model.PortMax = core.Int64Ptr(int64(499))
			model.PortMin = core.Int64Ptr(int64(443))
			model.Protocol = core.StringPtr("http")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPrototypeLoadBalancerContext
			err = vpcv1.UnmarshalLoadBalancerListenerPrototypeLoadBalancerContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerLoggingDatapathPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerLoggingDatapathPatch)
			model.Active = core.BoolPtr(true)

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerLoggingDatapathPatch
			err = vpcv1.UnmarshalLoadBalancerLoggingDatapathPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerLoggingDatapathPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerLoggingDatapathPrototype)
			model.Active = core.BoolPtr(true)

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerLoggingDatapathPrototype
			err = vpcv1.UnmarshalLoadBalancerLoggingDatapathPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerLoggingPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerLoggingPatch)
			model.Datapath = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerLoggingPatch
			err = vpcv1.UnmarshalLoadBalancerLoggingPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerLoggingPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerLoggingPrototype)
			model.Datapath = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerLoggingPrototype
			err = vpcv1.UnmarshalLoadBalancerLoggingPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPatch)
			model.Dns = nil
			model.Logging = nil
			model.Name = core.StringPtr("my-load-balancer")
			model.Subnets = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPatch
			err = vpcv1.UnmarshalLoadBalancerPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolFailsafePolicyPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolFailsafePolicyPatch)
			model.Action = core.StringPtr("forward")
			model.Target = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolFailsafePolicyPatch
			err = vpcv1.UnmarshalLoadBalancerPoolFailsafePolicyPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolFailsafePolicyPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolFailsafePolicyPrototype)
			model.Action = core.StringPtr("forward")
			model.Target = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolFailsafePolicyPrototype
			err = vpcv1.UnmarshalLoadBalancerPoolFailsafePolicyPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolFailsafePolicyTargetPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolFailsafePolicyTargetPatch)
			model.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolFailsafePolicyTargetPatch
			err = vpcv1.UnmarshalLoadBalancerPoolFailsafePolicyTargetPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolHealthMonitorPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolHealthMonitorPatch)
			model.Delay = core.Int64Ptr(int64(5))
			model.MaxRetries = core.Int64Ptr(int64(2))
			model.Port = core.Int64Ptr(int64(22))
			model.Timeout = core.Int64Ptr(int64(2))
			model.Type = core.StringPtr("http")
			model.URLPath = core.StringPtr("/")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolHealthMonitorPatch
			err = vpcv1.UnmarshalLoadBalancerPoolHealthMonitorPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolHealthMonitorPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolHealthMonitorPrototype)
			model.Delay = core.Int64Ptr(int64(5))
			model.MaxRetries = core.Int64Ptr(int64(2))
			model.Port = core.Int64Ptr(int64(22))
			model.Timeout = core.Int64Ptr(int64(2))
			model.Type = core.StringPtr("http")
			model.URLPath = core.StringPtr("/")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolHealthMonitorPrototype
			err = vpcv1.UnmarshalLoadBalancerPoolHealthMonitorPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolIdentity)
			model.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolIdentity
			err = vpcv1.UnmarshalLoadBalancerPoolIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolIdentityByName successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolIdentityByName)
			model.Name = core.StringPtr("my-load-balancer-pool")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolIdentityByName
			err = vpcv1.UnmarshalLoadBalancerPoolIdentityByName(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberPatch)
			model.Port = core.Int64Ptr(int64(80))
			model.Target = nil
			model.Weight = core.Int64Ptr(int64(50))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberPatch
			err = vpcv1.UnmarshalLoadBalancerPoolMemberPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberPrototype)
			model.Port = core.Int64Ptr(int64(80))
			model.Target = nil
			model.Weight = core.Int64Ptr(int64(50))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberPrototype
			err = vpcv1.UnmarshalLoadBalancerPoolMemberPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberTargetPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberTargetPrototype)
			model.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")
			model.Address = core.StringPtr("192.168.3.4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberTargetPrototype
			err = vpcv1.UnmarshalLoadBalancerPoolMemberTargetPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolPatch)
			model.Algorithm = core.StringPtr("least_connections")
			model.FailsafePolicy = nil
			model.HealthMonitor = nil
			model.Name = core.StringPtr("my-load-balancer-pool")
			model.Protocol = core.StringPtr("http")
			model.ProxyProtocol = core.StringPtr("disabled")
			model.SessionPersistence = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolPatch
			err = vpcv1.UnmarshalLoadBalancerPoolPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolPrototypeLoadBalancerContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext)
			model.Algorithm = core.StringPtr("least_connections")
			model.HealthMonitor = nil
			model.Members = nil
			model.Name = core.StringPtr("my-load-balancer-pool")
			model.Protocol = core.StringPtr("http")
			model.ProxyProtocol = core.StringPtr("disabled")
			model.SessionPersistence = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolPrototypeLoadBalancerContext
			err = vpcv1.UnmarshalLoadBalancerPoolPrototypeLoadBalancerContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolSessionPersistencePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolSessionPersistencePatch)
			model.CookieName = core.StringPtr("my-cookie-name")
			model.Type = core.StringPtr("app_cookie")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolSessionPersistencePatch
			err = vpcv1.UnmarshalLoadBalancerPoolSessionPersistencePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolSessionPersistencePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolSessionPersistencePrototype)
			model.CookieName = core.StringPtr("my-cookie-name")
			model.Type = core.StringPtr("app_cookie")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolSessionPersistencePrototype
			err = vpcv1.UnmarshalLoadBalancerPoolSessionPersistencePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerProfileIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerProfileIdentity)
			model.Name = core.StringPtr("network-fixed")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerProfileIdentity
			err = vpcv1.UnmarshalLoadBalancerProfileIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLIdentity)
			model.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLIdentity
			err = vpcv1.UnmarshalNetworkACLIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLPatch)
			model.Name = core.StringPtr("my-network-acl")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLPatch
			err = vpcv1.UnmarshalNetworkACLPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLPrototype)
			model.Name = core.StringPtr("my-network-acl")
			model.ResourceGroup = nil
			model.VPC = nil
			model.Rules = nil
			model.SourceNetworkACL = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLPrototype
			err = vpcv1.UnmarshalNetworkACLPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRuleBeforePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRuleBeforePatch)
			model.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRuleBeforePatch
			err = vpcv1.UnmarshalNetworkACLRuleBeforePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRuleBeforePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRuleBeforePrototype)
			model.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRuleBeforePrototype
			err = vpcv1.UnmarshalNetworkACLRuleBeforePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRulePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRulePatch)
			model.Action = core.StringPtr("allow")
			model.Before = nil
			model.Code = core.Int64Ptr(int64(0))
			model.Destination = core.StringPtr("192.168.3.2/32")
			model.DestinationPortMax = core.Int64Ptr(int64(22))
			model.DestinationPortMin = core.Int64Ptr(int64(22))
			model.Direction = core.StringPtr("inbound")
			model.Name = core.StringPtr("my-network-acl-rule")
			model.Source = core.StringPtr("192.168.3.2/32")
			model.SourcePortMax = core.Int64Ptr(int64(65535))
			model.SourcePortMin = core.Int64Ptr(int64(49152))
			model.Type = core.Int64Ptr(int64(8))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRulePatch
			err = vpcv1.UnmarshalNetworkACLRulePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRulePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRulePrototype)
			model.Action = core.StringPtr("allow")
			model.Before = nil
			model.Destination = core.StringPtr("192.168.3.2/32")
			model.Direction = core.StringPtr("inbound")
			model.IPVersion = core.StringPtr("ipv4")
			model.Name = core.StringPtr("my-network-acl-rule")
			model.Protocol = core.StringPtr("tcp")
			model.Source = core.StringPtr("192.168.3.2/32")
			model.Code = core.Int64Ptr(int64(0))
			model.Type = core.Int64Ptr(int64(8))
			model.DestinationPortMax = core.Int64Ptr(int64(22))
			model.DestinationPortMin = core.Int64Ptr(int64(22))
			model.SourcePortMax = core.Int64Ptr(int64(65535))
			model.SourcePortMin = core.Int64Ptr(int64(49152))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRulePrototype
			err = vpcv1.UnmarshalNetworkACLRulePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRulePrototypeNetworkACLContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRulePrototypeNetworkACLContext)
			model.Action = core.StringPtr("allow")
			model.Destination = core.StringPtr("192.168.3.2/32")
			model.Direction = core.StringPtr("inbound")
			model.IPVersion = core.StringPtr("ipv4")
			model.Name = core.StringPtr("my-network-acl-rule")
			model.Protocol = core.StringPtr("tcp")
			model.Source = core.StringPtr("192.168.3.2/32")
			model.Code = core.Int64Ptr(int64(0))
			model.Type = core.Int64Ptr(int64(8))
			model.DestinationPortMax = core.Int64Ptr(int64(22))
			model.DestinationPortMin = core.Int64Ptr(int64(22))
			model.SourcePortMax = core.Int64Ptr(int64(65535))
			model.SourcePortMin = core.Int64Ptr(int64(49152))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRulePrototypeNetworkACLContext
			err = vpcv1.UnmarshalNetworkACLRulePrototypeNetworkACLContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkInterfaceIPPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkInterfaceIPPrototype)
			model.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
			model.Address = core.StringPtr("192.168.3.4")
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-reserved-ip")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkInterfaceIPPrototype
			err = vpcv1.UnmarshalNetworkInterfaceIPPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkInterfacePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkInterfacePatch)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.Name = core.StringPtr("my-instance-network-interface")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkInterfacePatch
			err = vpcv1.UnmarshalNetworkInterfacePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkInterfacePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkInterfacePrototype)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.Name = core.StringPtr("my-instance-network-interface")
			model.PrimaryIP = nil
			model.SecurityGroups = nil
			model.Subnet = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkInterfacePrototype
			err = vpcv1.UnmarshalNetworkInterfacePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalOperatingSystemIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.OperatingSystemIdentity)
			model.Name = core.StringPtr("ubuntu-24-04-amd64")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.OperatingSystemIdentity
			err = vpcv1.UnmarshalOperatingSystemIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPlacementGroupPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PlacementGroupPatch)
			model.Name = core.StringPtr("my-placement-group")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PlacementGroupPatch
			err = vpcv1.UnmarshalPlacementGroupPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPrivatePathServiceGatewayAccountPolicyPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PrivatePathServiceGatewayAccountPolicyPatch)
			model.AccessPolicy = core.StringPtr("deny")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PrivatePathServiceGatewayAccountPolicyPatch
			err = vpcv1.UnmarshalPrivatePathServiceGatewayAccountPolicyPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPrivatePathServiceGatewayPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PrivatePathServiceGatewayPatch)
			model.DefaultAccessPolicy = core.StringPtr("deny")
			model.LoadBalancer = nil
			model.Name = core.StringPtr("my-private-path-service-gateway")
			model.ZonalAffinity = core.BoolPtr(true)

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PrivatePathServiceGatewayPatch
			err = vpcv1.UnmarshalPrivatePathServiceGatewayPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicAddressRangePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicAddressRangePatch)
			model.Name = core.StringPtr("my-public-address-range-updated")
			model.Target = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicAddressRangePatch
			err = vpcv1.UnmarshalPublicAddressRangePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicAddressRangeTargetPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicAddressRangeTargetPatch)
			model.VPC = nil
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicAddressRangeTargetPatch
			err = vpcv1.UnmarshalPublicAddressRangeTargetPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicAddressRangeTargetPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicAddressRangeTargetPrototype)
			model.VPC = nil
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicAddressRangeTargetPrototype
			err = vpcv1.UnmarshalPublicAddressRangeTargetPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicGatewayFloatingIPPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicGatewayFloatingIPPrototype)
			model.ID = core.StringPtr("r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")
			model.Address = core.StringPtr("203.0.113.1")
			model.Name = core.StringPtr("my-floating-ip")
			model.ResourceGroup = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicGatewayFloatingIPPrototype
			err = vpcv1.UnmarshalPublicGatewayFloatingIPPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicGatewayIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicGatewayIdentity)
			model.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicGatewayIdentity
			err = vpcv1.UnmarshalPublicGatewayIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicGatewayPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicGatewayPatch)
			model.Name = core.StringPtr("my-public-gateway")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicGatewayPatch
			err = vpcv1.UnmarshalPublicGatewayPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRegionIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RegionIdentity)
			model.Name = core.StringPtr("us-south")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/regions/us-south")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RegionIdentity
			err = vpcv1.UnmarshalRegionIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservationCapacityPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservationCapacityPatch)
			model.Total = core.Int64Ptr(int64(10))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservationCapacityPatch
			err = vpcv1.UnmarshalReservationCapacityPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservationCapacityPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservationCapacityPrototype)
			model.Total = core.Int64Ptr(int64(10))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservationCapacityPrototype
			err = vpcv1.UnmarshalReservationCapacityPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservationCommittedUsePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservationCommittedUsePatch)
			model.ExpirationPolicy = core.StringPtr("release")
			model.Term = core.StringPtr("testString")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservationCommittedUsePatch
			err = vpcv1.UnmarshalReservationCommittedUsePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservationCommittedUsePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservationCommittedUsePrototype)
			model.ExpirationPolicy = core.StringPtr("release")
			model.Term = core.StringPtr("testString")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservationCommittedUsePrototype
			err = vpcv1.UnmarshalReservationCommittedUsePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservationIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservationIdentity)
			model.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservationIdentity
			err = vpcv1.UnmarshalReservationIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservationPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservationPatch)
			model.AffinityPolicy = core.StringPtr("automatic")
			model.Capacity = nil
			model.CommittedUse = nil
			model.Name = core.StringPtr("my-reservation")
			model.Profile = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservationPatch
			err = vpcv1.UnmarshalReservationPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservationProfilePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservationProfilePatch)
			model.Name = core.StringPtr("bx2-4x16")
			model.ResourceType = core.StringPtr("bare_metal_server_profile")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservationProfilePatch
			err = vpcv1.UnmarshalReservationProfilePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservationProfilePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservationProfilePrototype)
			model.Name = core.StringPtr("bx2-4x16")
			model.ResourceType = core.StringPtr("bare_metal_server_profile")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservationProfilePrototype
			err = vpcv1.UnmarshalReservationProfilePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservedIPPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservedIPPatch)
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-reserved-ip")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservedIPPatch
			err = vpcv1.UnmarshalReservedIPPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservedIPTargetPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservedIPTargetPrototype)
			model.ID = core.StringPtr("r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservedIPTargetPrototype
			err = vpcv1.UnmarshalReservedIPTargetPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalResourceFilter successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ResourceFilter)
			model.ResourceType = core.StringPtr("vpn_server")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ResourceFilter
			err = vpcv1.UnmarshalResourceFilter(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalResourceGroupIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ResourceGroupIdentity)
			model.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ResourceGroupIdentity
			err = vpcv1.UnmarshalResourceGroupIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRouteNextHopPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RouteNextHopPatch)
			model.Address = core.StringPtr("0.0.0.0")
			model.ID = core.StringPtr("0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RouteNextHopPatch
			err = vpcv1.UnmarshalRouteNextHopPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRouteNextHopPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RouteNextHopPrototype)
			model.Address = core.StringPtr("0.0.0.0")
			model.ID = core.StringPtr("0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RouteNextHopPrototype
			err = vpcv1.UnmarshalRouteNextHopPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRoutePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RoutePatch)
			model.Advertise = core.BoolPtr(true)
			model.Name = core.StringPtr("my-vpc-routing-table-route")
			model.NextHop = nil
			model.Priority = core.Int64Ptr(int64(1))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RoutePatch
			err = vpcv1.UnmarshalRoutePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRoutePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RoutePrototype)
			model.Action = core.StringPtr("deliver")
			model.Advertise = core.BoolPtr(false)
			model.Destination = core.StringPtr("192.168.3.0/24")
			model.Name = core.StringPtr("my-vpc-routing-table-route")
			model.NextHop = nil
			model.Priority = core.Int64Ptr(int64(1))
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RoutePrototype
			err = vpcv1.UnmarshalRoutePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRoutingTableIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RoutingTableIdentity)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")
			model.ID = core.StringPtr("r006-6885e83f-03b2-4603-8a86-db2a0f55c840")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RoutingTableIdentity
			err = vpcv1.UnmarshalRoutingTableIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRoutingTablePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RoutingTablePatch)
			model.AcceptRoutesFrom = nil
			model.AdvertiseRoutesTo = []string{"transit_gateway"}
			model.Name = core.StringPtr("my-routing-table-2")
			model.RouteDirectLinkIngress = core.BoolPtr(true)
			model.RouteInternetIngress = core.BoolPtr(true)
			model.RouteTransitGatewayIngress = core.BoolPtr(true)
			model.RouteVPCZoneIngress = core.BoolPtr(true)

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RoutingTablePatch
			err = vpcv1.UnmarshalRoutingTablePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupIdentity)
			model.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupIdentity
			err = vpcv1.UnmarshalSecurityGroupIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupPatch)
			model.Name = core.StringPtr("my-security-group")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupPatch
			err = vpcv1.UnmarshalSecurityGroupPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleLocalPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleLocalPatch)
			model.Address = core.StringPtr("192.168.3.4")
			model.CIDRBlock = core.StringPtr("192.168.3.0/24")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleLocalPatch
			err = vpcv1.UnmarshalSecurityGroupRuleLocalPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleLocalPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleLocalPrototype)
			model.Address = core.StringPtr("192.168.3.4")
			model.CIDRBlock = core.StringPtr("192.168.3.0/24")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleLocalPrototype
			err = vpcv1.UnmarshalSecurityGroupRuleLocalPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRulePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRulePatch)
			model.Code = core.Int64Ptr(int64(0))
			model.Direction = core.StringPtr("inbound")
			model.IPVersion = core.StringPtr("ipv4")
			model.Local = nil
			model.PortMax = core.Int64Ptr(int64(22))
			model.PortMin = core.Int64Ptr(int64(22))
			model.Remote = nil
			model.Type = core.Int64Ptr(int64(8))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRulePatch
			err = vpcv1.UnmarshalSecurityGroupRulePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRulePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRulePrototype)
			model.Direction = core.StringPtr("inbound")
			model.IPVersion = core.StringPtr("ipv4")
			model.Local = nil
			model.Protocol = core.StringPtr("tcp")
			model.Remote = nil
			model.Code = core.Int64Ptr(int64(0))
			model.Type = core.Int64Ptr(int64(8))
			model.PortMax = core.Int64Ptr(int64(22))
			model.PortMin = core.Int64Ptr(int64(22))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRulePrototype
			err = vpcv1.UnmarshalSecurityGroupRulePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleRemotePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleRemotePatch)
			model.Address = core.StringPtr("192.168.3.4")
			model.CIDRBlock = core.StringPtr("192.168.3.0/24")
			model.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleRemotePatch
			err = vpcv1.UnmarshalSecurityGroupRuleRemotePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleRemotePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleRemotePrototype)
			model.Address = core.StringPtr("192.168.3.4")
			model.CIDRBlock = core.StringPtr("192.168.3.0/24")
			model.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleRemotePrototype
			err = vpcv1.UnmarshalSecurityGroupRuleRemotePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareIdentity)
			model.ID = core.StringPtr("r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareIdentity
			err = vpcv1.UnmarshalShareIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareInitialOwner successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareInitialOwner)
			model.Gid = core.Int64Ptr(int64(50))
			model.Uid = core.Int64Ptr(int64(50))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareInitialOwner
			err = vpcv1.UnmarshalShareInitialOwner(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareMountTargetPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareMountTargetPatch)
			model.Name = core.StringPtr("my-share-mount-target")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareMountTargetPatch
			err = vpcv1.UnmarshalShareMountTargetPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareMountTargetPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareMountTargetPrototype)
			model.AccessProtocol = core.StringPtr("nfs4")
			model.Name = core.StringPtr("my-share-mount-target")
			model.TransitEncryption = core.StringPtr("none")
			model.VirtualNetworkInterface = nil
			model.VPC = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareMountTargetPrototype
			err = vpcv1.UnmarshalShareMountTargetPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareMountTargetVirtualNetworkInterfacePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototype)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.AutoDelete = core.BoolPtr(false)
			model.EnableInfrastructureNat = core.BoolPtr(true)
			model.Ips = nil
			model.Name = core.StringPtr("my-virtual-network-interface")
			model.PrimaryIP = nil
			model.ProtocolStateFilteringMode = core.StringPtr("auto")
			model.ResourceGroup = nil
			model.SecurityGroups = nil
			model.Subnet = nil
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareMountTargetVirtualNetworkInterfacePrototype
			err = vpcv1.UnmarshalShareMountTargetVirtualNetworkInterfacePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSharePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SharePatch)
			model.AccessControlMode = core.StringPtr("security_group")
			model.AllowedAccessProtocols = []string{"nfs4"}
			model.AllowedTransitEncryptionModes = []string{"ipsec"}
			model.Bandwidth = core.Int64Ptr(int64(1))
			model.Iops = core.Int64Ptr(int64(100))
			model.Name = core.StringPtr("my-share")
			model.Profile = nil
			model.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
			model.Size = core.Int64Ptr(int64(1))
			model.UserTags = []string{"testString"}

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SharePatch
			err = vpcv1.UnmarshalSharePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareProfileIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareProfileIdentity)
			model.Name = core.StringPtr("tier-3iops")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareProfileIdentity
			err = vpcv1.UnmarshalShareProfileIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSharePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SharePrototype)
			model.AllowedTransitEncryptionModes = []string{"ipsec"}
			model.MountTargets = nil
			model.Name = core.StringPtr("my-share")
			model.ReplicaShare = nil
			model.UserTags = nil
			model.AccessControlMode = core.StringPtr("security_group")
			model.AllowedAccessProtocols = []string{"nfs4"}
			model.Bandwidth = core.Int64Ptr(int64(100))
			model.EncryptionKey = nil
			model.InitialOwner = nil
			model.Iops = core.Int64Ptr(int64(100))
			model.Profile = nil
			model.ResourceGroup = nil
			model.Size = core.Int64Ptr(int64(200))
			model.Zone = nil
			model.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
			model.SourceShare = nil
			model.OriginShare = nil
			model.SourceSnapshot = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SharePrototype
			err = vpcv1.UnmarshalSharePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSharePrototypeShareContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SharePrototypeShareContext)
			model.AllowedTransitEncryptionModes = []string{"ipsec"}
			model.Iops = core.Int64Ptr(int64(100))
			model.MountTargets = nil
			model.Name = core.StringPtr("my-share")
			model.Profile = nil
			model.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
			model.ResourceGroup = nil
			model.UserTags = nil
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SharePrototypeShareContext
			err = vpcv1.UnmarshalSharePrototypeShareContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareSnapshotPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareSnapshotPatch)
			model.Name = core.StringPtr("my-share-snapshot")
			model.UserTags = []string{"testString"}

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareSnapshotPatch
			err = vpcv1.UnmarshalShareSnapshotPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareSourceSnapshotPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareSourceSnapshotPrototype)
			model.ID = core.StringPtr("r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareSourceSnapshotPrototype
			err = vpcv1.UnmarshalShareSourceSnapshotPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotAllowedUsePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotAllowedUsePatch)
			model.ApiVersion = core.StringPtr("2024-06-23")
			model.BareMetalServer = core.StringPtr("enable_secure_boot == true")
			model.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotAllowedUsePatch
			err = vpcv1.UnmarshalSnapshotAllowedUsePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotAllowedUsePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotAllowedUsePrototype)
			model.ApiVersion = core.StringPtr("2024-06-23")
			model.BareMetalServer = core.StringPtr("enable_secure_boot == true")
			model.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotAllowedUsePrototype
			err = vpcv1.UnmarshalSnapshotAllowedUsePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotClonePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotClonePrototype)
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotClonePrototype
			err = vpcv1.UnmarshalSnapshotClonePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotConsistencyGroupPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotConsistencyGroupPatch)
			model.DeleteSnapshotsOnDelete = core.BoolPtr(true)
			model.Name = core.StringPtr("my-snapshot-consistency-group")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotConsistencyGroupPatch
			err = vpcv1.UnmarshalSnapshotConsistencyGroupPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotConsistencyGroupPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotConsistencyGroupPrototype)
			model.DeleteSnapshotsOnDelete = core.BoolPtr(true)
			model.Name = core.StringPtr("my-snapshot-consistency-group")
			model.ResourceGroup = nil
			model.Snapshots = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotConsistencyGroupPrototype
			err = vpcv1.UnmarshalSnapshotConsistencyGroupPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotIdentity)
			model.ID = core.StringPtr("r006-f6bfa329-0e36-433f-a3bb-0df632e79263")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotIdentity
			err = vpcv1.UnmarshalSnapshotIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotPatch)
			model.AllowedUse = nil
			model.Name = core.StringPtr("my-snapshot")
			model.UserTags = []string{"testString"}

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotPatch
			err = vpcv1.UnmarshalSnapshotPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotPrototype)
			model.AllowedUse = nil
			model.Clones = nil
			model.Name = core.StringPtr("my-snapshot")
			model.ResourceGroup = nil
			model.UserTags = nil
			model.SourceVolume = nil
			model.EncryptionKey = nil
			model.SourceSnapshot = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotPrototype
			err = vpcv1.UnmarshalSnapshotPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotPrototypeSnapshotConsistencyGroupContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext)
			model.Name = core.StringPtr("my-snapshot")
			model.SourceVolume = nil
			model.UserTags = []string{"testString"}

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotPrototypeSnapshotConsistencyGroupContext
			err = vpcv1.UnmarshalSnapshotPrototypeSnapshotConsistencyGroupContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSubnetIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SubnetIdentity)
			model.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SubnetIdentity
			err = vpcv1.UnmarshalSubnetIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSubnetPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SubnetPatch)
			model.Name = core.StringPtr("my-subnet")
			model.NetworkACL = nil
			model.PublicGateway = nil
			model.RoutingTable = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SubnetPatch
			err = vpcv1.UnmarshalSubnetPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSubnetPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SubnetPrototype)
			model.IPVersion = core.StringPtr("ipv4")
			model.Name = core.StringPtr("my-subnet")
			model.NetworkACL = nil
			model.PublicGateway = nil
			model.ResourceGroup = nil
			model.RoutingTable = nil
			model.VPC = nil
			model.TotalIpv4AddressCount = core.Int64Ptr(int64(256))
			model.Zone = nil
			model.Ipv4CIDRBlock = core.StringPtr("10.0.0.0/24")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SubnetPrototype
			err = vpcv1.UnmarshalSubnetPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSubnetPublicGatewayPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SubnetPublicGatewayPatch)
			model.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SubnetPublicGatewayPatch
			err = vpcv1.UnmarshalSubnetPublicGatewayPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalTrustedProfileIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.TrustedProfileIdentity)
			model.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.TrustedProfileIdentity
			err = vpcv1.UnmarshalTrustedProfileIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVpcdnsPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VpcdnsPatch)
			model.EnableHub = core.BoolPtr(true)
			model.Resolver = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VpcdnsPatch
			err = vpcv1.UnmarshalVpcdnsPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVpcdnsPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VpcdnsPrototype)
			model.EnableHub = core.BoolPtr(false)
			model.Resolver = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VpcdnsPrototype
			err = vpcv1.UnmarshalVpcdnsPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVpcdnsResolutionBindingPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VpcdnsResolutionBindingPatch)
			model.Name = core.StringPtr("my-dns-resolution-binding-updated")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VpcdnsResolutionBindingPatch
			err = vpcv1.UnmarshalVpcdnsResolutionBindingPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVpcdnsResolverPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VpcdnsResolverPatch)
			model.ManualServers = nil
			model.Type = core.StringPtr("delegated")
			model.VPC = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VpcdnsResolverPatch
			err = vpcv1.UnmarshalVpcdnsResolverPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVpcdnsResolverPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VpcdnsResolverPrototype)
			model.Type = core.StringPtr("system")
			model.ManualServers = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VpcdnsResolverPrototype
			err = vpcv1.UnmarshalVpcdnsResolverPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVpcdnsResolverVPCPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VpcdnsResolverVPCPatch)
			model.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VpcdnsResolverVPCPatch
			err = vpcv1.UnmarshalVpcdnsResolverVPCPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPCIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPCIdentity)
			model.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPCIdentity
			err = vpcv1.UnmarshalVPCIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPCPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPCPatch)
			model.Dns = nil
			model.Name = core.StringPtr("my-vpc")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPCPatch
			err = vpcv1.UnmarshalVPCPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionDpdPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionDpdPatch)
			model.Action = core.StringPtr("restart")
			model.Interval = core.Int64Ptr(int64(30))
			model.Timeout = core.Int64Ptr(int64(120))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionDpdPatch
			err = vpcv1.UnmarshalVPNGatewayConnectionDpdPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionDpdPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionDpdPrototype)
			model.Action = core.StringPtr("restart")
			model.Interval = core.Int64Ptr(int64(30))
			model.Timeout = core.Int64Ptr(int64(120))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionDpdPrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionDpdPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionDynamicRouteModeLocalPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionDynamicRouteModeLocalPrototype)
			model.IkeIdentities = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionDynamicRouteModeLocalPrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionDynamicRouteModeLocalPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionDynamicRouteModePeerPrototype)
			model.Asn = core.Int64Ptr(int64(38))
			model.IkeIdentity = nil
			model.Address = core.StringPtr("192.0.2.5")
			model.Fqdn = core.StringPtr("my-service.example.com")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionDynamicRouteModePeerPrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIkeIdentityPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIkeIdentityPrototype)
			model.Type = core.StringPtr("fqdn")
			model.Value = core.StringPtr("my-service.example.com")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIkeIdentityPrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionIkeIdentityPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIkePolicyPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIkePolicyPatch)
			model.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIkePolicyPatch
			err = vpcv1.UnmarshalVPNGatewayConnectionIkePolicyPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIkePolicyPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIkePolicyPrototype)
			model.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIkePolicyPrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionIkePolicyPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIPsecPolicyPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIPsecPolicyPatch)
			model.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIPsecPolicyPatch
			err = vpcv1.UnmarshalVPNGatewayConnectionIPsecPolicyPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIPsecPolicyPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIPsecPolicyPrototype)
			model.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIPsecPolicyPrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionIPsecPolicyPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPatch)
			model.AdminStateUp = core.BoolPtr(true)
			model.DeadPeerDetection = nil
			model.DistributeTraffic = core.BoolPtr(true)
			model.EstablishMode = core.StringPtr("bidirectional")
			model.IkePolicy = nil
			model.IpsecPolicy = nil
			model.Name = core.StringPtr("my-vpn-gateway-connection")
			model.Peer = nil
			model.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
			model.RoutingProtocol = core.StringPtr("bgp")
			model.Tunnels = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPatch
			err = vpcv1.UnmarshalVPNGatewayConnectionPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPeerPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPeerPatch)
			model.Address = core.StringPtr("192.0.2.5")
			model.Fqdn = core.StringPtr("my-service.example.com")
			model.Asn = core.Int64Ptr(int64(38))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPeerPatch
			err = vpcv1.UnmarshalVPNGatewayConnectionPeerPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPolicyModeLocalPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPolicyModeLocalPrototype)
			model.CIDRs = []string{"192.0.2.0/24"}
			model.IkeIdentities = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPolicyModeLocalPrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionPolicyModeLocalPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPolicyModePeerPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPolicyModePeerPrototype)
			model.CIDRs = []string{"203.0.113.0/24"}
			model.IkeIdentity = nil
			model.Address = core.StringPtr("192.0.2.5")
			model.Fqdn = core.StringPtr("my-service.example.com")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPolicyModePeerPrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionPolicyModePeerPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPrototype)
			model.AdminStateUp = core.BoolPtr(true)
			model.DeadPeerDetection = nil
			model.EstablishMode = core.StringPtr("bidirectional")
			model.IkePolicy = nil
			model.IpsecPolicy = nil
			model.Name = core.StringPtr("my-vpn-gateway-connection")
			model.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
			model.DistributeTraffic = core.BoolPtr(false)
			model.Local = nil
			model.Peer = nil
			model.RoutingProtocol = core.StringPtr("none")
			model.Tunnels = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionStaticRouteModeLocalPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionStaticRouteModeLocalPrototype)
			model.IkeIdentities = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionStaticRouteModeLocalPrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionStaticRouteModeLocalPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionStaticRouteModePeerPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionStaticRouteModePeerPrototype)
			model.IkeIdentity = nil
			model.Address = core.StringPtr("192.0.2.5")
			model.Fqdn = core.StringPtr("my-service.example.com")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionStaticRouteModePeerPrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionStaticRouteModePeerPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionTunnel successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionTunnel)
			model.NeighborIP = nil
			model.TunnelInterfaceIP = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionTunnel
			err = vpcv1.UnmarshalVPNGatewayConnectionTunnel(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionTunnelPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionTunnelPrototype)
			model.NeighborIP = nil
			model.TunnelInterfaceIP = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionTunnelPrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionTunnelPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayPatch)
			model.LocalAsn = core.Int64Ptr(int64(64520))
			model.Name = core.StringPtr("my-vpn-gateway")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayPatch
			err = vpcv1.UnmarshalVPNGatewayPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayPrototype)
			model.Name = core.StringPtr("my-vpn-gateway")
			model.ResourceGroup = nil
			model.Subnet = nil
			model.AdvertisedCIDRs = []string{"192.168.3.0/24"}
			model.LocalAsn = core.Int64Ptr(int64(64520))
			model.Mode = core.StringPtr("route")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayPrototype
			err = vpcv1.UnmarshalVPNGatewayPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNServerAuthenticationByUsernameIDProvider successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNServerAuthenticationByUsernameIDProvider)
			model.ProviderType = core.StringPtr("iam")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNServerAuthenticationByUsernameIDProvider
			err = vpcv1.UnmarshalVPNServerAuthenticationByUsernameIDProvider(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNServerAuthenticationPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNServerAuthenticationPrototype)
			model.Method = core.StringPtr("certificate")
			model.IdentityProvider = nil
			model.ClientCa = nil
			model.Crl = core.StringPtr("testString")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result interface{}
			err = vpcv1.UnmarshalVPNServerAuthenticationPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
		})
		It(`Invoke UnmarshalVPNServerPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNServerPatch)
			model.Certificate = nil
			model.ClientAuthentication = nil
			model.ClientDnsServerIps = nil
			model.ClientIdleTimeout = core.Int64Ptr(int64(600))
			model.ClientIPPool = core.StringPtr("172.16.0.0/16")
			model.EnableSplitTunneling = core.BoolPtr(true)
			model.Name = core.StringPtr("my-vpn-server")
			model.Port = core.Int64Ptr(int64(443))
			model.Protocol = core.StringPtr("tcp")
			model.Subnets = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNServerPatch
			err = vpcv1.UnmarshalVPNServerPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNServerRoutePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNServerRoutePatch)
			model.Name = core.StringPtr("my-vpn-route-2")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNServerRoutePatch
			err = vpcv1.UnmarshalVPNServerRoutePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVirtualNetworkInterfaceIPPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VirtualNetworkInterfaceIPPrototype)
			model.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
			model.Address = core.StringPtr("192.168.3.4")
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-reserved-ip")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VirtualNetworkInterfaceIPPrototype
			err = vpcv1.UnmarshalVirtualNetworkInterfaceIPPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVirtualNetworkInterfacePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VirtualNetworkInterfacePatch)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.AutoDelete = core.BoolPtr(false)
			model.EnableInfrastructureNat = core.BoolPtr(true)
			model.Name = core.StringPtr("my-virtual-network-interface")
			model.ProtocolStateFilteringMode = core.StringPtr("auto")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VirtualNetworkInterfacePatch
			err = vpcv1.UnmarshalVirtualNetworkInterfacePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVirtualNetworkInterfacePrimaryIPPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototype)
			model.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
			model.Address = core.StringPtr("192.168.3.4")
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-reserved-ip")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VirtualNetworkInterfacePrimaryIPPrototype
			err = vpcv1.UnmarshalVirtualNetworkInterfacePrimaryIPPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAllowedUsePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAllowedUsePatch)
			model.ApiVersion = core.StringPtr("2024-06-23")
			model.BareMetalServer = core.StringPtr("enable_secure_boot == true")
			model.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAllowedUsePatch
			err = vpcv1.UnmarshalVolumeAllowedUsePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAllowedUsePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAllowedUsePrototype)
			model.ApiVersion = core.StringPtr("2024-06-23")
			model.BareMetalServer = core.StringPtr("enable_secure_boot == true")
			model.Instance = core.StringPtr("gpu.count > 0 && enable_secure_boot == true")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAllowedUsePrototype
			err = vpcv1.UnmarshalVolumeAllowedUsePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAttachmentPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAttachmentPatch)
			model.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
			model.Name = core.StringPtr("my-volume-attachment")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAttachmentPatch
			err = vpcv1.UnmarshalVolumeAttachmentPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAttachmentPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAttachmentPrototype)
			model.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-volume-attachment")
			model.Volume = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAttachmentPrototype
			err = vpcv1.UnmarshalVolumeAttachmentPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAttachmentPrototypeInstanceByImageContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAttachmentPrototypeInstanceByImageContext)
			model.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
			model.Name = core.StringPtr("my-volume-attachment")
			model.Volume = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAttachmentPrototypeInstanceByImageContext
			err = vpcv1.UnmarshalVolumeAttachmentPrototypeInstanceByImageContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext)
			model.DeleteVolumeOnInstanceDelete = core.BoolPtr(true)
			model.Name = core.StringPtr("my-volume-attachment")
			model.Volume = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
			err = vpcv1.UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAttachmentPrototypeInstanceByVolumeContext)
			model.DeleteVolumeOnInstanceDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-volume-attachment")
			model.Volume = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAttachmentPrototypeInstanceByVolumeContext
			err = vpcv1.UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAttachmentPrototypeVolume successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAttachmentPrototypeVolume)
			model.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
			model.Bandwidth = core.Int64Ptr(int64(1000))
			model.Iops = core.Int64Ptr(int64(10000))
			model.Name = core.StringPtr("my-volume")
			model.Profile = nil
			model.ResourceGroup = nil
			model.UserTags = nil
			model.Capacity = core.Int64Ptr(int64(100))
			model.EncryptionKey = nil
			model.AllowedUse = nil
			model.SourceSnapshot = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAttachmentPrototypeVolume
			err = vpcv1.UnmarshalVolumeAttachmentPrototypeVolume(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeIdentity)
			model.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeIdentity
			err = vpcv1.UnmarshalVolumeIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumePatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumePatch)
			model.AllowedUse = nil
			model.Bandwidth = core.Int64Ptr(int64(1000))
			model.Capacity = core.Int64Ptr(int64(100))
			model.Iops = core.Int64Ptr(int64(10000))
			model.Name = core.StringPtr("my-volume")
			model.Profile = nil
			model.UserTags = []string{"testString"}

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumePatch
			err = vpcv1.UnmarshalVolumePatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeProfileIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeProfileIdentity)
			model.Name = core.StringPtr("general-purpose")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeProfileIdentity
			err = vpcv1.UnmarshalVolumeProfileIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumePrototype)
			model.Bandwidth = core.Int64Ptr(int64(1000))
			model.Iops = core.Int64Ptr(int64(10000))
			model.Name = core.StringPtr("my-volume")
			model.Profile = nil
			model.ResourceGroup = nil
			model.UserTags = nil
			model.Zone = nil
			model.Capacity = core.Int64Ptr(int64(100))
			model.EncryptionKey = nil
			model.AllowedUse = nil
			model.SourceSnapshot = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumePrototype
			err = vpcv1.UnmarshalVolumePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumePrototypeInstanceByImageContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumePrototypeInstanceByImageContext)
			model.AllowedUse = nil
			model.Bandwidth = core.Int64Ptr(int64(1000))
			model.Capacity = core.Int64Ptr(int64(100))
			model.EncryptionKey = nil
			model.Iops = core.Int64Ptr(int64(10000))
			model.Name = core.StringPtr("my-volume")
			model.Profile = nil
			model.ResourceGroup = nil
			model.UserTags = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumePrototypeInstanceByImageContext
			err = vpcv1.UnmarshalVolumePrototypeInstanceByImageContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumePrototypeInstanceBySourceSnapshotContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumePrototypeInstanceBySourceSnapshotContext)
			model.AllowedUse = nil
			model.Bandwidth = core.Int64Ptr(int64(1000))
			model.Capacity = core.Int64Ptr(int64(100))
			model.EncryptionKey = nil
			model.Iops = core.Int64Ptr(int64(10000))
			model.Name = core.StringPtr("my-volume")
			model.Profile = nil
			model.ResourceGroup = nil
			model.SourceSnapshot = nil
			model.UserTags = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumePrototypeInstanceBySourceSnapshotContext
			err = vpcv1.UnmarshalVolumePrototypeInstanceBySourceSnapshotContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalZoneIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ZoneIdentity)
			model.Name = core.StringPtr("us-south-1")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ZoneIdentity
			err = vpcv1.UnmarshalZoneIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalAccountIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.AccountIdentityByID)
			model.ID = core.StringPtr("bb1b52262f7441a586f49068482f1e60")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.AccountIdentityByID
			err = vpcv1.UnmarshalAccountIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype)
			model.MatchUserTags = []string{"my-daily-backup-policy"}
			model.Name = core.StringPtr("my-backup-policy")
			model.Plans = nil
			model.ResourceGroup = nil
			model.Scope = nil
			model.IncludedContent = []string{"boot_volume", "data_volumes"}
			model.MatchResourceType = core.StringPtr("instance")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype
			err = vpcv1.UnmarshalBackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyPrototypeBackupPolicyMatchResourceTypeSharePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyPrototypeBackupPolicyMatchResourceTypeSharePrototype)
			model.MatchUserTags = []string{"my-daily-backup-policy"}
			model.Name = core.StringPtr("my-backup-policy")
			model.Plans = nil
			model.ResourceGroup = nil
			model.Scope = nil
			model.MatchResourceType = core.StringPtr("share")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyPrototypeBackupPolicyMatchResourceTypeSharePrototype
			err = vpcv1.UnmarshalBackupPolicyPrototypeBackupPolicyMatchResourceTypeSharePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype)
			model.MatchUserTags = []string{"my-daily-backup-policy"}
			model.Name = core.StringPtr("my-backup-policy")
			model.Plans = nil
			model.ResourceGroup = nil
			model.Scope = nil
			model.MatchResourceType = core.StringPtr("volume")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype
			err = vpcv1.UnmarshalBackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyScopePrototypeEnterpriseIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyScopePrototypeEnterpriseIdentity)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyScopePrototypeEnterpriseIdentity
			err = vpcv1.UnmarshalBackupPolicyScopePrototypeEnterpriseIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity)
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity
			err = vpcv1.UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.AutoDelete = core.BoolPtr(false)
			model.EnableInfrastructureNat = core.BoolPtr(true)
			model.Ips = nil
			model.Name = core.StringPtr("my-virtual-network-interface")
			model.PrimaryIP = nil
			model.ProtocolStateFilteringMode = core.StringPtr("auto")
			model.ResourceGroup = nil
			model.SecurityGroups = nil
			model.Subnet = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext
			err = vpcv1.UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype)
			model.Name = core.StringPtr("my-bare-metal-server-network-attachment")
			model.VirtualNetworkInterface = nil
			model.AllowedVlans = nil
			model.InterfaceType = core.StringPtr("pci")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype
			err = vpcv1.UnmarshalBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype)
			model.Name = core.StringPtr("my-bare-metal-server-network-attachment")
			model.VirtualNetworkInterface = nil
			model.AllowToFloat = core.BoolPtr(false)
			model.InterfaceType = core.StringPtr("vlan")
			model.Vlan = core.Int64Ptr(int64(4))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype
			err = vpcv1.UnmarshalBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.EnableInfrastructureNat = core.BoolPtr(true)
			model.Name = core.StringPtr("my-bare-metal-server-network-interface")
			model.PrimaryIP = nil
			model.SecurityGroups = nil
			model.Subnet = nil
			model.InterfaceType = core.StringPtr("hipersocket")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype
			err = vpcv1.UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.EnableInfrastructureNat = core.BoolPtr(true)
			model.Name = core.StringPtr("my-bare-metal-server-network-interface")
			model.PrimaryIP = nil
			model.SecurityGroups = nil
			model.Subnet = nil
			model.AllowedVlans = nil
			model.InterfaceType = core.StringPtr("pci")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype
			err = vpcv1.UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.EnableInfrastructureNat = core.BoolPtr(true)
			model.Name = core.StringPtr("my-bare-metal-server-network-interface")
			model.PrimaryIP = nil
			model.SecurityGroups = nil
			model.Subnet = nil
			model.AllowInterfaceToFloat = core.BoolPtr(false)
			model.InterfaceType = core.StringPtr("vlan")
			model.Vlan = core.Int64Ptr(int64(4))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype
			err = vpcv1.UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype)
			model.Name = core.StringPtr("my-bare-metal-server-network-attachment")
			model.VirtualNetworkInterface = nil
			model.AllowedVlans = nil
			model.InterfaceType = core.StringPtr("pci")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype
			err = vpcv1.UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerProfileIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerProfileIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerProfileIdentityByHref
			err = vpcv1.UnmarshalBareMetalServerProfileIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerProfileIdentityByName successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerProfileIdentityByName)
			model.Name = core.StringPtr("bx2-metal-192x768")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerProfileIdentityByName
			err = vpcv1.UnmarshalBareMetalServerProfileIdentityByName(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerPrototypeBareMetalServerByNetworkAttachment successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerPrototypeBareMetalServerByNetworkAttachment)
			model.Bandwidth = core.Int64Ptr(int64(20000))
			model.EnableSecureBoot = core.BoolPtr(false)
			model.Initialization = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-bare-metal-server")
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TrustedPlatformModule = nil
			model.VPC = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerPrototypeBareMetalServerByNetworkAttachment
			err = vpcv1.UnmarshalBareMetalServerPrototypeBareMetalServerByNetworkAttachment(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerPrototypeBareMetalServerByNetworkInterface successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerPrototypeBareMetalServerByNetworkInterface)
			model.Bandwidth = core.Int64Ptr(int64(20000))
			model.EnableSecureBoot = core.BoolPtr(false)
			model.Initialization = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-bare-metal-server")
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TrustedPlatformModule = nil
			model.VPC = nil
			model.Zone = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerPrototypeBareMetalServerByNetworkInterface
			err = vpcv1.UnmarshalBareMetalServerPrototypeBareMetalServerByNetworkInterface(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalCatalogOfferingIdentityCatalogOfferingByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.CatalogOfferingIdentityCatalogOfferingByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.CatalogOfferingIdentityCatalogOfferingByCRN
			err = vpcv1.UnmarshalCatalogOfferingIdentityCatalogOfferingByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN
			err = vpcv1.UnmarshalCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalCatalogOfferingVersionPlanIdentityCatalogOfferingVersionPlanByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.CatalogOfferingVersionPlanIdentityCatalogOfferingVersionPlanByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.CatalogOfferingVersionPlanIdentityCatalogOfferingVersionPlanByCRN
			err = vpcv1.UnmarshalCatalogOfferingVersionPlanIdentityCatalogOfferingVersionPlanByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalCertificateInstanceIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.CertificateInstanceIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.CertificateInstanceIdentityByCRN
			err = vpcv1.UnmarshalCertificateInstanceIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalCloudObjectStorageBucketIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.CloudObjectStorageBucketIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.CloudObjectStorageBucketIdentityByCRN
			err = vpcv1.UnmarshalCloudObjectStorageBucketIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName)
			model.Name = core.StringPtr("bucket-27200-lwx4cfvcue")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName
			err = vpcv1.UnmarshalCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContext)
			model.ID = core.StringPtr("0717-d4d6489a-3bf5-4104-a33a-3572faf2d117")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContext
			err = vpcv1.UnmarshalClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext)
			model.Address = core.StringPtr("192.168.3.4")
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-cluster-network-subnet-reserved-ip")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext
			err = vpcv1.UnmarshalClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkProfileIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkProfileIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkProfileIdentityByHref
			err = vpcv1.UnmarshalClusterNetworkProfileIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkProfileIdentityByName successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkProfileIdentityByName)
			model.Name = core.StringPtr("h100")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkProfileIdentityByName
			err = vpcv1.UnmarshalClusterNetworkProfileIdentityByName(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkSubnetIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkSubnetIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkSubnetIdentityByHref
			err = vpcv1.UnmarshalClusterNetworkSubnetIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkSubnetIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkSubnetIdentityByID)
			model.ID = core.StringPtr("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkSubnetIdentityByID
			err = vpcv1.UnmarshalClusterNetworkSubnetIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype)
			model.IPVersion = core.StringPtr("ipv4")
			model.Name = core.StringPtr("my-cluster-network-subnet")
			model.Ipv4CIDRBlock = core.StringPtr("10.0.0.0/24")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype
			err = vpcv1.UnmarshalClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype)
			model.IPVersion = core.StringPtr("ipv4")
			model.Name = core.StringPtr("my-cluster-network-subnet")
			model.TotalIpv4AddressCount = core.Int64Ptr(int64(256))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype
			err = vpcv1.UnmarshalClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDnsInstanceIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DnsInstanceIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DnsInstanceIdentityByCRN
			err = vpcv1.UnmarshalDnsInstanceIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDnsZoneIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DnsZoneIdentityByID)
			model.ID = core.StringPtr("d66662cc-aa23-4fe1-9987-858487a61f45")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DnsZoneIdentityByID
			err = vpcv1.UnmarshalDnsZoneIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDedicatedHostGroupIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DedicatedHostGroupIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DedicatedHostGroupIdentityByCRN
			err = vpcv1.UnmarshalDedicatedHostGroupIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDedicatedHostGroupIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DedicatedHostGroupIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DedicatedHostGroupIdentityByHref
			err = vpcv1.UnmarshalDedicatedHostGroupIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDedicatedHostGroupIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DedicatedHostGroupIdentityByID)
			model.ID = core.StringPtr("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DedicatedHostGroupIdentityByID
			err = vpcv1.UnmarshalDedicatedHostGroupIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDedicatedHostProfileIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DedicatedHostProfileIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles/mx2-host-152x1216")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DedicatedHostProfileIdentityByHref
			err = vpcv1.UnmarshalDedicatedHostProfileIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDedicatedHostProfileIdentityByName successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DedicatedHostProfileIdentityByName)
			model.Name = core.StringPtr("mx2-host-152x1216")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DedicatedHostProfileIdentityByName
			err = vpcv1.UnmarshalDedicatedHostProfileIdentityByName(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDedicatedHostPrototypeDedicatedHostByGroup successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DedicatedHostPrototypeDedicatedHostByGroup)
			model.InstancePlacementEnabled = core.BoolPtr(true)
			model.Name = core.StringPtr("my-host")
			model.Profile = nil
			model.ResourceGroup = nil
			model.Group = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DedicatedHostPrototypeDedicatedHostByGroup
			err = vpcv1.UnmarshalDedicatedHostPrototypeDedicatedHostByGroup(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalDedicatedHostPrototypeDedicatedHostByZone successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.DedicatedHostPrototypeDedicatedHostByZone)
			model.InstancePlacementEnabled = core.BoolPtr(true)
			model.Name = core.StringPtr("my-host")
			model.Profile = nil
			model.ResourceGroup = nil
			model.Group = nil
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.DedicatedHostPrototypeDedicatedHostByZone
			err = vpcv1.UnmarshalDedicatedHostPrototypeDedicatedHostByZone(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEncryptionKeyIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EncryptionKeyIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EncryptionKeyIdentityByCRN
			err = vpcv1.UnmarshalEncryptionKeyIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEndpointGatewayReservedIPReservedIPIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EndpointGatewayReservedIPReservedIPIdentity)
			model.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EndpointGatewayReservedIPReservedIPIdentity
			err = vpcv1.UnmarshalEndpointGatewayReservedIPReservedIPIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEndpointGatewayReservedIPReservedIPPrototypeTargetContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EndpointGatewayReservedIPReservedIPPrototypeTargetContext)
			model.Address = core.StringPtr("192.168.3.4")
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-reserved-ip")
			model.Subnet = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EndpointGatewayReservedIPReservedIPPrototypeTargetContext
			err = vpcv1.UnmarshalEndpointGatewayReservedIPReservedIPPrototypeTargetContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN
			err = vpcv1.UnmarshalEndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5")
			model.ResourceType = core.StringPtr("private_path_service_gateway")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype
			err = vpcv1.UnmarshalEndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderCloudServicePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderCloudServicePrototype)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:cloudant:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:3527280b-9327-4411-8020-591092e60353::")
			model.ResourceType = core.StringPtr("provider_cloud_service")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderCloudServicePrototype
			err = vpcv1.UnmarshalEndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderCloudServicePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype)
			model.Name = core.StringPtr("ibm-ntp-server")
			model.ResourceType = core.StringPtr("provider_infrastructure_service")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype
			err = vpcv1.UnmarshalEndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPPrototypeFloatingIPByTarget successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPPrototypeFloatingIPByTarget)
			model.Name = core.StringPtr("my-floating-ip")
			model.ResourceGroup = nil
			model.Target = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPPrototypeFloatingIPByTarget
			err = vpcv1.UnmarshalFloatingIPPrototypeFloatingIPByTarget(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPPrototypeFloatingIPByZone successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPPrototypeFloatingIPByZone)
			model.Name = core.StringPtr("my-floating-ip")
			model.ResourceGroup = nil
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPPrototypeFloatingIPByZone
			err = vpcv1.UnmarshalFloatingIPPrototypeFloatingIPByZone(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity)
			model.ID = core.StringPtr("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity
			err = vpcv1.UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPatchNetworkInterfaceIdentity)
			model.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPatchNetworkInterfaceIdentity
			err = vpcv1.UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPatchVirtualNetworkInterfaceIdentity)
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPatchVirtualNetworkInterfaceIdentity
			err = vpcv1.UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity)
			model.ID = core.StringPtr("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity
			err = vpcv1.UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPrototypeNetworkInterfaceIdentity)
			model.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPrototypeNetworkInterfaceIdentity
			err = vpcv1.UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity)
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity
			err = vpcv1.UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeInstanceIdentity)
			model.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeInstanceIdentity
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity)
			model.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity)
			model.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeSubnetIdentity)
			model.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeSubnetIdentity
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeVPCIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeVPCIdentity)
			model.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeVPCIdentity
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeVPCIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity)
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalImageIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ImageIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ImageIdentityByCRN
			err = vpcv1.UnmarshalImageIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalImageIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ImageIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ImageIdentityByHref
			err = vpcv1.UnmarshalImageIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalImageIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ImageIdentityByID)
			model.ID = core.StringPtr("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ImageIdentityByID
			err = vpcv1.UnmarshalImageIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalImagePrototypeImageByFile successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ImagePrototypeImageByFile)
			model.AllowedUse = nil
			model.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
			model.Name = core.StringPtr("my-image")
			model.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
			model.ResourceGroup = nil
			model.EncryptedDataKey = core.StringPtr("testString")
			model.EncryptionKey = nil
			model.File = nil
			model.OperatingSystem = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ImagePrototypeImageByFile
			err = vpcv1.UnmarshalImagePrototypeImageByFile(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalImagePrototypeImageBySourceVolume successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ImagePrototypeImageBySourceVolume)
			model.AllowedUse = nil
			model.DeprecationAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
			model.Name = core.StringPtr("my-image")
			model.ObsolescenceAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")
			model.ResourceGroup = nil
			model.EncryptionKey = nil
			model.SourceVolume = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ImagePrototypeImageBySourceVolume
			err = vpcv1.UnmarshalImagePrototypeImageBySourceVolume(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByOffering successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceCatalogOfferingPrototypeCatalogOfferingByOffering)
			model.Plan = nil
			model.Offering = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
			err = vpcv1.UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByOffering(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByVersion successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceCatalogOfferingPrototypeCatalogOfferingByVersion)
			model.Plan = nil
			model.Version = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceCatalogOfferingPrototypeCatalogOfferingByVersion
			err = vpcv1.UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByVersion(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref
			err = vpcv1.UnmarshalInstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID)
			model.ID = core.StringPtr("0717-fb880975-db45-4459-8548-64e3995ac213")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID
			err = vpcv1.UnmarshalInstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentity)
			model.ID = core.StringPtr("0717-ffc092f7-5d02-4b93-ab69-26860529b9fb")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentity
			err = vpcv1.UnmarshalInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment)
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-cluster-network-interface")
			model.PrimaryIP = nil
			model.Subnet = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment
			err = vpcv1.UnmarshalInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototype)
			model.Name = core.StringPtr("my-instance-group-manager-action")
			model.CronSpec = core.StringPtr("30 */2 * * 1-5")
			model.Group = nil
			model.Manager = nil
			model.RunAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototype
			err = vpcv1.UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype)
			model.Name = core.StringPtr("my-instance-group-manager-policy")
			model.MetricType = core.StringPtr("cpu")
			model.MetricValue = core.Int64Ptr(int64(0))
			model.PolicyType = core.StringPtr("target")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype
			err = vpcv1.UnmarshalInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype)
			model.ManagementEnabled = core.BoolPtr(true)
			model.Name = core.StringPtr("my-instance-group-manager")
			model.AggregationWindow = core.Int64Ptr(int64(120))
			model.Cooldown = core.Int64Ptr(int64(210))
			model.ManagerType = core.StringPtr("autoscale")
			model.MaxMembershipCount = core.Int64Ptr(int64(10))
			model.MinMembershipCount = core.Int64Ptr(int64(10))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype
			err = vpcv1.UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype)
			model.ManagementEnabled = core.BoolPtr(true)
			model.Name = core.StringPtr("my-instance-group-manager")
			model.ManagerType = core.StringPtr("scheduled")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype
			err = vpcv1.UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype)
			model.MaxMembershipCount = core.Int64Ptr(int64(10))
			model.MinMembershipCount = core.Int64Ptr(int64(10))
			model.ID = core.StringPtr("r006-bd21f31f-8a05-4451-836d-ab0347e91fea")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype
			err = vpcv1.UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity)
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity
			err = vpcv1.UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.AutoDelete = core.BoolPtr(false)
			model.EnableInfrastructureNat = core.BoolPtr(true)
			model.Ips = nil
			model.Name = core.StringPtr("my-virtual-network-interface")
			model.PrimaryIP = nil
			model.ProtocolStateFilteringMode = core.StringPtr("auto")
			model.ResourceGroup = nil
			model.SecurityGroups = nil
			model.Subnet = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
			err = vpcv1.UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePatchProfileInstanceProfileIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePatchProfileInstanceProfileIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePatchProfileInstanceProfileIdentityByHref
			err = vpcv1.UnmarshalInstancePatchProfileInstanceProfileIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePatchProfileInstanceProfileIdentityByName successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePatchProfileInstanceProfileIdentityByName)
			model.Name = core.StringPtr("bx2-4x16")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePatchProfileInstanceProfileIdentityByName
			err = vpcv1.UnmarshalInstancePatchProfileInstanceProfileIdentityByName(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPatchDedicatedHostGroupIdentity)
			model.ID = core.StringPtr("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPatchDedicatedHostGroupIdentity
			err = vpcv1.UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPatchDedicatedHostIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPatchDedicatedHostIdentity)
			model.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPatchDedicatedHostIdentity
			err = vpcv1.UnmarshalInstancePlacementTargetPatchDedicatedHostIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostGroupIdentity)
			model.ID = core.StringPtr("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPrototypeDedicatedHostGroupIdentity
			err = vpcv1.UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentity)
			model.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentity
			err = vpcv1.UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPrototypePlacementGroupIdentity)
			model.ID = core.StringPtr("r006-418fe842-a3e9-47b9-a938-1aa5bd632871")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPrototypePlacementGroupIdentity
			err = vpcv1.UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceProfileIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceProfileIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceProfileIdentityByHref
			err = vpcv1.UnmarshalInstanceProfileIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceProfileIdentityByName successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceProfileIdentityByName)
			model.Name = core.StringPtr("bx2-4x16")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceProfileIdentityByName
			err = vpcv1.UnmarshalInstanceProfileIdentityByName(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePrototypeInstanceByCatalogOffering successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePrototypeInstanceByCatalogOffering)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.CatalogOffering = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePrototypeInstanceByCatalogOffering
			err = vpcv1.UnmarshalInstancePrototypeInstanceByCatalogOffering(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePrototypeInstanceByImage successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePrototypeInstanceByImage)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Image = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePrototypeInstanceByImage
			err = vpcv1.UnmarshalInstancePrototypeInstanceByImage(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePrototypeInstanceBySourceSnapshot successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePrototypeInstanceBySourceSnapshot)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePrototypeInstanceBySourceSnapshot
			err = vpcv1.UnmarshalInstancePrototypeInstanceBySourceSnapshot(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePrototypeInstanceBySourceTemplate successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePrototypeInstanceBySourceTemplate)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.CatalogOffering = nil
			model.Image = nil
			model.NetworkAttachments = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkAttachment = nil
			model.PrimaryNetworkInterface = nil
			model.SourceTemplate = nil
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePrototypeInstanceBySourceTemplate
			err = vpcv1.UnmarshalInstancePrototypeInstanceBySourceTemplate(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePrototypeInstanceByVolume successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePrototypeInstanceByVolume)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePrototypeInstanceByVolume
			err = vpcv1.UnmarshalInstancePrototypeInstanceByVolume(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplateIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplateIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplateIdentityByCRN
			err = vpcv1.UnmarshalInstanceTemplateIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplateIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplateIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplateIdentityByHref
			err = vpcv1.UnmarshalInstanceTemplateIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplateIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplateIdentityByID)
			model.ID = core.StringPtr("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplateIdentityByID
			err = vpcv1.UnmarshalInstanceTemplateIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateByCatalogOffering)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.CatalogOffering = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplatePrototypeInstanceTemplateByCatalogOffering
			err = vpcv1.UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateByImage)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Image = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplatePrototypeInstanceTemplateByImage
			err = vpcv1.UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot
			err = vpcv1.UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateBySourceTemplate)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.CatalogOffering = nil
			model.Image = nil
			model.NetworkAttachments = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkAttachment = nil
			model.PrimaryNetworkInterface = nil
			model.SourceTemplate = nil
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplatePrototypeInstanceTemplateBySourceTemplate
			err = vpcv1.UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalKeyIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.KeyIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.KeyIdentityByCRN
			err = vpcv1.UnmarshalKeyIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalKeyIdentityByFingerprint successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.KeyIdentityByFingerprint)
			model.Fingerprint = core.StringPtr("SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.KeyIdentityByFingerprint
			err = vpcv1.UnmarshalKeyIdentityByFingerprint(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalKeyIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.KeyIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.KeyIdentityByHref
			err = vpcv1.UnmarshalKeyIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalKeyIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.KeyIdentityByID)
			model.ID = core.StringPtr("r006-82679077-ac3b-4c10-be16-63e9c21f0f45")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.KeyIdentityByID
			err = vpcv1.UnmarshalKeyIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName)
			model.Name = core.StringPtr("bucket-27200-lwx4cfvcue")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName
			err = vpcv1.UnmarshalLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerIdentityByCRN
			err = vpcv1.UnmarshalLoadBalancerIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerIdentityByHref
			err = vpcv1.UnmarshalLoadBalancerIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerIdentityByID)
			model.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerIdentityByID
			err = vpcv1.UnmarshalLoadBalancerIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByHref
			err = vpcv1.UnmarshalLoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID)
			model.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID
			err = vpcv1.UnmarshalLoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerIdentityByHref
			err = vpcv1.UnmarshalLoadBalancerListenerIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerIdentityByID)
			model.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerIdentityByID
			err = vpcv1.UnmarshalLoadBalancerListenerIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentity)
			model.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentity
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyHTTPSRedirectPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyHTTPSRedirectPatch)
			model.HTTPStatusCode = core.Int64Ptr(int64(301))
			model.Listener = nil
			model.URI = core.StringPtr("/example?doc=get")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyHTTPSRedirectPatch
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyHTTPSRedirectPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch)
			model.HTTPStatusCode = core.Int64Ptr(int64(301))
			model.URL = core.StringPtr("https://ibm.com:443/new/{path}?{query}")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity)
			model.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentity)
			model.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentity
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyHTTPSRedirectPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyHTTPSRedirectPrototype)
			model.HTTPStatusCode = core.Int64Ptr(int64(301))
			model.Listener = nil
			model.URI = core.StringPtr("/example?doc=get")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyHTTPSRedirectPrototype
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyHTTPSRedirectPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype)
			model.HTTPStatusCode = core.Int64Ptr(int64(301))
			model.URL = core.StringPtr("https://ibm.com:443/new/{path}?{query}")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity)
			model.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByHref
			err = vpcv1.UnmarshalLoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID)
			model.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID
			err = vpcv1.UnmarshalLoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeHttphttpsPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeHttphttpsPrototype)
			model.Delay = core.Int64Ptr(int64(5))
			model.MaxRetries = core.Int64Ptr(int64(2))
			model.Port = core.Int64Ptr(int64(22))
			model.Timeout = core.Int64Ptr(int64(2))
			model.Type = core.StringPtr("http")
			model.URLPath = core.StringPtr("/")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeHttphttpsPrototype
			err = vpcv1.UnmarshalLoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeHttphttpsPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype)
			model.Delay = core.Int64Ptr(int64(5))
			model.MaxRetries = core.Int64Ptr(int64(2))
			model.Port = core.Int64Ptr(int64(22))
			model.Timeout = core.Int64Ptr(int64(2))
			model.Type = core.StringPtr("tcp")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype
			err = vpcv1.UnmarshalLoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref
			err = vpcv1.UnmarshalLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
			model.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolIdentityLoadBalancerPoolIdentityByID
			err = vpcv1.UnmarshalLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberTargetPrototypeIP successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeIP)
			model.Address = core.StringPtr("192.168.3.4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberTargetPrototypeIP
			err = vpcv1.UnmarshalLoadBalancerPoolMemberTargetPrototypeIP(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentity)
			model.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentity
			err = vpcv1.UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentity)
			model.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentity
			err = vpcv1.UnmarshalLoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity)
			model.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity
			err = vpcv1.UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerProfileIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerProfileIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerProfileIdentityByHref
			err = vpcv1.UnmarshalLoadBalancerProfileIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerProfileIdentityByName successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerProfileIdentityByName)
			model.Name = core.StringPtr("network-fixed")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerProfileIdentityByName
			err = vpcv1.UnmarshalLoadBalancerProfileIdentityByName(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLIdentityByCRN
			err = vpcv1.UnmarshalNetworkACLIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLIdentityByHref
			err = vpcv1.UnmarshalNetworkACLIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLIdentityByID)
			model.ID = core.StringPtr("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLIdentityByID
			err = vpcv1.UnmarshalNetworkACLIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLPrototypeNetworkACLByRules successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLPrototypeNetworkACLByRules)
			model.Name = core.StringPtr("my-network-acl")
			model.ResourceGroup = nil
			model.VPC = nil
			model.Rules = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLPrototypeNetworkACLByRules
			err = vpcv1.UnmarshalNetworkACLPrototypeNetworkACLByRules(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLPrototypeNetworkACLBySourceNetworkACL successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLPrototypeNetworkACLBySourceNetworkACL)
			model.Name = core.StringPtr("my-network-acl")
			model.ResourceGroup = nil
			model.VPC = nil
			model.SourceNetworkACL = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLPrototypeNetworkACLBySourceNetworkACL
			err = vpcv1.UnmarshalNetworkACLPrototypeNetworkACLBySourceNetworkACL(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref
			err = vpcv1.UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID)
			model.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID
			err = vpcv1.UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref
			err = vpcv1.UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID)
			model.ID = core.StringPtr("r006-8daca77a-4980-4d33-8f3e-7038797be8f9")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID
			err = vpcv1.UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype)
			model.Action = core.StringPtr("allow")
			model.Destination = core.StringPtr("192.168.3.2/32")
			model.Direction = core.StringPtr("inbound")
			model.IPVersion = core.StringPtr("ipv4")
			model.Name = core.StringPtr("my-network-acl-rule")
			model.Source = core.StringPtr("192.168.3.2/32")
			model.Protocol = core.StringPtr("all")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype
			err = vpcv1.UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype)
			model.Action = core.StringPtr("allow")
			model.Destination = core.StringPtr("192.168.3.2/32")
			model.Direction = core.StringPtr("inbound")
			model.IPVersion = core.StringPtr("ipv4")
			model.Name = core.StringPtr("my-network-acl-rule")
			model.Source = core.StringPtr("192.168.3.2/32")
			model.Code = core.Int64Ptr(int64(0))
			model.Protocol = core.StringPtr("icmp")
			model.Type = core.Int64Ptr(int64(8))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype
			err = vpcv1.UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype)
			model.Action = core.StringPtr("allow")
			model.Destination = core.StringPtr("192.168.3.2/32")
			model.Direction = core.StringPtr("inbound")
			model.IPVersion = core.StringPtr("ipv4")
			model.Name = core.StringPtr("my-network-acl-rule")
			model.Source = core.StringPtr("192.168.3.2/32")
			model.DestinationPortMax = core.Int64Ptr(int64(22))
			model.DestinationPortMin = core.Int64Ptr(int64(22))
			model.Protocol = core.StringPtr("tcp")
			model.SourcePortMax = core.Int64Ptr(int64(65535))
			model.SourcePortMin = core.Int64Ptr(int64(49152))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype
			err = vpcv1.UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype)
			model.Action = core.StringPtr("allow")
			model.Before = nil
			model.Destination = core.StringPtr("192.168.3.2/32")
			model.Direction = core.StringPtr("inbound")
			model.IPVersion = core.StringPtr("ipv4")
			model.Name = core.StringPtr("my-network-acl-rule")
			model.Source = core.StringPtr("192.168.3.2/32")
			model.Protocol = core.StringPtr("all")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype
			err = vpcv1.UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype)
			model.Action = core.StringPtr("allow")
			model.Before = nil
			model.Destination = core.StringPtr("192.168.3.2/32")
			model.Direction = core.StringPtr("inbound")
			model.IPVersion = core.StringPtr("ipv4")
			model.Name = core.StringPtr("my-network-acl-rule")
			model.Source = core.StringPtr("192.168.3.2/32")
			model.Code = core.Int64Ptr(int64(0))
			model.Protocol = core.StringPtr("icmp")
			model.Type = core.Int64Ptr(int64(8))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype
			err = vpcv1.UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype)
			model.Action = core.StringPtr("allow")
			model.Before = nil
			model.Destination = core.StringPtr("192.168.3.2/32")
			model.Direction = core.StringPtr("inbound")
			model.IPVersion = core.StringPtr("ipv4")
			model.Name = core.StringPtr("my-network-acl-rule")
			model.Source = core.StringPtr("192.168.3.2/32")
			model.DestinationPortMax = core.Int64Ptr(int64(22))
			model.DestinationPortMin = core.Int64Ptr(int64(22))
			model.Protocol = core.StringPtr("tcp")
			model.SourcePortMax = core.Int64Ptr(int64(65535))
			model.SourcePortMin = core.Int64Ptr(int64(49152))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype
			err = vpcv1.UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPIdentity)
			model.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkInterfaceIPPrototypeReservedIPIdentity
			err = vpcv1.UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext)
			model.Address = core.StringPtr("192.168.3.4")
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-reserved-ip")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
			err = vpcv1.UnmarshalNetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalOperatingSystemIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.OperatingSystemIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.OperatingSystemIdentityByHref
			err = vpcv1.UnmarshalOperatingSystemIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalOperatingSystemIdentityByName successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.OperatingSystemIdentityByName)
			model.Name = core.StringPtr("ubuntu-24-04-amd64")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.OperatingSystemIdentityByName
			err = vpcv1.UnmarshalOperatingSystemIdentityByName(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentity)
			model.ID = core.StringPtr("r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")
			model.Address = core.StringPtr("203.0.113.1")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentity
			err = vpcv1.UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext)
			model.Name = core.StringPtr("my-floating-ip")
			model.ResourceGroup = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext
			err = vpcv1.UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicGatewayIdentityPublicGatewayIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicGatewayIdentityPublicGatewayIdentityByCRN
			err = vpcv1.UnmarshalPublicGatewayIdentityPublicGatewayIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicGatewayIdentityPublicGatewayIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicGatewayIdentityPublicGatewayIdentityByHref
			err = vpcv1.UnmarshalPublicGatewayIdentityPublicGatewayIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicGatewayIdentityPublicGatewayIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicGatewayIdentityPublicGatewayIdentityByID)
			model.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicGatewayIdentityPublicGatewayIdentityByID
			err = vpcv1.UnmarshalPublicGatewayIdentityPublicGatewayIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRegionIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RegionIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/regions/us-south")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RegionIdentityByHref
			err = vpcv1.UnmarshalRegionIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRegionIdentityByName successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RegionIdentityByName)
			model.Name = core.StringPtr("us-south")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RegionIdentityByName
			err = vpcv1.UnmarshalRegionIdentityByName(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservationIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservationIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservationIdentityByCRN
			err = vpcv1.UnmarshalReservationIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservationIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservationIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservationIdentityByHref
			err = vpcv1.UnmarshalReservationIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservationIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservationIdentityByID)
			model.ID = core.StringPtr("0717-ba49df72-37b8-43ac-98da-f8e029de0e63")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservationIdentityByID
			err = vpcv1.UnmarshalReservationIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservedIPTargetPrototypeEndpointGatewayIdentity)
			model.ID = core.StringPtr("r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservedIPTargetPrototypeEndpointGatewayIdentity
			err = vpcv1.UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity)
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity
			err = vpcv1.UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalResourceGroupIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ResourceGroupIdentityByID)
			model.ID = core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ResourceGroupIdentityByID
			err = vpcv1.UnmarshalResourceGroupIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRouteNextHopPatchRouteNextHopIP successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RouteNextHopPatchRouteNextHopIP)
			model.Address = core.StringPtr("0.0.0.0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RouteNextHopPatchRouteNextHopIP
			err = vpcv1.UnmarshalRouteNextHopPatchRouteNextHopIP(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RouteNextHopPatchVPNGatewayConnectionIdentity)
			model.ID = core.StringPtr("0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RouteNextHopPatchVPNGatewayConnectionIdentity
			err = vpcv1.UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRouteNextHopPrototypeRouteNextHopIP successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RouteNextHopPrototypeRouteNextHopIP)
			model.Address = core.StringPtr("0.0.0.0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RouteNextHopPrototypeRouteNextHopIP
			err = vpcv1.UnmarshalRouteNextHopPrototypeRouteNextHopIP(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRouteNextHopPrototypeVPNGatewayConnectionIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RouteNextHopPrototypeVPNGatewayConnectionIdentity)
			model.ID = core.StringPtr("0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RouteNextHopPrototypeVPNGatewayConnectionIdentity
			err = vpcv1.UnmarshalRouteNextHopPrototypeVPNGatewayConnectionIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRoutingTableIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RoutingTableIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RoutingTableIdentityByCRN
			err = vpcv1.UnmarshalRoutingTableIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRoutingTableIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RoutingTableIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RoutingTableIdentityByHref
			err = vpcv1.UnmarshalRoutingTableIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRoutingTableIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RoutingTableIdentityByID)
			model.ID = core.StringPtr("r006-6885e83f-03b2-4603-8a86-db2a0f55c840")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RoutingTableIdentityByID
			err = vpcv1.UnmarshalRoutingTableIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupIdentityByCRN
			err = vpcv1.UnmarshalSecurityGroupIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupIdentityByHref
			err = vpcv1.UnmarshalSecurityGroupIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupIdentityByID)
			model.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupIdentityByID
			err = vpcv1.UnmarshalSecurityGroupIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleLocalPatchCIDR successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleLocalPatchCIDR)
			model.CIDRBlock = core.StringPtr("192.168.3.0/24")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleLocalPatchCIDR
			err = vpcv1.UnmarshalSecurityGroupRuleLocalPatchCIDR(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleLocalPatchIP successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleLocalPatchIP)
			model.Address = core.StringPtr("192.168.3.4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleLocalPatchIP
			err = vpcv1.UnmarshalSecurityGroupRuleLocalPatchIP(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleLocalPrototypeCIDR successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleLocalPrototypeCIDR)
			model.CIDRBlock = core.StringPtr("192.168.3.0/24")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleLocalPrototypeCIDR
			err = vpcv1.UnmarshalSecurityGroupRuleLocalPrototypeCIDR(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleLocalPrototypeIP successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleLocalPrototypeIP)
			model.Address = core.StringPtr("192.168.3.4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleLocalPrototypeIP
			err = vpcv1.UnmarshalSecurityGroupRuleLocalPrototypeIP(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll)
			model.Direction = core.StringPtr("inbound")
			model.IPVersion = core.StringPtr("ipv4")
			model.Local = nil
			model.Remote = nil
			model.Protocol = core.StringPtr("all")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll
			err = vpcv1.UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp)
			model.Direction = core.StringPtr("inbound")
			model.IPVersion = core.StringPtr("ipv4")
			model.Local = nil
			model.Remote = nil
			model.Code = core.Int64Ptr(int64(0))
			model.Protocol = core.StringPtr("icmp")
			model.Type = core.Int64Ptr(int64(8))

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp
			err = vpcv1.UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp)
			model.Direction = core.StringPtr("inbound")
			model.IPVersion = core.StringPtr("ipv4")
			model.Local = nil
			model.Remote = nil
			model.PortMax = core.Int64Ptr(int64(22))
			model.PortMin = core.Int64Ptr(int64(22))
			model.Protocol = core.StringPtr("tcp")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp
			err = vpcv1.UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleRemotePatchCIDR successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleRemotePatchCIDR)
			model.CIDRBlock = core.StringPtr("192.168.3.0/24")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleRemotePatchCIDR
			err = vpcv1.UnmarshalSecurityGroupRuleRemotePatchCIDR(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleRemotePatchIP successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleRemotePatchIP)
			model.Address = core.StringPtr("192.168.3.4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleRemotePatchIP
			err = vpcv1.UnmarshalSecurityGroupRuleRemotePatchIP(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleRemotePatchSecurityGroupIdentity)
			model.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleRemotePatchSecurityGroupIdentity
			err = vpcv1.UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleRemotePrototypeCIDR successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleRemotePrototypeCIDR)
			model.CIDRBlock = core.StringPtr("192.168.3.0/24")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleRemotePrototypeCIDR
			err = vpcv1.UnmarshalSecurityGroupRuleRemotePrototypeCIDR(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleRemotePrototypeIP successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleRemotePrototypeIP)
			model.Address = core.StringPtr("192.168.3.4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleRemotePrototypeIP
			err = vpcv1.UnmarshalSecurityGroupRuleRemotePrototypeIP(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleRemotePrototypeSecurityGroupIdentity)
			model.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleRemotePrototypeSecurityGroupIdentity
			err = vpcv1.UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareIdentityByCRN
			err = vpcv1.UnmarshalShareIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareIdentityByHref
			err = vpcv1.UnmarshalShareIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareIdentityByID)
			model.ID = core.StringPtr("r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareIdentityByID
			err = vpcv1.UnmarshalShareIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup)
			model.AccessProtocol = core.StringPtr("nfs4")
			model.Name = core.StringPtr("my-share-mount-target")
			model.TransitEncryption = core.StringPtr("none")
			model.VirtualNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup
			err = vpcv1.UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC)
			model.AccessProtocol = core.StringPtr("nfs4")
			model.Name = core.StringPtr("my-share-mount-target")
			model.TransitEncryption = core.StringPtr("none")
			model.VPC = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC
			err = vpcv1.UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity)
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity
			err = vpcv1.UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext)
			model.AllowIPSpoofing = core.BoolPtr(true)
			model.AutoDelete = core.BoolPtr(false)
			model.EnableInfrastructureNat = core.BoolPtr(true)
			model.Ips = nil
			model.Name = core.StringPtr("my-virtual-network-interface")
			model.PrimaryIP = nil
			model.ProtocolStateFilteringMode = core.StringPtr("auto")
			model.ResourceGroup = nil
			model.SecurityGroups = nil
			model.Subnet = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext
			err = vpcv1.UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareProfileIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareProfileIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareProfileIdentityByHref
			err = vpcv1.UnmarshalShareProfileIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareProfileIdentityByName successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareProfileIdentityByName)
			model.Name = core.StringPtr("tier-3iops")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareProfileIdentityByName
			err = vpcv1.UnmarshalShareProfileIdentityByName(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSharePrototypeShareByOriginShare successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SharePrototypeShareByOriginShare)
			model.AllowedTransitEncryptionModes = []string{"ipsec"}
			model.MountTargets = nil
			model.Name = core.StringPtr("my-share")
			model.ReplicaShare = nil
			model.UserTags = nil
			model.OriginShare = nil
			model.ResourceGroup = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SharePrototypeShareByOriginShare
			err = vpcv1.UnmarshalSharePrototypeShareByOriginShare(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSharePrototypeShareBySize successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SharePrototypeShareBySize)
			model.AllowedTransitEncryptionModes = []string{"ipsec"}
			model.MountTargets = nil
			model.Name = core.StringPtr("my-share")
			model.ReplicaShare = nil
			model.UserTags = nil
			model.AccessControlMode = core.StringPtr("security_group")
			model.AllowedAccessProtocols = []string{"nfs4"}
			model.Bandwidth = core.Int64Ptr(int64(100))
			model.EncryptionKey = nil
			model.InitialOwner = nil
			model.Iops = core.Int64Ptr(int64(100))
			model.Profile = nil
			model.ResourceGroup = nil
			model.Size = core.Int64Ptr(int64(200))
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SharePrototypeShareBySize
			err = vpcv1.UnmarshalSharePrototypeShareBySize(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSharePrototypeShareBySourceShare successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SharePrototypeShareBySourceShare)
			model.AllowedTransitEncryptionModes = []string{"ipsec"}
			model.MountTargets = nil
			model.Name = core.StringPtr("my-share")
			model.ReplicaShare = nil
			model.UserTags = nil
			model.EncryptionKey = nil
			model.Iops = core.Int64Ptr(int64(100))
			model.Profile = nil
			model.ReplicationCronSpec = core.StringPtr("0 */5 * * *")
			model.ResourceGroup = nil
			model.SourceShare = nil
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SharePrototypeShareBySourceShare
			err = vpcv1.UnmarshalSharePrototypeShareBySourceShare(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSharePrototypeShareBySourceSnapshot successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SharePrototypeShareBySourceSnapshot)
			model.AllowedTransitEncryptionModes = []string{"ipsec"}
			model.MountTargets = nil
			model.Name = core.StringPtr("my-share")
			model.ReplicaShare = nil
			model.UserTags = nil
			model.AllowedAccessProtocols = []string{"nfs4"}
			model.Bandwidth = core.Int64Ptr(int64(100))
			model.EncryptionKey = nil
			model.InitialOwner = nil
			model.Iops = core.Int64Ptr(int64(100))
			model.Profile = nil
			model.ResourceGroup = nil
			model.Size = core.Int64Ptr(int64(200))
			model.SourceSnapshot = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SharePrototypeShareBySourceSnapshot
			err = vpcv1.UnmarshalSharePrototypeShareBySourceSnapshot(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareSourceSnapshotPrototypeShareSnapshotIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareSourceSnapshotPrototypeShareSnapshotIdentity)
			model.ID = core.StringPtr("r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareSourceSnapshotPrototypeShareSnapshotIdentity
			err = vpcv1.UnmarshalShareSourceSnapshotPrototypeShareSnapshotIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots)
			model.DeleteSnapshotsOnDelete = core.BoolPtr(true)
			model.Name = core.StringPtr("my-snapshot-consistency-group")
			model.ResourceGroup = nil
			model.Snapshots = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots
			err = vpcv1.UnmarshalSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotIdentityByCRN
			err = vpcv1.UnmarshalSnapshotIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotIdentityByHref
			err = vpcv1.UnmarshalSnapshotIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotIdentityByID)
			model.ID = core.StringPtr("r006-f6bfa329-0e36-433f-a3bb-0df632e79263")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotIdentityByID
			err = vpcv1.UnmarshalSnapshotIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotPrototypeSnapshotBySourceSnapshot successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotPrototypeSnapshotBySourceSnapshot)
			model.AllowedUse = nil
			model.Clones = nil
			model.Name = core.StringPtr("my-snapshot")
			model.ResourceGroup = nil
			model.UserTags = nil
			model.EncryptionKey = nil
			model.SourceSnapshot = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotPrototypeSnapshotBySourceSnapshot
			err = vpcv1.UnmarshalSnapshotPrototypeSnapshotBySourceSnapshot(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSnapshotPrototypeSnapshotBySourceVolume successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SnapshotPrototypeSnapshotBySourceVolume)
			model.AllowedUse = nil
			model.Clones = nil
			model.Name = core.StringPtr("my-snapshot")
			model.ResourceGroup = nil
			model.UserTags = nil
			model.SourceVolume = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SnapshotPrototypeSnapshotBySourceVolume
			err = vpcv1.UnmarshalSnapshotPrototypeSnapshotBySourceVolume(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSubnetIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SubnetIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SubnetIdentityByCRN
			err = vpcv1.UnmarshalSubnetIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSubnetIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SubnetIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SubnetIdentityByHref
			err = vpcv1.UnmarshalSubnetIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSubnetIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SubnetIdentityByID)
			model.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SubnetIdentityByID
			err = vpcv1.UnmarshalSubnetIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSubnetPrototypeSubnetByCIDR successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SubnetPrototypeSubnetByCIDR)
			model.IPVersion = core.StringPtr("ipv4")
			model.Name = core.StringPtr("my-subnet")
			model.NetworkACL = nil
			model.PublicGateway = nil
			model.ResourceGroup = nil
			model.RoutingTable = nil
			model.VPC = nil
			model.Ipv4CIDRBlock = core.StringPtr("10.0.0.0/24")
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SubnetPrototypeSubnetByCIDR
			err = vpcv1.UnmarshalSubnetPrototypeSubnetByCIDR(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSubnetPrototypeSubnetByTotalCount successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SubnetPrototypeSubnetByTotalCount)
			model.IPVersion = core.StringPtr("ipv4")
			model.Name = core.StringPtr("my-subnet")
			model.NetworkACL = nil
			model.PublicGateway = nil
			model.ResourceGroup = nil
			model.RoutingTable = nil
			model.VPC = nil
			model.TotalIpv4AddressCount = core.Int64Ptr(int64(256))
			model.Zone = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SubnetPrototypeSubnetByTotalCount
			err = vpcv1.UnmarshalSubnetPrototypeSubnetByTotalCount(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SubnetPublicGatewayPatchPublicGatewayIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SubnetPublicGatewayPatchPublicGatewayIdentityByCRN
			err = vpcv1.UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SubnetPublicGatewayPatchPublicGatewayIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SubnetPublicGatewayPatchPublicGatewayIdentityByHref
			err = vpcv1.UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SubnetPublicGatewayPatchPublicGatewayIdentityByID)
			model.ID = core.StringPtr("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SubnetPublicGatewayPatchPublicGatewayIdentityByID
			err = vpcv1.UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalTrustedProfileIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.TrustedProfileIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.TrustedProfileIdentityByCRN
			err = vpcv1.UnmarshalTrustedProfileIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalTrustedProfileIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.TrustedProfileIdentityByID)
			model.ID = core.StringPtr("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.TrustedProfileIdentityByID
			err = vpcv1.UnmarshalTrustedProfileIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype)
			model.ManualServers = nil
			model.Type = core.StringPtr("manual")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype
			err = vpcv1.UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype)
			model.Type = core.StringPtr("system")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype
			err = vpcv1.UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVpcdnsResolverVPCPatchVPCIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VpcdnsResolverVPCPatchVPCIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VpcdnsResolverVPCPatchVPCIdentityByCRN
			err = vpcv1.UnmarshalVpcdnsResolverVPCPatchVPCIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVpcdnsResolverVPCPatchVPCIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VpcdnsResolverVPCPatchVPCIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VpcdnsResolverVPCPatchVPCIdentityByHref
			err = vpcv1.UnmarshalVpcdnsResolverVPCPatchVPCIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVpcdnsResolverVPCPatchVPCIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VpcdnsResolverVPCPatchVPCIdentityByID)
			model.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VpcdnsResolverVPCPatchVPCIdentityByID
			err = vpcv1.UnmarshalVpcdnsResolverVPCPatchVPCIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPCIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPCIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPCIdentityByCRN
			err = vpcv1.UnmarshalVPCIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPCIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPCIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPCIdentityByHref
			err = vpcv1.UnmarshalVPCIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPCIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPCIdentityByID)
			model.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPCIdentityByID
			err = vpcv1.UnmarshalVPCIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress)
			model.Asn = core.Int64Ptr(int64(38))
			model.IkeIdentity = nil
			model.Address = core.StringPtr("192.0.2.5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress
			err = vpcv1.UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn)
			model.Asn = core.Int64Ptr(int64(38))
			model.IkeIdentity = nil
			model.Fqdn = core.StringPtr("my-service.example.com")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn
			err = vpcv1.UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn)
			model.Type = core.StringPtr("fqdn")
			model.Value = core.StringPtr("my-service.example.com")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn
			err = vpcv1.UnmarshalVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityHostname successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityHostname)
			model.Type = core.StringPtr("fqdn")
			model.Value = core.StringPtr("my-hostname")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityHostname
			err = vpcv1.UnmarshalVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityHostname(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityIPv4 successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityIPv4)
			model.Type = core.StringPtr("fqdn")
			model.Value = core.StringPtr("192.168.3.4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityIPv4
			err = vpcv1.UnmarshalVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityIPv4(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityKeyID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityKeyID)
			model.Type = core.StringPtr("fqdn")
			model.Value = core.StringPtr("qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityKeyID
			err = vpcv1.UnmarshalVPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityKeyID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref
			err = vpcv1.UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID)
			model.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID
			err = vpcv1.UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref
			err = vpcv1.UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID)
			model.ID = core.StringPtr("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID
			err = vpcv1.UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref
			err = vpcv1.UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID)
			model.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID
			err = vpcv1.UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref
			err = vpcv1.UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID)
			model.ID = core.StringPtr("r006-51eae621-dbbc-4c47-b623-b57a43c19876")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID
			err = vpcv1.UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch)
			model.Asn = core.Int64Ptr(int64(38))
			model.Address = core.StringPtr("192.0.2.5")
			model.Fqdn = core.StringPtr("my-service.example.com")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch
			err = vpcv1.UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch)
			model.Address = core.StringPtr("192.0.2.5")
			model.Fqdn = core.StringPtr("my-service.example.com")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch
			err = vpcv1.UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch)
			model.Address = core.StringPtr("192.0.2.5")
			model.Fqdn = core.StringPtr("my-service.example.com")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch
			err = vpcv1.UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPolicyModePeerPrototypeVPNGatewayConnectionPeerByAddress successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPolicyModePeerPrototypeVPNGatewayConnectionPeerByAddress)
			model.CIDRs = []string{"203.0.113.0/24"}
			model.IkeIdentity = nil
			model.Address = core.StringPtr("192.0.2.5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPolicyModePeerPrototypeVPNGatewayConnectionPeerByAddress
			err = vpcv1.UnmarshalVPNGatewayConnectionPolicyModePeerPrototypeVPNGatewayConnectionPeerByAddress(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPolicyModePeerPrototypeVPNGatewayConnectionPeerByFqdn successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPolicyModePeerPrototypeVPNGatewayConnectionPeerByFqdn)
			model.CIDRs = []string{"203.0.113.0/24"}
			model.IkeIdentity = nil
			model.Fqdn = core.StringPtr("my-service.example.com")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPolicyModePeerPrototypeVPNGatewayConnectionPeerByFqdn
			err = vpcv1.UnmarshalVPNGatewayConnectionPolicyModePeerPrototypeVPNGatewayConnectionPeerByFqdn(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype)
			model.AdminStateUp = core.BoolPtr(true)
			model.DeadPeerDetection = nil
			model.EstablishMode = core.StringPtr("bidirectional")
			model.IkePolicy = nil
			model.IpsecPolicy = nil
			model.Name = core.StringPtr("my-vpn-gateway-connection")
			model.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
			model.DistributeTraffic = core.BoolPtr(false)
			model.Local = nil
			model.Peer = nil
			model.RoutingProtocol = core.StringPtr("bgp")
			model.Tunnels = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype)
			model.AdminStateUp = core.BoolPtr(true)
			model.DeadPeerDetection = nil
			model.EstablishMode = core.StringPtr("bidirectional")
			model.IkePolicy = nil
			model.IpsecPolicy = nil
			model.Name = core.StringPtr("my-vpn-gateway-connection")
			model.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
			model.Local = nil
			model.Peer = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype)
			model.AdminStateUp = core.BoolPtr(true)
			model.DeadPeerDetection = nil
			model.EstablishMode = core.StringPtr("bidirectional")
			model.IkePolicy = nil
			model.IpsecPolicy = nil
			model.Name = core.StringPtr("my-vpn-gateway-connection")
			model.Psk = core.StringPtr("lkj14b1oi0alcniejkso")
			model.DistributeTraffic = core.BoolPtr(false)
			model.Local = nil
			model.Peer = nil
			model.RoutingProtocol = core.StringPtr("none")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype
			err = vpcv1.UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress)
			model.IkeIdentity = nil
			model.Address = core.StringPtr("192.0.2.5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress
			err = vpcv1.UnmarshalVPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn)
			model.IkeIdentity = nil
			model.Fqdn = core.StringPtr("my-service.example.com")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn
			err = vpcv1.UnmarshalVPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayPrototypeVPNGatewayPolicyModePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayPrototypeVPNGatewayPolicyModePrototype)
			model.Name = core.StringPtr("my-vpn-gateway")
			model.ResourceGroup = nil
			model.Subnet = nil
			model.Mode = core.StringPtr("policy")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayPrototypeVPNGatewayPolicyModePrototype
			err = vpcv1.UnmarshalVPNGatewayPrototypeVPNGatewayPolicyModePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayPrototypeVPNGatewayRouteModePrototype)
			model.Name = core.StringPtr("my-vpn-gateway")
			model.ResourceGroup = nil
			model.Subnet = nil
			model.AdvertisedCIDRs = []string{"192.168.3.0/24"}
			model.LocalAsn = core.Int64Ptr(int64(64520))
			model.Mode = core.StringPtr("route")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayPrototypeVPNGatewayRouteModePrototype
			err = vpcv1.UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNServerAuthenticationByUsernameIDProviderByIam successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNServerAuthenticationByUsernameIDProviderByIam)
			model.ProviderType = core.StringPtr("iam")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNServerAuthenticationByUsernameIDProviderByIam
			err = vpcv1.UnmarshalVPNServerAuthenticationByUsernameIDProviderByIam(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype)
			model.Method = core.StringPtr("certificate")
			model.ClientCa = nil
			model.Crl = core.StringPtr("testString")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype
			err = vpcv1.UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype)
			model.Method = core.StringPtr("username")
			model.IdentityProvider = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype
			err = vpcv1.UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext)
			model.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext
			err = vpcv1.UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext)
			model.Address = core.StringPtr("192.168.3.4")
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-reserved-ip")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
			err = vpcv1.UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext)
			model.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext
			err = vpcv1.UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext)
			model.Address = core.StringPtr("192.168.3.4")
			model.AutoDelete = core.BoolPtr(false)
			model.Name = core.StringPtr("my-reserved-ip")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
			err = vpcv1.UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentity)
			model.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentity
			err = vpcv1.UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext)
			model.Bandwidth = core.Int64Ptr(int64(1000))
			model.Iops = core.Int64Ptr(int64(10000))
			model.Name = core.StringPtr("my-volume")
			model.Profile = nil
			model.ResourceGroup = nil
			model.UserTags = nil
			model.Capacity = core.Int64Ptr(int64(100))
			model.EncryptionKey = nil
			model.AllowedUse = nil
			model.SourceSnapshot = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext
			err = vpcv1.UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeIdentityByCRN
			err = vpcv1.UnmarshalVolumeIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeIdentityByHref
			err = vpcv1.UnmarshalVolumeIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeIdentityByID)
			model.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeIdentityByID
			err = vpcv1.UnmarshalVolumeIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeProfileIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeProfileIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeProfileIdentityByHref
			err = vpcv1.UnmarshalVolumeProfileIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeProfileIdentityByName successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeProfileIdentityByName)
			model.Name = core.StringPtr("general-purpose")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeProfileIdentityByName
			err = vpcv1.UnmarshalVolumeProfileIdentityByName(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumePrototypeVolumeByCapacity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumePrototypeVolumeByCapacity)
			model.Bandwidth = core.Int64Ptr(int64(1000))
			model.Iops = core.Int64Ptr(int64(10000))
			model.Name = core.StringPtr("my-volume")
			model.Profile = nil
			model.ResourceGroup = nil
			model.UserTags = nil
			model.Zone = nil
			model.Capacity = core.Int64Ptr(int64(100))
			model.EncryptionKey = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumePrototypeVolumeByCapacity
			err = vpcv1.UnmarshalVolumePrototypeVolumeByCapacity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumePrototypeVolumeBySourceSnapshot successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumePrototypeVolumeBySourceSnapshot)
			model.Bandwidth = core.Int64Ptr(int64(1000))
			model.Iops = core.Int64Ptr(int64(10000))
			model.Name = core.StringPtr("my-volume")
			model.Profile = nil
			model.ResourceGroup = nil
			model.UserTags = nil
			model.Zone = nil
			model.AllowedUse = nil
			model.Capacity = core.Int64Ptr(int64(100))
			model.EncryptionKey = nil
			model.SourceSnapshot = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumePrototypeVolumeBySourceSnapshot
			err = vpcv1.UnmarshalVolumePrototypeVolumeBySourceSnapshot(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalZoneIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ZoneIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ZoneIdentityByHref
			err = vpcv1.UnmarshalZoneIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalZoneIdentityByName successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ZoneIdentityByName)
			model.Name = core.StringPtr("us-south-1")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ZoneIdentityByName
			err = vpcv1.UnmarshalZoneIdentityByName(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN
			err = vpcv1.UnmarshalBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
			err = vpcv1.UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
			err = vpcv1.UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID)
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID
			err = vpcv1.UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref
			err = vpcv1.UnmarshalClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByID)
			model.ID = core.StringPtr("0717-d4d6489a-3bf5-4104-a33a-3572faf2d117")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByID
			err = vpcv1.UnmarshalClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEndpointGatewayReservedIPReservedIPIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EndpointGatewayReservedIPReservedIPIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EndpointGatewayReservedIPReservedIPIdentityByHref
			err = vpcv1.UnmarshalEndpointGatewayReservedIPReservedIPIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalEndpointGatewayReservedIPReservedIPIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.EndpointGatewayReservedIPReservedIPIdentityByID)
			model.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.EndpointGatewayReservedIPReservedIPIdentityByID
			err = vpcv1.UnmarshalEndpointGatewayReservedIPReservedIPIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref
			err = vpcv1.UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID)
			model.ID = core.StringPtr("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID
			err = vpcv1.UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
			err = vpcv1.UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID)
			model.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID
			err = vpcv1.UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
			err = vpcv1.UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
			err = vpcv1.UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID)
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID
			err = vpcv1.UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref
			err = vpcv1.UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID)
			model.ID = core.StringPtr("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID
			err = vpcv1.UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
			err = vpcv1.UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID)
			model.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID
			err = vpcv1.UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
			err = vpcv1.UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
			err = vpcv1.UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID)
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID
			err = vpcv1.UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID)
			model.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID)
			model.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID)
			model.ID = core.StringPtr("0717-d54eb633-98ea-459d-aa00-6a8e780175a7")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID)
			model.ID = core.StringPtr("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID)
			model.ID = core.StringPtr("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID)
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID
			err = vpcv1.UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref
			err = vpcv1.UnmarshalInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByID)
			model.ID = core.StringPtr("0717-ffc092f7-5d02-4b93-ab69-26860529b9fb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByID
			err = vpcv1.UnmarshalInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup)
			model.Name = core.StringPtr("my-instance-group-manager-action")
			model.CronSpec = core.StringPtr("30 */2 * * 1-5")
			model.Group = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup
			err = vpcv1.UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager)
			model.Name = core.StringPtr("my-instance-group-manager-action")
			model.CronSpec = core.StringPtr("30 */2 * * 1-5")
			model.Manager = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager
			err = vpcv1.UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup)
			model.Name = core.StringPtr("my-instance-group-manager-action")
			model.Group = nil
			model.RunAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup
			err = vpcv1.UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager)
			model.Name = core.StringPtr("my-instance-group-manager-action")
			model.Manager = nil
			model.RunAt = CreateMockDateTime("2019-01-01T12:00:00.000Z")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager
			err = vpcv1.UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref)
			model.MaxMembershipCount = core.Int64Ptr(int64(10))
			model.MinMembershipCount = core.Int64Ptr(int64(10))
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r006-bd21f31f-8a05-4451-836d-ab0347e91fea")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref
			err = vpcv1.UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID)
			model.MaxMembershipCount = core.Int64Ptr(int64(10))
			model.MinMembershipCount = core.Int64Ptr(int64(10))
			model.ID = core.StringPtr("r006-bd21f31f-8a05-4451-836d-ab0347e91fea")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID
			err = vpcv1.UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
			err = vpcv1.UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
			err = vpcv1.UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID)
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID
			err = vpcv1.UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN
			err = vpcv1.UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref
			err = vpcv1.UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID)
			model.ID = core.StringPtr("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID
			err = vpcv1.UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN
			err = vpcv1.UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref
			err = vpcv1.UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID)
			model.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID
			err = vpcv1.UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN
			err = vpcv1.UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref
			err = vpcv1.UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID)
			model.ID = core.StringPtr("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID
			err = vpcv1.UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN
			err = vpcv1.UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref
			err = vpcv1.UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID)
			model.ID = core.StringPtr("0717-1e09281b-f177-46fb-baf1-bc152b2e391a")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID
			err = vpcv1.UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN
			err = vpcv1.UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref
			err = vpcv1.UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID)
			model.ID = core.StringPtr("r006-418fe842-a3e9-47b9-a938-1aa5bd632871")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID
			err = vpcv1.UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.CatalogOffering = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment
			err = vpcv1.UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.CatalogOffering = nil
			model.Zone = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface
			err = vpcv1.UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Image = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment
			err = vpcv1.UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Image = nil
			model.Zone = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface
			err = vpcv1.UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment
			err = vpcv1.UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Zone = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface
			err = vpcv1.UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment
			err = vpcv1.UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Zone = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface
			err = vpcv1.UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.CatalogOffering = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment
			err = vpcv1.UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.CatalogOffering = nil
			model.Zone = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface
			err = vpcv1.UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Image = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment
			err = vpcv1.UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Image = nil
			model.Zone = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface
			err = vpcv1.UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Zone = nil
			model.NetworkAttachments = nil
			model.PrimaryNetworkAttachment = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment
			err = vpcv1.UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface)
			model.AvailabilityPolicy = nil
			model.ClusterNetworkAttachments = nil
			model.ConfidentialComputeMode = core.StringPtr("disabled")
			model.DefaultTrustedProfile = nil
			model.EnableSecureBoot = core.BoolPtr(true)
			model.Keys = nil
			model.MetadataService = nil
			model.Name = core.StringPtr("my-instance")
			model.PlacementTarget = nil
			model.Profile = nil
			model.ReservationAffinity = nil
			model.ResourceGroup = nil
			model.TotalVolumeBandwidth = core.Int64Ptr(int64(500))
			model.UserData = core.StringPtr("testString")
			model.VolumeAttachments = nil
			model.VolumeBandwidthQosMode = core.StringPtr("pooled")
			model.VPC = nil
			model.BootVolumeAttachment = nil
			model.Zone = nil
			model.NetworkInterfaces = nil
			model.PrimaryNetworkInterface = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface
			err = vpcv1.UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentityLoadBalancerListenerIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentityLoadBalancerListenerIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentityLoadBalancerListenerIdentityByHref
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentityLoadBalancerListenerIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentityLoadBalancerListenerIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentityLoadBalancerListenerIdentityByID)
			model.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentityLoadBalancerListenerIdentityByID
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentityLoadBalancerListenerIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
			model.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentityLoadBalancerListenerIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentityLoadBalancerListenerIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentityLoadBalancerListenerIdentityByHref
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentityLoadBalancerListenerIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentityLoadBalancerListenerIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentityLoadBalancerListenerIdentityByID)
			model.ID = core.StringPtr("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentityLoadBalancerListenerIdentityByID
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerIdentityLoadBalancerListenerIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID)
			model.ID = core.StringPtr("r006-70294e14-4e61-11e8-bcf4-0242ac110004")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID
			err = vpcv1.UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN
			err = vpcv1.UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref
			err = vpcv1.UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID)
			model.ID = core.StringPtr("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID
			err = vpcv1.UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByCRN
			err = vpcv1.UnmarshalLoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByHref
			err = vpcv1.UnmarshalLoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByID)
			model.ID = core.StringPtr("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByID
			err = vpcv1.UnmarshalLoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref
			err = vpcv1.UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID)
			model.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID
			err = vpcv1.UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkInterfaceIPPrototypeReservedIPIdentityByHref
			err = vpcv1.UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.NetworkInterfaceIPPrototypeReservedIPIdentityByID)
			model.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.NetworkInterfaceIPPrototypeReservedIPIdentityByID
			err = vpcv1.UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress)
			model.Address = core.StringPtr("203.0.113.1")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress
			err = vpcv1.UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN
			err = vpcv1.UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref
			err = vpcv1.UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID)
			model.ID = core.StringPtr("r006-f45e0d90-12a8-4460-8210-290ff2ab75cd")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID
			err = vpcv1.UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN
			err = vpcv1.UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref
			err = vpcv1.UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID)
			model.ID = core.StringPtr("r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID
			err = vpcv1.UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
			err = vpcv1.UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
			err = vpcv1.UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID)
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID
			err = vpcv1.UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP)
			model.Address = core.StringPtr("0.0.0.0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP
			err = vpcv1.UnmarshalRouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP)
			model.Address = core.StringPtr("192.168.3.4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP
			err = vpcv1.UnmarshalRouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref
			err = vpcv1.UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID)
			model.ID = core.StringPtr("0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID
			err = vpcv1.UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP)
			model.Address = core.StringPtr("0.0.0.0")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP
			err = vpcv1.UnmarshalRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP)
			model.Address = core.StringPtr("192.168.3.4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP
			err = vpcv1.UnmarshalRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref
			err = vpcv1.UnmarshalRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID)
			model.ID = core.StringPtr("0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID
			err = vpcv1.UnmarshalRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN
			err = vpcv1.UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref
			err = vpcv1.UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID)
			model.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID
			err = vpcv1.UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN
			err = vpcv1.UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref
			err = vpcv1.UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID)
			model.ID = core.StringPtr("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID
			err = vpcv1.UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
			err = vpcv1.UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
			err = vpcv1.UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID)
			model.ID = core.StringPtr("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID
			err = vpcv1.UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByCRN
			err = vpcv1.UnmarshalShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByHref
			err = vpcv1.UnmarshalShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.ShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByID)
			model.ID = core.StringPtr("r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.ShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByID
			err = vpcv1.UnmarshalShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch)
			model.Asn = core.Int64Ptr(int64(38))
			model.Address = core.StringPtr("192.0.2.5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch
			err = vpcv1.UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch)
			model.Asn = core.Int64Ptr(int64(38))
			model.Fqdn = core.StringPtr("my-service.example.com")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch
			err = vpcv1.UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch)
			model.Address = core.StringPtr("192.0.2.5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch
			err = vpcv1.UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFqdnPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFqdnPatch)
			model.Fqdn = core.StringPtr("my-service.example.com")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFqdnPatch
			err = vpcv1.UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFqdnPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch)
			model.Address = core.StringPtr("192.0.2.5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch
			err = vpcv1.UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch)
			model.Fqdn = core.StringPtr("my-service.example.com")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch
			err = vpcv1.UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref
			err = vpcv1.UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID)
			model.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID
			err = vpcv1.UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref
			err = vpcv1.UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID)
			model.ID = core.StringPtr("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID
			err = vpcv1.UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN)
			model.CRN = core.StringPtr("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN
			err = vpcv1.UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref)
			model.Href = core.StringPtr("https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref
			err = vpcv1.UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID)
			model.ID = core.StringPtr("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5")

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID
			err = vpcv1.UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity)
			model.Bandwidth = core.Int64Ptr(int64(1000))
			model.Iops = core.Int64Ptr(int64(10000))
			model.Name = core.StringPtr("my-volume")
			model.Profile = nil
			model.ResourceGroup = nil
			model.UserTags = nil
			model.Capacity = core.Int64Ptr(int64(100))
			model.EncryptionKey = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity
			err = vpcv1.UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
		It(`Invoke UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot successfully`, func() {
			// Construct an instance of the model.
			model := new(vpcv1.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot)
			model.Bandwidth = core.Int64Ptr(int64(1000))
			model.Iops = core.Int64Ptr(int64(10000))
			model.Name = core.StringPtr("my-volume")
			model.Profile = nil
			model.ResourceGroup = nil
			model.UserTags = nil
			model.AllowedUse = nil
			model.Capacity = core.Int64Ptr(int64(100))
			model.EncryptionKey = nil
			model.SourceSnapshot = nil

			b, err := json.Marshal(model)
			Expect(err).To(BeNil())

			var raw map[string]json.RawMessage
			err = json.Unmarshal(b, &raw)
			Expect(err).To(BeNil())

			var result *vpcv1.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot
			err = vpcv1.UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot(raw, &result)
			Expect(err).To(BeNil())
			Expect(result).ToNot(BeNil())
			Expect(result).To(Equal(model))
		})
	})
	Describe(`Utility function tests`, func() {
		It(`Invoke CreateMockByteArray() successfully`, func() {
			mockByteArray := CreateMockByteArray("VGhpcyBpcyBhIHRlc3Qgb2YgdGhlIGVtZXJnZW5jeSBicm9hZGNhc3Qgc3lzdGVt")
			Expect(mockByteArray).ToNot(BeNil())
		})
		It(`Invoke CreateMockUUID() successfully`, func() {
			mockUUID := CreateMockUUID("9fab83da-98cb-4f18-a7ba-b6f0435c9673")
			Expect(mockUUID).ToNot(BeNil())
		})
		It(`Invoke CreateMockReader() successfully`, func() {
			mockReader := CreateMockReader("This is a test.")
			Expect(mockReader).ToNot(BeNil())
		})
		It(`Invoke CreateMockDate() successfully`, func() {
			mockDate := CreateMockDate("2019-01-01")
			Expect(mockDate).ToNot(BeNil())
		})
		It(`Invoke CreateMockDateTime() successfully`, func() {
			mockDateTime := CreateMockDateTime("2019-01-01T12:00:00.000Z")
			Expect(mockDateTime).ToNot(BeNil())
		})
	})
})

//
// Utility functions used by the generated test code
//

func CreateMockByteArray(encodedString string) *[]byte {
	ba, err := base64.StdEncoding.DecodeString(encodedString)
	if err != nil {
		panic(err)
	}
	return &ba
}

func CreateMockUUID(mockData string) *strfmt.UUID {
	uuid := strfmt.UUID(mockData)
	return &uuid
}

func CreateMockReader(mockData string) io.ReadCloser {
	return io.NopCloser(bytes.NewReader([]byte(mockData)))
}

func CreateMockDate(mockData string) *strfmt.Date {
	d, err := core.ParseDate(mockData)
	if err != nil {
		return nil
	}
	return &d
}

func CreateMockDateTime(mockData string) *strfmt.DateTime {
	d, err := core.ParseDateTime(mockData)
	if err != nil {
		return nil
	}
	return &d
}

func SetTestEnvironment(testEnvironment map[string]string) {
	for key, value := range testEnvironment {
		os.Setenv(key, value)
	}
}

func ClearTestEnvironment(testEnvironment map[string]string) {
	for key := range testEnvironment {
		os.Unsetenv(key)
	}
}
